@farm.js/react 0.1.0-beta.35 → 0.1.0-beta.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/compiler-runtime.cjs +118 -123
- package/dist/compiler-runtime.cjs.map +1 -1
- package/dist/compiler-runtime.d.mts +8 -1
- package/dist/compiler-runtime.d.ts +8 -1
- package/dist/compiler-runtime.mjs +118 -124
- package/dist/compiler-runtime.mjs.map +1 -1
- package/dist/vite.cjs +204 -165
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.mjs +204 -165
- package/dist/vite.mjs.map +1 -1
- package/package.json +3 -3
package/dist/vite.cjs
CHANGED
|
@@ -767,7 +767,7 @@ function rewriteKeyedMapUpdateHints(root, hintedStateIndices, statesBySetter, he
|
|
|
767
767
|
}
|
|
768
768
|
path.node.arguments[0] = core.types.arrowFunctionExpression(
|
|
769
769
|
[core.types.cloneNode(previous)],
|
|
770
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
770
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
771
771
|
core.types.cloneNode(previous),
|
|
772
772
|
core.types.arrowFunctionExpression(
|
|
773
773
|
[core.types.cloneNode(pipelineValue), core.types.cloneNode(applyMap)],
|
|
@@ -839,7 +839,7 @@ function rewriteKeyedArrayAppendHints(root, hintedStateIndices, statesBySetter,
|
|
|
839
839
|
core.types.variableDeclarator(core.types.cloneNode(nextValue), core.types.cloneNode(updateExpression, true))
|
|
840
840
|
]),
|
|
841
841
|
core.types.returnStatement(
|
|
842
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
842
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
843
843
|
core.types.cloneNode(previous),
|
|
844
844
|
core.types.cloneNode(nextValue)
|
|
845
845
|
])
|
|
@@ -915,7 +915,7 @@ function rewriteKeyedArrayPrependHints(root, hintedStateIndices, statesBySetter,
|
|
|
915
915
|
core.types.variableDeclarator(core.types.cloneNode(nextValue), core.types.cloneNode(updateExpression, true))
|
|
916
916
|
]),
|
|
917
917
|
core.types.returnStatement(
|
|
918
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
918
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
919
919
|
core.types.cloneNode(previous),
|
|
920
920
|
core.types.cloneNode(nextValue)
|
|
921
921
|
])
|
|
@@ -1006,7 +1006,7 @@ function rewriteKeyedArrayRollingWindowHints(root, hintedStateIndices, statesByS
|
|
|
1006
1006
|
),
|
|
1007
1007
|
core.types.variableDeclarator(
|
|
1008
1008
|
core.types.cloneNode(retained),
|
|
1009
|
-
core.types.callExpression(core.types.cloneNode(sliceHelperIdentifier), [
|
|
1009
|
+
core.types.callExpression(core.types.cloneNode(sliceHelperIdentifier()), [
|
|
1010
1010
|
core.types.cloneNode(previous),
|
|
1011
1011
|
core.types.cloneNode(sliceMethod),
|
|
1012
1012
|
core.types.cloneNode(retainedStart, true)
|
|
@@ -1015,7 +1015,7 @@ function rewriteKeyedArrayRollingWindowHints(root, hintedStateIndices, statesByS
|
|
|
1015
1015
|
core.types.variableDeclarator(core.types.cloneNode(nextValue), core.types.arrayExpression(nextElements))
|
|
1016
1016
|
]),
|
|
1017
1017
|
core.types.returnStatement(
|
|
1018
|
-
core.types.callExpression(core.types.cloneNode(rollingWindowHelperIdentifier), [
|
|
1018
|
+
core.types.callExpression(core.types.cloneNode(rollingWindowHelperIdentifier()), [
|
|
1019
1019
|
core.types.cloneNode(previous),
|
|
1020
1020
|
core.types.cloneNode(retained),
|
|
1021
1021
|
core.types.cloneNode(nextValue)
|
|
@@ -1114,18 +1114,18 @@ function rewriteKeyedArrayPositionHints(root, hintedStateIndices, statesBySetter
|
|
|
1114
1114
|
)
|
|
1115
1115
|
]),
|
|
1116
1116
|
core.types.returnStatement(
|
|
1117
|
-
kind === "batch-insert" ? core.types.callExpression(core.types.cloneNode(batchInsertHelperIdentifier), [
|
|
1117
|
+
kind === "batch-insert" ? core.types.callExpression(core.types.cloneNode(batchInsertHelperIdentifier()), [
|
|
1118
1118
|
core.types.cloneNode(previous),
|
|
1119
1119
|
core.types.cloneNode(method),
|
|
1120
1120
|
core.types.cloneNode(position, true),
|
|
1121
1121
|
...args.slice(2).map((argument) => core.types.cloneNode(argument, true))
|
|
1122
|
-
]) : kind === "window-replace" ? core.types.callExpression(core.types.cloneNode(windowReplaceHelperIdentifier), [
|
|
1122
|
+
]) : kind === "window-replace" ? core.types.callExpression(core.types.cloneNode(windowReplaceHelperIdentifier()), [
|
|
1123
1123
|
core.types.cloneNode(previous),
|
|
1124
1124
|
core.types.cloneNode(method),
|
|
1125
1125
|
core.types.cloneNode(position, true),
|
|
1126
1126
|
core.types.cloneNode(args[1], true),
|
|
1127
1127
|
...args.slice(2).map((argument) => core.types.cloneNode(argument, true))
|
|
1128
|
-
]) : core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
1128
|
+
]) : core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
1129
1129
|
core.types.cloneNode(previous),
|
|
1130
1130
|
core.types.cloneNode(method),
|
|
1131
1131
|
core.types.stringLiteral(kind),
|
|
@@ -1185,7 +1185,7 @@ function rewriteKeyedArrayReorderHints(root, hintedStateIndices, statesBySetter,
|
|
|
1185
1185
|
)
|
|
1186
1186
|
]),
|
|
1187
1187
|
core.types.returnStatement(
|
|
1188
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
1188
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
1189
1189
|
core.types.cloneNode(previous),
|
|
1190
1190
|
core.types.cloneNode(method)
|
|
1191
1191
|
])
|
|
@@ -1391,7 +1391,7 @@ function rewriteKeyedArrayReorderPipelineHints(root, hintedStateIndices, statesB
|
|
|
1391
1391
|
core.types.variableDeclaration("const", [
|
|
1392
1392
|
core.types.variableDeclarator(
|
|
1393
1393
|
core.types.cloneNode(result2),
|
|
1394
|
-
core.types.callExpression(core.types.cloneNode(mapHelperIdentifier), [
|
|
1394
|
+
core.types.callExpression(core.types.cloneNode(mapHelperIdentifier()), [
|
|
1395
1395
|
core.types.cloneNode(value),
|
|
1396
1396
|
core.types.arrowFunctionExpression(
|
|
1397
1397
|
[core.types.cloneNode(pipelineValue), core.types.cloneNode(applyMap)],
|
|
@@ -1428,7 +1428,7 @@ function rewriteKeyedArrayReorderPipelineHints(root, hintedStateIndices, statesB
|
|
|
1428
1428
|
core.types.variableDeclaration("const", [
|
|
1429
1429
|
core.types.variableDeclarator(
|
|
1430
1430
|
core.types.cloneNode(result),
|
|
1431
|
-
core.types.callExpression(core.types.cloneNode(helper), [
|
|
1431
|
+
core.types.callExpression(core.types.cloneNode(helper()), [
|
|
1432
1432
|
core.types.cloneNode(value),
|
|
1433
1433
|
core.types.cloneNode(method),
|
|
1434
1434
|
...args
|
|
@@ -1454,7 +1454,9 @@ function rewriteKeyedArrayReorderPipelineHints(root, hintedStateIndices, statesB
|
|
|
1454
1454
|
}
|
|
1455
1455
|
statements.push(
|
|
1456
1456
|
core.types.returnStatement(
|
|
1457
|
-
terminalStructuralPipeline ? core.types.callExpression(core.types.cloneNode(mappedStructuralHelperIdentifier), [
|
|
1457
|
+
terminalStructuralPipeline ? core.types.callExpression(core.types.cloneNode(mappedStructuralHelperIdentifier()), [
|
|
1458
|
+
core.types.cloneNode(value)
|
|
1459
|
+
]) : core.types.cloneNode(value)
|
|
1458
1460
|
)
|
|
1459
1461
|
);
|
|
1460
1462
|
if (terminalStructuralPipeline) terminalStructuralPipelineCount += 1;
|
|
@@ -1495,13 +1497,13 @@ function rewriteQueuedKeyedArrayReorderMapHints(root, statesBySetter, mapUpdateI
|
|
|
1495
1497
|
return found;
|
|
1496
1498
|
};
|
|
1497
1499
|
const reorderHelperNames = /* @__PURE__ */ new Set([
|
|
1498
|
-
mapReorderIdentifier.name,
|
|
1499
|
-
reorderIdentifier.name,
|
|
1500
|
-
sortIdentifier.name
|
|
1500
|
+
mapReorderIdentifier().name,
|
|
1501
|
+
reorderIdentifier().name,
|
|
1502
|
+
sortIdentifier().name
|
|
1501
1503
|
]);
|
|
1502
1504
|
const structuralHelperNames = /* @__PURE__ */ new Set([
|
|
1503
|
-
structuralReorderIdentifier.name,
|
|
1504
|
-
structuralSortIdentifier.name
|
|
1505
|
+
structuralReorderIdentifier().name,
|
|
1506
|
+
structuralSortIdentifier().name
|
|
1505
1507
|
]);
|
|
1506
1508
|
core.traverse(file, {
|
|
1507
1509
|
BlockStatement(path) {
|
|
@@ -1528,7 +1530,7 @@ function rewriteQueuedKeyedArrayReorderMapHints(root, statesBySetter, mapUpdateI
|
|
|
1528
1530
|
queuedReorderState = state.index;
|
|
1529
1531
|
continue;
|
|
1530
1532
|
}
|
|
1531
|
-
if (queuedReorderState !== state.index || !core.types.isCallExpression(updater.body) || !core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier.name }) || updater.body.arguments.length !== 2) {
|
|
1533
|
+
if (queuedReorderState !== state.index || !core.types.isCallExpression(updater.body) || !core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier().name }) || updater.body.arguments.length !== 2) {
|
|
1532
1534
|
queuedReorderState = void 0;
|
|
1533
1535
|
continue;
|
|
1534
1536
|
}
|
|
@@ -1548,7 +1550,7 @@ function rewriteQueuedKeyedArrayReorderMapHints(root, statesBySetter, mapUpdateI
|
|
|
1548
1550
|
queuedReorderState = void 0;
|
|
1549
1551
|
continue;
|
|
1550
1552
|
}
|
|
1551
|
-
updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier);
|
|
1553
|
+
updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier());
|
|
1552
1554
|
mapCount += pipelineMapCount;
|
|
1553
1555
|
}
|
|
1554
1556
|
}
|
|
@@ -1559,7 +1561,7 @@ function rewriteQueuedKeyedArrayReorderMapHints(root, statesBySetter, mapUpdateI
|
|
|
1559
1561
|
};
|
|
1560
1562
|
}
|
|
1561
1563
|
function countKeyedArrayMapPipeline(updater, mapUpdateIdentifier) {
|
|
1562
|
-
if (!core.types.isCallExpression(updater.body) || !core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier.name }) || updater.body.arguments.length !== 2) {
|
|
1564
|
+
if (!core.types.isCallExpression(updater.body) || !core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier().name }) || updater.body.arguments.length !== 2) {
|
|
1563
1565
|
return 0;
|
|
1564
1566
|
}
|
|
1565
1567
|
const pipeline = updater.body.arguments[1];
|
|
@@ -1591,7 +1593,7 @@ function rewriteQueuedKeyedArrayMappedStructuralHints(root, statesBySetter, mapU
|
|
|
1591
1593
|
const terminalStructuralReturn = (updater) => {
|
|
1592
1594
|
if (!core.types.isBlockStatement(updater.body)) return void 0;
|
|
1593
1595
|
const statement = updater.body.body.at(-1);
|
|
1594
|
-
if (!core.types.isReturnStatement(statement) || !statement.argument || !core.types.isCallExpression(statement.argument) || !core.types.isIdentifier(statement.argument.callee) || statement.argument.callee.name !== filterIdentifier.name && statement.argument.callee.name !== sliceIdentifier.name) {
|
|
1596
|
+
if (!core.types.isReturnStatement(statement) || !statement.argument || !core.types.isCallExpression(statement.argument) || !core.types.isIdentifier(statement.argument.callee) || statement.argument.callee.name !== filterIdentifier().name && statement.argument.callee.name !== sliceIdentifier().name) {
|
|
1595
1597
|
return void 0;
|
|
1596
1598
|
}
|
|
1597
1599
|
return statement;
|
|
@@ -1645,7 +1647,7 @@ function rewriteQueuedKeyedArrayMappedStructuralHints(root, statesBySetter, mapU
|
|
|
1645
1647
|
}
|
|
1646
1648
|
if (hasPendingMaps) {
|
|
1647
1649
|
for (const candidate of pendingMaps) {
|
|
1648
|
-
candidate.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier);
|
|
1650
|
+
candidate.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier());
|
|
1649
1651
|
mapCount += candidate.count;
|
|
1650
1652
|
}
|
|
1651
1653
|
}
|
|
@@ -1655,7 +1657,7 @@ function rewriteQueuedKeyedArrayMappedStructuralHints(root, statesBySetter, mapU
|
|
|
1655
1657
|
pendingMaps = [];
|
|
1656
1658
|
continue;
|
|
1657
1659
|
}
|
|
1658
|
-
structuralReturn.argument = core.types.callExpression(core.types.cloneNode(mappedStructuralIdentifier), [
|
|
1660
|
+
structuralReturn.argument = core.types.callExpression(core.types.cloneNode(mappedStructuralIdentifier()), [
|
|
1659
1661
|
core.types.cloneNode(structuralValue)
|
|
1660
1662
|
]);
|
|
1661
1663
|
structuralCount += 1;
|
|
@@ -1695,10 +1697,10 @@ function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpda
|
|
|
1695
1697
|
let mapped = false;
|
|
1696
1698
|
core.types.traverseFast(statement.argument, (node) => {
|
|
1697
1699
|
if (!found && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee)) {
|
|
1698
|
-
if (node.callee.name === filterIdentifier.name) found = "filter";
|
|
1699
|
-
if (node.callee.name === sliceIdentifier.name) found = "slice";
|
|
1700
|
+
if (node.callee.name === filterIdentifier().name) found = "filter";
|
|
1701
|
+
if (node.callee.name === sliceIdentifier().name) found = "slice";
|
|
1700
1702
|
}
|
|
1701
|
-
if (!mapped && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: mappedStructuralIdentifier.name })) {
|
|
1703
|
+
if (!mapped && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: mappedStructuralIdentifier().name })) {
|
|
1702
1704
|
mapped = true;
|
|
1703
1705
|
}
|
|
1704
1706
|
});
|
|
@@ -1747,7 +1749,7 @@ function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpda
|
|
|
1747
1749
|
}
|
|
1748
1750
|
const appendCalls = [];
|
|
1749
1751
|
core.types.traverseFast(updater.body, (node) => {
|
|
1750
|
-
if (core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: appendIdentifier.name })) {
|
|
1752
|
+
if (core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: appendIdentifier().name })) {
|
|
1751
1753
|
appendCalls.push(node);
|
|
1752
1754
|
}
|
|
1753
1755
|
});
|
|
@@ -1756,7 +1758,7 @@ function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpda
|
|
|
1756
1758
|
structuralAppendState = state.index;
|
|
1757
1759
|
if (structuralMapState === state.index) {
|
|
1758
1760
|
for (const call of appendCalls) {
|
|
1759
|
-
call.callee = core.types.cloneNode(mappedStructuralAppendIdentifier);
|
|
1761
|
+
call.callee = core.types.cloneNode(mappedStructuralAppendIdentifier());
|
|
1760
1762
|
}
|
|
1761
1763
|
mappedStructuralAppendCount += appendCalls.length;
|
|
1762
1764
|
}
|
|
@@ -1777,7 +1779,7 @@ function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpda
|
|
|
1777
1779
|
continue;
|
|
1778
1780
|
}
|
|
1779
1781
|
updater.body.callee = core.types.cloneNode(
|
|
1780
|
-
structuralAppendState === state.index ? structuralAppendMapPipelineIdentifier : mapPipelineIdentifier
|
|
1782
|
+
structuralAppendState === state.index ? structuralAppendMapPipelineIdentifier() : mapPipelineIdentifier()
|
|
1781
1783
|
);
|
|
1782
1784
|
mapCount += pipelineMapCount;
|
|
1783
1785
|
if (structuralAppendState === state.index) {
|
|
@@ -1819,10 +1821,10 @@ function rewriteQueuedKeyedArrayStructuralPrependMapHints(root, statesBySetter,
|
|
|
1819
1821
|
let mapped = false;
|
|
1820
1822
|
core.types.traverseFast(statement.argument, (node) => {
|
|
1821
1823
|
if (!found && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee)) {
|
|
1822
|
-
if (node.callee.name === filterIdentifier.name) found = "filter";
|
|
1823
|
-
if (node.callee.name === sliceIdentifier.name) found = "slice";
|
|
1824
|
+
if (node.callee.name === filterIdentifier().name) found = "filter";
|
|
1825
|
+
if (node.callee.name === sliceIdentifier().name) found = "slice";
|
|
1824
1826
|
}
|
|
1825
|
-
if (!mapped && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: mappedStructuralIdentifier.name })) {
|
|
1827
|
+
if (!mapped && core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: mappedStructuralIdentifier().name })) {
|
|
1826
1828
|
mapped = true;
|
|
1827
1829
|
}
|
|
1828
1830
|
});
|
|
@@ -1871,7 +1873,7 @@ function rewriteQueuedKeyedArrayStructuralPrependMapHints(root, statesBySetter,
|
|
|
1871
1873
|
}
|
|
1872
1874
|
const prependCalls = [];
|
|
1873
1875
|
core.types.traverseFast(updater.body, (node) => {
|
|
1874
|
-
if (core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: prependIdentifier.name })) {
|
|
1876
|
+
if (core.types.isCallExpression(node) && core.types.isIdentifier(node.callee, { name: prependIdentifier().name })) {
|
|
1875
1877
|
prependCalls.push(node);
|
|
1876
1878
|
}
|
|
1877
1879
|
});
|
|
@@ -1880,7 +1882,7 @@ function rewriteQueuedKeyedArrayStructuralPrependMapHints(root, statesBySetter,
|
|
|
1880
1882
|
structuralPrependState = state.index;
|
|
1881
1883
|
if (structuralMapState === state.index) {
|
|
1882
1884
|
for (const call of prependCalls) {
|
|
1883
|
-
call.callee = core.types.cloneNode(mappedStructuralPrependIdentifier);
|
|
1885
|
+
call.callee = core.types.cloneNode(mappedStructuralPrependIdentifier());
|
|
1884
1886
|
}
|
|
1885
1887
|
mappedStructuralPrependCount += prependCalls.length;
|
|
1886
1888
|
}
|
|
@@ -1901,7 +1903,7 @@ function rewriteQueuedKeyedArrayStructuralPrependMapHints(root, statesBySetter,
|
|
|
1901
1903
|
continue;
|
|
1902
1904
|
}
|
|
1903
1905
|
updater.body.callee = core.types.cloneNode(
|
|
1904
|
-
structuralPrependState === state.index ? structuralPrependMapPipelineIdentifier : mapPipelineIdentifier
|
|
1906
|
+
structuralPrependState === state.index ? structuralPrependMapPipelineIdentifier() : mapPipelineIdentifier()
|
|
1905
1907
|
);
|
|
1906
1908
|
mapCount += pipelineMapCount;
|
|
1907
1909
|
if (structuralPrependState === state.index) {
|
|
@@ -1952,7 +1954,7 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
|
|
|
1952
1954
|
const rollingStep = (updater) => {
|
|
1953
1955
|
if (!core.types.isBlockStatement(updater.body)) return void 0;
|
|
1954
1956
|
const statement = updater.body.body.at(-1);
|
|
1955
|
-
if (!core.types.isReturnStatement(statement) || !statement.argument || !core.types.isCallExpression(statement.argument) || !core.types.isIdentifier(statement.argument.callee, { name: rollingWindowIdentifier.name }) || statement.argument.arguments.length !== 3 || !core.types.isExpression(statement.argument.arguments[1]) || !core.types.isExpression(statement.argument.arguments[2])) {
|
|
1957
|
+
if (!core.types.isReturnStatement(statement) || !statement.argument || !core.types.isCallExpression(statement.argument) || !core.types.isIdentifier(statement.argument.callee, { name: rollingWindowIdentifier().name }) || statement.argument.arguments.length !== 3 || !core.types.isExpression(statement.argument.arguments[1]) || !core.types.isExpression(statement.argument.arguments[2])) {
|
|
1956
1958
|
return void 0;
|
|
1957
1959
|
}
|
|
1958
1960
|
return { call: statement.argument };
|
|
@@ -1979,13 +1981,13 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
|
|
|
1979
1981
|
}
|
|
1980
1982
|
for (const step of maps) {
|
|
1981
1983
|
if (step.kind !== "map") continue;
|
|
1982
|
-
step.value.updater.body.callee = core.types.cloneNode(rollingWindowMapPipelineIdentifier);
|
|
1984
|
+
step.value.updater.body.callee = core.types.cloneNode(rollingWindowMapPipelineIdentifier());
|
|
1983
1985
|
chainedMapCount += step.value.count;
|
|
1984
1986
|
}
|
|
1985
1987
|
for (const index of rollingIndices) {
|
|
1986
1988
|
const step = segment[index];
|
|
1987
1989
|
if (step.kind === "rolling") {
|
|
1988
|
-
step.value.call.callee = core.types.cloneNode(mappedRollingWindowIdentifier);
|
|
1990
|
+
step.value.call.callee = core.types.cloneNode(mappedRollingWindowIdentifier());
|
|
1989
1991
|
}
|
|
1990
1992
|
}
|
|
1991
1993
|
chainedRollingWindowCount += rollingIndices.length;
|
|
@@ -2009,10 +2011,10 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
|
|
|
2009
2011
|
if (!core.types.isExpression(retained) || !core.types.isExpression(value)) return;
|
|
2010
2012
|
const hasLeadingMaps = leadingMaps.length > 0;
|
|
2011
2013
|
rolling.value.call.callee = core.types.cloneNode(
|
|
2012
|
-
hasLeadingMaps ? mappedStructuralAppendIdentifier : structuralAppendIdentifier
|
|
2014
|
+
hasLeadingMaps ? mappedStructuralAppendIdentifier() : structuralAppendIdentifier()
|
|
2013
2015
|
);
|
|
2014
2016
|
rolling.value.call.arguments = [
|
|
2015
|
-
hasLeadingMaps ? core.types.callExpression(core.types.cloneNode(mappedStructuralIdentifier), [
|
|
2017
|
+
hasLeadingMaps ? core.types.callExpression(core.types.cloneNode(mappedStructuralIdentifier()), [
|
|
2016
2018
|
core.types.cloneNode(retained, true)
|
|
2017
2019
|
]) : core.types.cloneNode(retained, true),
|
|
2018
2020
|
core.types.cloneNode(value, true)
|
|
@@ -2022,7 +2024,7 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
|
|
|
2022
2024
|
mappedRollingWindowCount += 1;
|
|
2023
2025
|
for (const step of leadingMaps) {
|
|
2024
2026
|
if (step.kind !== "map") continue;
|
|
2025
|
-
step.value.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier);
|
|
2027
|
+
step.value.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier());
|
|
2026
2028
|
leadingMapCount += step.value.count;
|
|
2027
2029
|
}
|
|
2028
2030
|
} else {
|
|
@@ -2030,7 +2032,7 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
|
|
|
2030
2032
|
}
|
|
2031
2033
|
for (const step of trailingMaps) {
|
|
2032
2034
|
if (step.kind !== "map") continue;
|
|
2033
|
-
step.value.updater.body.callee = core.types.cloneNode(structuralAppendMapPipelineIdentifier);
|
|
2035
|
+
step.value.updater.body.callee = core.types.cloneNode(structuralAppendMapPipelineIdentifier());
|
|
2034
2036
|
trailingMapCount += step.value.count;
|
|
2035
2037
|
}
|
|
2036
2038
|
segment = [];
|
|
@@ -2134,34 +2136,34 @@ function rewriteQueuedKeyedArrayStructuralReorderHints(root, statesBySetter, fil
|
|
|
2134
2136
|
core.types.traverseFast(updater.body, (node) => {
|
|
2135
2137
|
if (!core.types.isCallExpression(node) || !core.types.isIdentifier(node.callee)) return;
|
|
2136
2138
|
const helperName = node.callee.name;
|
|
2137
|
-
if (helperName === filterIdentifier.name || helperName === sliceIdentifier.name || helperName === mappedStructuralIdentifier.name) {
|
|
2139
|
+
if (helperName === filterIdentifier().name || helperName === sliceIdentifier().name || helperName === mappedStructuralIdentifier().name) {
|
|
2138
2140
|
startsStructuralLineage = true;
|
|
2139
2141
|
return;
|
|
2140
2142
|
}
|
|
2141
|
-
if (helperName === structuralReorderIdentifier.name || helperName === structuralSortIdentifier.name) {
|
|
2143
|
+
if (helperName === structuralReorderIdentifier().name || helperName === structuralSortIdentifier().name) {
|
|
2142
2144
|
startsStructuralLineage = true;
|
|
2143
2145
|
return;
|
|
2144
2146
|
}
|
|
2145
|
-
if (helperName === mapPipelineIdentifier.name) {
|
|
2147
|
+
if (helperName === mapPipelineIdentifier().name) {
|
|
2146
2148
|
continuesStructuralLineage = true;
|
|
2147
2149
|
return;
|
|
2148
2150
|
}
|
|
2149
|
-
if (helperName === queuedMapPipelineIdentifier.name) {
|
|
2151
|
+
if (helperName === queuedMapPipelineIdentifier().name) {
|
|
2150
2152
|
continuesStructuralLineage = true;
|
|
2151
2153
|
queuedMaps.push(node);
|
|
2152
2154
|
return;
|
|
2153
2155
|
}
|
|
2154
|
-
if (helperName === reorderIdentifier.name) {
|
|
2156
|
+
if (helperName === reorderIdentifier().name) {
|
|
2155
2157
|
continuesStructuralLineage = true;
|
|
2156
2158
|
reorderCalls.push({ call: node, kind: "reverse", mapped: false });
|
|
2157
2159
|
return;
|
|
2158
2160
|
}
|
|
2159
|
-
if (helperName === sortIdentifier.name) {
|
|
2161
|
+
if (helperName === sortIdentifier().name) {
|
|
2160
2162
|
continuesStructuralLineage = true;
|
|
2161
2163
|
reorderCalls.push({ call: node, kind: "sort", mapped: false });
|
|
2162
2164
|
return;
|
|
2163
2165
|
}
|
|
2164
|
-
if (helperName === mapReorderIdentifier.name) {
|
|
2166
|
+
if (helperName === mapReorderIdentifier().name) {
|
|
2165
2167
|
const method = node.arguments[1];
|
|
2166
2168
|
const kind = core.types.isIdentifier(method) ? methodKinds.get(method.name) : void 0;
|
|
2167
2169
|
if (!kind) {
|
|
@@ -2182,12 +2184,12 @@ function rewriteQueuedKeyedArrayStructuralReorderHints(root, statesBySetter, fil
|
|
|
2182
2184
|
continue;
|
|
2183
2185
|
}
|
|
2184
2186
|
for (const call of queuedMaps) {
|
|
2185
|
-
call.callee = core.types.cloneNode(mapPipelineIdentifier);
|
|
2187
|
+
call.callee = core.types.cloneNode(mapPipelineIdentifier());
|
|
2186
2188
|
replacedQueuedMapCount += 1;
|
|
2187
2189
|
}
|
|
2188
2190
|
for (const { call, kind, mapped } of reorderCalls) {
|
|
2189
2191
|
call.callee = core.types.cloneNode(
|
|
2190
|
-
kind === "reverse" ? structuralReorderIdentifier : structuralSortIdentifier
|
|
2192
|
+
kind === "reverse" ? structuralReorderIdentifier() : structuralSortIdentifier()
|
|
2191
2193
|
);
|
|
2192
2194
|
if (kind === "reverse") {
|
|
2193
2195
|
reorderCount += 1;
|
|
@@ -2248,7 +2250,7 @@ function rewriteQueuedKeyedArrayMapReorderHints(root, statesBySetter, mapUpdateI
|
|
|
2248
2250
|
pendingMaps = [];
|
|
2249
2251
|
continue;
|
|
2250
2252
|
}
|
|
2251
|
-
if (core.types.isCallExpression(updater.body) && core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier.name }) && updater.body.arguments.length === 2) {
|
|
2253
|
+
if (core.types.isCallExpression(updater.body) && core.types.isIdentifier(updater.body.callee, { name: mapUpdateIdentifier().name }) && updater.body.arguments.length === 2) {
|
|
2252
2254
|
const pipeline = updater.body.arguments[1];
|
|
2253
2255
|
let pipelineMapCount = 0;
|
|
2254
2256
|
if (core.types.isArrowFunctionExpression(pipeline) && pipeline.params.length === 2 && core.types.isIdentifier(pipeline.params[1])) {
|
|
@@ -2275,13 +2277,13 @@ function rewriteQueuedKeyedArrayMapReorderHints(root, statesBySetter, mapUpdateI
|
|
|
2275
2277
|
let structural = false;
|
|
2276
2278
|
core.types.traverseFast(updater.body, (node) => {
|
|
2277
2279
|
if (!core.types.isCallExpression(node) || !core.types.isIdentifier(node.callee)) return;
|
|
2278
|
-
if (node.callee.name === structuralReorderIdentifier.name || node.callee.name === structuralSortIdentifier.name) {
|
|
2280
|
+
if (node.callee.name === structuralReorderIdentifier().name || node.callee.name === structuralSortIdentifier().name) {
|
|
2279
2281
|
structural = true;
|
|
2280
|
-
} else if (node.callee.name === mapReorderIdentifier.name) {
|
|
2282
|
+
} else if (node.callee.name === mapReorderIdentifier().name) {
|
|
2281
2283
|
containsMappedReorder = true;
|
|
2282
|
-
} else if (node.callee.name === reorderIdentifier.name) {
|
|
2284
|
+
} else if (node.callee.name === reorderIdentifier().name) {
|
|
2283
2285
|
reorderCalls.push({ call: node, kind: "reverse" });
|
|
2284
|
-
} else if (node.callee.name === sortIdentifier.name) {
|
|
2286
|
+
} else if (node.callee.name === sortIdentifier().name) {
|
|
2285
2287
|
reorderCalls.push({ call: node, kind: "sort" });
|
|
2286
2288
|
}
|
|
2287
2289
|
});
|
|
@@ -2303,12 +2305,12 @@ function rewriteQueuedKeyedArrayMapReorderHints(root, statesBySetter, mapUpdateI
|
|
|
2303
2305
|
}
|
|
2304
2306
|
if (hasPendingMaps) {
|
|
2305
2307
|
for (const candidate of pendingMaps) {
|
|
2306
|
-
candidate.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier);
|
|
2308
|
+
candidate.updater.body.callee = core.types.cloneNode(queuedMapPipelineIdentifier());
|
|
2307
2309
|
mapCount += candidate.count;
|
|
2308
2310
|
}
|
|
2309
2311
|
}
|
|
2310
2312
|
for (const { call, kind } of reorderCalls) {
|
|
2311
|
-
call.callee = core.types.cloneNode(mapReorderIdentifier);
|
|
2313
|
+
call.callee = core.types.cloneNode(mapReorderIdentifier());
|
|
2312
2314
|
if (kind === "reverse") mapReorderCount += 1;
|
|
2313
2315
|
else mapSortCount += 1;
|
|
2314
2316
|
}
|
|
@@ -2365,7 +2367,7 @@ function rewriteKeyedArraySortHints(root, hintedStateIndices, statesBySetter, he
|
|
|
2365
2367
|
)
|
|
2366
2368
|
]),
|
|
2367
2369
|
core.types.returnStatement(
|
|
2368
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
2370
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
2369
2371
|
core.types.cloneNode(previous),
|
|
2370
2372
|
core.types.cloneNode(method),
|
|
2371
2373
|
...comparator ? [core.types.cloneNode(comparator, true)] : []
|
|
@@ -2427,7 +2429,7 @@ function rewriteKeyedArraySliceHints(root, hintedStateIndices, statesBySetter, h
|
|
|
2427
2429
|
)
|
|
2428
2430
|
]),
|
|
2429
2431
|
core.types.returnStatement(
|
|
2430
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
2432
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
2431
2433
|
core.types.cloneNode(previous),
|
|
2432
2434
|
core.types.cloneNode(sliceMethod),
|
|
2433
2435
|
...bounds.map((bound) => core.types.cloneNode(bound, true))
|
|
@@ -2489,7 +2491,7 @@ function rewriteKeyedArrayFilterHints(root, hintedStateIndices, statesBySetter,
|
|
|
2489
2491
|
)
|
|
2490
2492
|
]),
|
|
2491
2493
|
core.types.returnStatement(
|
|
2492
|
-
core.types.callExpression(core.types.cloneNode(helperIdentifier), [
|
|
2494
|
+
core.types.callExpression(core.types.cloneNode(helperIdentifier()), [
|
|
2493
2495
|
core.types.cloneNode(previous),
|
|
2494
2496
|
core.types.cloneNode(filterMethod),
|
|
2495
2497
|
core.types.cloneNode(predicate, true)
|
|
@@ -2594,9 +2596,9 @@ function prepareKeyedCollectionUpdater(updater, kind, updateHelper, mutationHelp
|
|
|
2594
2596
|
)
|
|
2595
2597
|
]),
|
|
2596
2598
|
core.types.returnStatement(
|
|
2597
|
-
core.types.callExpression(core.types.cloneNode(updateHelper), [
|
|
2599
|
+
core.types.callExpression(core.types.cloneNode(updateHelper()), [
|
|
2598
2600
|
core.types.cloneNode(previous),
|
|
2599
|
-
core.types.callExpression(core.types.cloneNode(mutationHelper), [
|
|
2601
|
+
core.types.callExpression(core.types.cloneNode(mutationHelper()), [
|
|
2600
2602
|
core.types.cloneNode(collection),
|
|
2601
2603
|
core.types.memberExpression(core.types.cloneNode(collection), core.types.cloneNode(updater.body.callee.property)),
|
|
2602
2604
|
core.types.stringLiteral(operation),
|
|
@@ -2731,7 +2733,7 @@ function prepareKeyedCollectionUpdater(updater, kind, updateHelper, mutationHelp
|
|
|
2731
2733
|
const operation = collectionMutationOperation(kind, callee.property.name);
|
|
2732
2734
|
if (!collectionMutationArgumentsAreValid(operation, path.node.arguments)) return;
|
|
2733
2735
|
path.replaceWith(
|
|
2734
|
-
core.types.callExpression(core.types.cloneNode(mutationHelper), [
|
|
2736
|
+
core.types.callExpression(core.types.cloneNode(mutationHelper()), [
|
|
2735
2737
|
core.types.cloneNode(callee.object),
|
|
2736
2738
|
core.types.memberExpression(core.types.cloneNode(callee.object), core.types.cloneNode(callee.property)),
|
|
2737
2739
|
core.types.stringLiteral(operation),
|
|
@@ -2742,7 +2744,7 @@ function prepareKeyedCollectionUpdater(updater, kind, updateHelper, mutationHelp
|
|
|
2742
2744
|
},
|
|
2743
2745
|
ReturnStatement(path) {
|
|
2744
2746
|
if (path.getFunctionParent()?.node !== functionPath?.node || !path.node.argument) return;
|
|
2745
|
-
path.node.argument = core.types.callExpression(core.types.cloneNode(updateHelper), [
|
|
2747
|
+
path.node.argument = core.types.callExpression(core.types.cloneNode(updateHelper()), [
|
|
2746
2748
|
core.types.cloneNode(clonedPrevious),
|
|
2747
2749
|
core.types.cloneNode(path.node.argument, true),
|
|
2748
2750
|
core.types.stringLiteral(kind)
|
|
@@ -3288,7 +3290,6 @@ function stabilizeDeferredEventCurrentTargets(root, compilerSetters) {
|
|
|
3288
3290
|
const expression = file.program.body[0].expression;
|
|
3289
3291
|
return core.types.isJSXElement(expression) ? expression : core.types.cloneNode(root, true);
|
|
3290
3292
|
}
|
|
3291
|
-
var foreignContentElements = /* @__PURE__ */ new WeakSet();
|
|
3292
3293
|
var FOREIGN_ELEMENT_NAMES = new Set(
|
|
3293
3294
|
[
|
|
3294
3295
|
"animate animateMotion animateTransform circle clipPath defs desc ellipse",
|
|
@@ -3305,21 +3306,24 @@ var FOREIGN_ELEMENT_NAMES = new Set(
|
|
|
3305
3306
|
].join(" ").split(" ")
|
|
3306
3307
|
);
|
|
3307
3308
|
function markForeignContent(programPath) {
|
|
3309
|
+
let depth = 0;
|
|
3308
3310
|
programPath.traverse({
|
|
3309
|
-
JSXElement
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3311
|
+
JSXElement: {
|
|
3312
|
+
enter(path) {
|
|
3313
|
+
if (depth > 0) path.node.extra = { ...path.node.extra, farmForeignContent: true };
|
|
3314
|
+
const name = path.node.openingElement.name;
|
|
3315
|
+
if (core.types.isJSXIdentifier(name) && (name.name === "svg" || name.name === "math")) depth++;
|
|
3316
|
+
},
|
|
3317
|
+
exit(path) {
|
|
3318
|
+
const name = path.node.openingElement.name;
|
|
3319
|
+
if (core.types.isJSXIdentifier(name) && (name.name === "svg" || name.name === "math")) depth--;
|
|
3320
|
+
}
|
|
3317
3321
|
}
|
|
3318
3322
|
});
|
|
3319
3323
|
}
|
|
3320
3324
|
function isForeignContent(element) {
|
|
3321
3325
|
const name = element.openingElement.name;
|
|
3322
|
-
return
|
|
3326
|
+
return element.extra?.farmForeignContent === true || core.types.isJSXIdentifier(name) && FOREIGN_ELEMENT_NAMES.has(name.name);
|
|
3323
3327
|
}
|
|
3324
3328
|
function reactOwnedAttribute(name, attribute) {
|
|
3325
3329
|
if (name === "defaultValue" || name === "defaultChecked") return true;
|
|
@@ -3345,6 +3349,10 @@ function analyzeKeyedRowTree(row, renderCallback, safeGlobals, compilerSetters,
|
|
|
3345
3349
|
return "compiled keyed rows support host elements only";
|
|
3346
3350
|
}
|
|
3347
3351
|
if (isForeignContent(element)) return "compiled keyed rows do not support SVG yet";
|
|
3352
|
+
if (tag.name === "script") return "script elements require React ownership";
|
|
3353
|
+
if (tag.name === "title" || tag.name === "meta") {
|
|
3354
|
+
return "document metadata requires React ownership";
|
|
3355
|
+
}
|
|
3348
3356
|
const attributeNames = new Set(
|
|
3349
3357
|
element.openingElement.attributes.filter((attribute) => core.types.isJSXAttribute(attribute)).map(jsxAttributeName).filter((name) => name !== void 0)
|
|
3350
3358
|
);
|
|
@@ -3743,6 +3751,10 @@ function analyzeHostConditionalTree(branch, safeGlobals, allowStaticEvents = fal
|
|
|
3743
3751
|
return "compiler-owned conditionals support host elements only";
|
|
3744
3752
|
}
|
|
3745
3753
|
if (isForeignContent(element)) return "compiler-owned conditionals do not support SVG yet";
|
|
3754
|
+
if (tag.name === "script") return "script elements require React ownership";
|
|
3755
|
+
if (tag.name === "title" || tag.name === "meta") {
|
|
3756
|
+
return "document metadata requires React ownership";
|
|
3757
|
+
}
|
|
3746
3758
|
for (const attribute of element.openingElement.attributes) {
|
|
3747
3759
|
if (core.types.isJSXSpreadAttribute(attribute)) {
|
|
3748
3760
|
if (statefulOnly && !needsStaticBinding(attribute.argument)) continue;
|
|
@@ -3868,6 +3880,10 @@ function analyzeRecursiveHostTree(branch, statesByValue, safeGlobals, listNames,
|
|
|
3868
3880
|
if (isForeignContent(element)) {
|
|
3869
3881
|
return "recursive compiler-owned blocks do not support SVG yet";
|
|
3870
3882
|
}
|
|
3883
|
+
if (tag.name === "script") return "script elements require React ownership";
|
|
3884
|
+
if (tag.name === "title" || tag.name === "meta") {
|
|
3885
|
+
return "document metadata requires React ownership";
|
|
3886
|
+
}
|
|
3871
3887
|
for (const attribute of element.openingElement.attributes) {
|
|
3872
3888
|
if (core.types.isJSXSpreadAttribute(attribute)) {
|
|
3873
3889
|
return "recursive compiler-owned blocks do not support JSX attribute spreads";
|
|
@@ -6154,7 +6170,13 @@ function analyzeHostTree(root, statesByValue, safeGlobals, conditionalExpression
|
|
|
6154
6170
|
}
|
|
6155
6171
|
const expression = attribute.value.expression;
|
|
6156
6172
|
const dependencies = collectStateDependencies(expression, statesByValue);
|
|
6157
|
-
if (dependencies.length === 0
|
|
6173
|
+
if (dependencies.length === 0) continue;
|
|
6174
|
+
if (/^on[A-Z]/.test(name)) {
|
|
6175
|
+
if (!core.types.isArrowFunctionExpression(expression) && !core.types.isFunctionExpression(expression)) {
|
|
6176
|
+
return "stateful event handler selection requires React ownership";
|
|
6177
|
+
}
|
|
6178
|
+
continue;
|
|
6179
|
+
}
|
|
6158
6180
|
if (name === "style") {
|
|
6159
6181
|
const reason2 = analyzeStyle(expression, path);
|
|
6160
6182
|
if (reason2) return reason2;
|
|
@@ -7380,6 +7402,14 @@ function compileCandidate(candidate, createComponentIdentifier, keyedMapUpdateId
|
|
|
7380
7402
|
appliedKeyedMapUpdateHints > 0 || appliedKeyedArrayAppendHints > 0,
|
|
7381
7403
|
appliedKeyedArrayAppendHints > 0 && appliedKeyedMapUpdateHints === 0
|
|
7382
7404
|
);
|
|
7405
|
+
for (const feature of runtimeFeatures) {
|
|
7406
|
+
if (!runtimeFeatureIdentifiers.has(feature)) {
|
|
7407
|
+
runtimeFeatureIdentifiers.set(
|
|
7408
|
+
feature,
|
|
7409
|
+
path.scope.getProgramParent().generateUidIdentifier(COMPILER_RUNTIME_FEATURE_EXPORTS[feature])
|
|
7410
|
+
);
|
|
7411
|
+
}
|
|
7412
|
+
}
|
|
7383
7413
|
markShortCircuitBindings(analysis.bindings || []);
|
|
7384
7414
|
assignStableBindingTargets(analysis.bindings || []);
|
|
7385
7415
|
const stateParameter = path.scope.generateUidIdentifier("farmState");
|
|
@@ -7508,8 +7538,17 @@ function compileCandidate(candidate, createComponentIdentifier, keyedMapUpdateId
|
|
|
7508
7538
|
for (const feature of runtimeFeatures) usedRuntimeFeatures.add(feature);
|
|
7509
7539
|
return void 0;
|
|
7510
7540
|
}
|
|
7511
|
-
function collectCandidates(programPath) {
|
|
7541
|
+
function collectCandidates(programPath, options, moduleSelected) {
|
|
7512
7542
|
const candidates = [];
|
|
7543
|
+
function collect(name, path, statementPath) {
|
|
7544
|
+
const functionDirectives = new Set(
|
|
7545
|
+
core.types.isBlockStatement(path.node.body) ? directiveValues(path.node.body) : []
|
|
7546
|
+
);
|
|
7547
|
+
const explicitlySelected = moduleSelected || functionDirectives.has(options.directive);
|
|
7548
|
+
if (functionDirectives.has("use no compiler")) return;
|
|
7549
|
+
if (options.mode === "annotation" && !explicitlySelected) return;
|
|
7550
|
+
candidates.push({ name, path, statementPath, explicitlySelected });
|
|
7551
|
+
}
|
|
7513
7552
|
programPath.traverse({
|
|
7514
7553
|
FunctionDeclaration(path) {
|
|
7515
7554
|
if (!path.node.id || !isComponentName(path.node.id.name)) return;
|
|
@@ -7517,11 +7556,7 @@ function collectCandidates(programPath) {
|
|
|
7517
7556
|
if (!parent.isProgram() && !parent.isExportNamedDeclaration() && !parent.isExportDefaultDeclaration()) {
|
|
7518
7557
|
return;
|
|
7519
7558
|
}
|
|
7520
|
-
|
|
7521
|
-
name: path.node.id.name,
|
|
7522
|
-
path,
|
|
7523
|
-
statementPath: parent.isProgram() ? path : parent
|
|
7524
|
-
});
|
|
7559
|
+
collect(path.node.id.name, path, parent.isProgram() ? path : parent);
|
|
7525
7560
|
},
|
|
7526
7561
|
VariableDeclarator(path) {
|
|
7527
7562
|
if (!core.types.isIdentifier(path.node.id) || !isComponentName(path.node.id.name) || !core.types.isFunctionExpression(path.node.init) && !core.types.isArrowFunctionExpression(path.node.init)) {
|
|
@@ -7532,11 +7567,7 @@ function collectCandidates(programPath) {
|
|
|
7532
7567
|
if (!statement) return;
|
|
7533
7568
|
const topLevel = statement.isProgram() ? declaration : statement.isExportNamedDeclaration() && statement.parentPath.isProgram() ? statement : null;
|
|
7534
7569
|
if (!topLevel) return;
|
|
7535
|
-
|
|
7536
|
-
name: path.node.id.name,
|
|
7537
|
-
path: path.get("init"),
|
|
7538
|
-
statementPath: topLevel
|
|
7539
|
-
});
|
|
7570
|
+
collect(path.node.id.name, path.get("init"), topLevel);
|
|
7540
7571
|
}
|
|
7541
7572
|
});
|
|
7542
7573
|
return candidates;
|
|
@@ -7606,97 +7637,85 @@ async function compileReactModule(code, id, options) {
|
|
|
7606
7637
|
}
|
|
7607
7638
|
}
|
|
7608
7639
|
}
|
|
7609
|
-
const candidates = collectCandidates(
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
);
|
|
7614
|
-
const keyedArrayAppendIdentifier = programPath.scope.generateUidIdentifier(
|
|
7615
|
-
"createCompilerKeyedArrayAppend"
|
|
7640
|
+
const candidates = collectCandidates(
|
|
7641
|
+
programPath,
|
|
7642
|
+
options,
|
|
7643
|
+
moduleDirectives.has(options.directive)
|
|
7616
7644
|
);
|
|
7617
|
-
|
|
7618
|
-
|
|
7645
|
+
if (candidates.length === 0) return;
|
|
7646
|
+
const createComponentIdentifier = programPath.scope.generateUidIdentifier("createCompiledComponent");
|
|
7647
|
+
const createRefreshComponentIdentifier = programPath.scope.generateUidIdentifier("createRefreshComponent");
|
|
7648
|
+
const createProductionComponentIdentifier = programPath.scope.generateUidIdentifier(
|
|
7649
|
+
"createProductionComponent"
|
|
7619
7650
|
);
|
|
7620
|
-
const
|
|
7651
|
+
const helperIdentifier = (name) => {
|
|
7652
|
+
let identifier;
|
|
7653
|
+
return () => identifier ?? (identifier = programPath.scope.generateUidIdentifier(name));
|
|
7654
|
+
};
|
|
7655
|
+
const keyedMapUpdateIdentifier = helperIdentifier("createCompilerKeyedMapUpdate");
|
|
7656
|
+
const keyedArrayAppendIdentifier = helperIdentifier("createCompilerKeyedArrayAppend");
|
|
7657
|
+
const keyedArrayFilterIdentifier = helperIdentifier("createCompilerKeyedArrayFilter");
|
|
7658
|
+
const keyedArrayMapPipelineIdentifier = helperIdentifier(
|
|
7621
7659
|
"createCompilerKeyedArrayMapPipeline"
|
|
7622
7660
|
);
|
|
7623
|
-
const keyedArrayMappedStructuralAppendIdentifier =
|
|
7661
|
+
const keyedArrayMappedStructuralAppendIdentifier = helperIdentifier(
|
|
7624
7662
|
"createCompilerKeyedArrayMappedStructuralAppend"
|
|
7625
7663
|
);
|
|
7626
|
-
const keyedArrayStructuralAppendMapPipelineIdentifier =
|
|
7664
|
+
const keyedArrayStructuralAppendMapPipelineIdentifier = helperIdentifier(
|
|
7627
7665
|
"createCompilerKeyedArrayStructuralAppendMapPipeline"
|
|
7628
7666
|
);
|
|
7629
|
-
const keyedArrayMappedStructuralPrependIdentifier =
|
|
7667
|
+
const keyedArrayMappedStructuralPrependIdentifier = helperIdentifier(
|
|
7630
7668
|
"createCompilerKeyedArrayMappedStructuralPrepend"
|
|
7631
7669
|
);
|
|
7632
|
-
const keyedArrayStructuralPrependMapPipelineIdentifier =
|
|
7670
|
+
const keyedArrayStructuralPrependMapPipelineIdentifier = helperIdentifier(
|
|
7633
7671
|
"createCompilerKeyedArrayStructuralPrependMapPipeline"
|
|
7634
7672
|
);
|
|
7635
|
-
const keyedArrayQueuedMapPipelineIdentifier =
|
|
7673
|
+
const keyedArrayQueuedMapPipelineIdentifier = helperIdentifier(
|
|
7636
7674
|
"createCompilerKeyedArrayQueuedMapPipeline"
|
|
7637
7675
|
);
|
|
7638
|
-
const keyedArrayRollingWindowMapPipelineIdentifier =
|
|
7676
|
+
const keyedArrayRollingWindowMapPipelineIdentifier = helperIdentifier(
|
|
7639
7677
|
"createCompilerKeyedArrayRollingWindowMapPipeline"
|
|
7640
7678
|
);
|
|
7641
|
-
const keyedArrayMappedRollingWindowIdentifier =
|
|
7679
|
+
const keyedArrayMappedRollingWindowIdentifier = helperIdentifier(
|
|
7642
7680
|
"createCompilerKeyedArrayMappedRollingWindow"
|
|
7643
7681
|
);
|
|
7644
|
-
const keyedArrayMapReorderIdentifier =
|
|
7682
|
+
const keyedArrayMapReorderIdentifier = helperIdentifier(
|
|
7645
7683
|
"createCompilerKeyedArrayMapReorder"
|
|
7646
7684
|
);
|
|
7647
|
-
const keyedArrayMappedStructuralIdentifier =
|
|
7685
|
+
const keyedArrayMappedStructuralIdentifier = helperIdentifier(
|
|
7648
7686
|
"finalizeCompilerKeyedArrayMappedStructuralUpdate"
|
|
7649
7687
|
);
|
|
7650
|
-
const keyedArrayPrependIdentifier =
|
|
7651
|
-
|
|
7652
|
-
);
|
|
7653
|
-
const keyedArrayPositionIdentifier = programPath.scope.generateUidIdentifier(
|
|
7688
|
+
const keyedArrayPrependIdentifier = helperIdentifier("createCompilerKeyedArrayPrepend");
|
|
7689
|
+
const keyedArrayPositionIdentifier = helperIdentifier(
|
|
7654
7690
|
"createCompilerKeyedArrayPositionUpdate"
|
|
7655
7691
|
);
|
|
7656
|
-
const keyedArrayBatchInsertIdentifier =
|
|
7692
|
+
const keyedArrayBatchInsertIdentifier = helperIdentifier(
|
|
7657
7693
|
"createCompilerKeyedArrayBatchInsert"
|
|
7658
7694
|
);
|
|
7659
|
-
const keyedArrayWindowReplaceIdentifier =
|
|
7695
|
+
const keyedArrayWindowReplaceIdentifier = helperIdentifier(
|
|
7660
7696
|
"createCompilerKeyedArrayWindowReplace"
|
|
7661
7697
|
);
|
|
7662
|
-
const keyedArrayReorderIdentifier =
|
|
7663
|
-
|
|
7664
|
-
);
|
|
7665
|
-
const keyedArrayStructuralReorderIdentifier = programPath.scope.generateUidIdentifier(
|
|
7698
|
+
const keyedArrayReorderIdentifier = helperIdentifier("createCompilerKeyedArrayReorder");
|
|
7699
|
+
const keyedArrayStructuralReorderIdentifier = helperIdentifier(
|
|
7666
7700
|
"createCompilerKeyedArrayStructuralReorder"
|
|
7667
7701
|
);
|
|
7668
|
-
const keyedArraySortIdentifier =
|
|
7669
|
-
|
|
7670
|
-
);
|
|
7671
|
-
const keyedArrayStructuralSortIdentifier = programPath.scope.generateUidIdentifier(
|
|
7702
|
+
const keyedArraySortIdentifier = helperIdentifier("createCompilerKeyedArraySort");
|
|
7703
|
+
const keyedArrayStructuralSortIdentifier = helperIdentifier(
|
|
7672
7704
|
"createCompilerKeyedArrayStructuralSort"
|
|
7673
7705
|
);
|
|
7674
|
-
const keyedArrayRollingWindowIdentifier =
|
|
7706
|
+
const keyedArrayRollingWindowIdentifier = helperIdentifier(
|
|
7675
7707
|
"createCompilerKeyedArrayRollingWindow"
|
|
7676
7708
|
);
|
|
7677
|
-
const keyedArraySliceIdentifier =
|
|
7678
|
-
|
|
7679
|
-
);
|
|
7680
|
-
const keyedCollectionUpdateIdentifier = programPath.scope.generateUidIdentifier(
|
|
7709
|
+
const keyedArraySliceIdentifier = helperIdentifier("createCompilerKeyedArraySlice");
|
|
7710
|
+
const keyedCollectionUpdateIdentifier = helperIdentifier(
|
|
7681
7711
|
"createCompilerKeyedCollectionUpdate"
|
|
7682
7712
|
);
|
|
7683
|
-
const keyedCollectionMutationIdentifier =
|
|
7713
|
+
const keyedCollectionMutationIdentifier = helperIdentifier(
|
|
7684
7714
|
"applyCompilerKeyedCollectionMutation"
|
|
7685
7715
|
);
|
|
7686
|
-
const runtimeFeatureIdentifiers = new Map(
|
|
7687
|
-
Object.entries(COMPILER_RUNTIME_FEATURE_EXPORTS).map(([feature, exportName]) => [
|
|
7688
|
-
feature,
|
|
7689
|
-
programPath.scope.generateUidIdentifier(exportName)
|
|
7690
|
-
])
|
|
7691
|
-
);
|
|
7716
|
+
const runtimeFeatureIdentifiers = /* @__PURE__ */ new Map();
|
|
7692
7717
|
const usedRuntimeFeatures = /* @__PURE__ */ new Set();
|
|
7693
7718
|
for (const candidate of candidates) {
|
|
7694
|
-
const functionDirectives = new Set(
|
|
7695
|
-
core.types.isBlockStatement(candidate.path.node.body) ? directiveValues(candidate.path.node.body) : []
|
|
7696
|
-
);
|
|
7697
|
-
const explicitlySelected = moduleDirectives.has(options.directive) || functionDirectives.has(options.directive);
|
|
7698
|
-
if (functionDirectives.has("use no compiler")) continue;
|
|
7699
|
-
if (options.mode === "annotation" && !explicitlySelected) continue;
|
|
7700
7719
|
const reason = compileCandidate(
|
|
7701
7720
|
candidate,
|
|
7702
7721
|
createComponentIdentifier,
|
|
@@ -7739,7 +7758,7 @@ async function compileReactModule(code, id, options) {
|
|
|
7739
7758
|
diagnostics.push({
|
|
7740
7759
|
component: candidate.name,
|
|
7741
7760
|
reason,
|
|
7742
|
-
selected: explicitlySelected
|
|
7761
|
+
selected: candidate.explicitlySelected
|
|
7743
7762
|
});
|
|
7744
7763
|
} else {
|
|
7745
7764
|
compiled.push(candidate.name);
|
|
@@ -7752,83 +7771,103 @@ async function compileReactModule(code, id, options) {
|
|
|
7752
7771
|
const hasKeyedArrayStructuralPrependHints = optimizationCounts.keyedArrayPrependHints > 0 && (optimizationCounts.keyedArrayFilterHints > 0 || optimizationCounts.keyedArraySliceHints > 0);
|
|
7753
7772
|
const hasUnmappedKeyedArrayPrependHints = optimizationCounts.keyedArrayPrependHints > compilerUsage.keyedArrayMappedStructuralPrependHints;
|
|
7754
7773
|
if (compiled.length > 0) {
|
|
7774
|
+
programPath.unshiftContainer(
|
|
7775
|
+
"body",
|
|
7776
|
+
core.types.variableDeclaration("const", [
|
|
7777
|
+
core.types.variableDeclarator(
|
|
7778
|
+
core.types.cloneNode(createComponentIdentifier),
|
|
7779
|
+
core.types.conditionalExpression(
|
|
7780
|
+
core.types.memberExpression(
|
|
7781
|
+
core.types.metaProperty(core.types.identifier("import"), core.types.identifier("meta")),
|
|
7782
|
+
core.types.identifier("hot")
|
|
7783
|
+
),
|
|
7784
|
+
core.types.cloneNode(createRefreshComponentIdentifier),
|
|
7785
|
+
core.types.cloneNode(createProductionComponentIdentifier)
|
|
7786
|
+
)
|
|
7787
|
+
)
|
|
7788
|
+
])
|
|
7789
|
+
);
|
|
7755
7790
|
programPath.unshiftContainer(
|
|
7756
7791
|
"body",
|
|
7757
7792
|
core.types.importDeclaration(
|
|
7758
7793
|
[
|
|
7759
7794
|
core.types.importSpecifier(
|
|
7760
|
-
|
|
7795
|
+
createRefreshComponentIdentifier,
|
|
7761
7796
|
core.types.identifier("createCompiledComponentWithFeatures")
|
|
7762
7797
|
),
|
|
7798
|
+
core.types.importSpecifier(
|
|
7799
|
+
createProductionComponentIdentifier,
|
|
7800
|
+
core.types.identifier("createCompiledComponentWithoutRefresh")
|
|
7801
|
+
),
|
|
7763
7802
|
...optimizationCounts.keyedMapUpdateHints > compilerUsage.keyedArrayMapUpdateHints ? [
|
|
7764
7803
|
core.types.importSpecifier(
|
|
7765
|
-
keyedMapUpdateIdentifier,
|
|
7804
|
+
keyedMapUpdateIdentifier(),
|
|
7766
7805
|
core.types.identifier("createCompilerKeyedMapUpdate")
|
|
7767
7806
|
)
|
|
7768
7807
|
] : [],
|
|
7769
7808
|
...hasEagerKeyedArrayMapUpdateHints ? [
|
|
7770
7809
|
core.types.importSpecifier(
|
|
7771
|
-
keyedArrayMapPipelineIdentifier,
|
|
7810
|
+
keyedArrayMapPipelineIdentifier(),
|
|
7772
7811
|
core.types.identifier("createCompilerKeyedArrayMapPipeline")
|
|
7773
7812
|
)
|
|
7774
7813
|
] : [],
|
|
7775
7814
|
...compilerUsage.keyedArrayStructuralAppendMapHints > 0 ? [
|
|
7776
7815
|
core.types.importSpecifier(
|
|
7777
|
-
keyedArrayStructuralAppendMapPipelineIdentifier,
|
|
7816
|
+
keyedArrayStructuralAppendMapPipelineIdentifier(),
|
|
7778
7817
|
core.types.identifier("createCompilerKeyedArrayStructuralAppendMapPipeline")
|
|
7779
7818
|
)
|
|
7780
7819
|
] : [],
|
|
7781
7820
|
...compilerUsage.keyedArrayStructuralPrependMapHints > 0 ? [
|
|
7782
7821
|
core.types.importSpecifier(
|
|
7783
|
-
keyedArrayStructuralPrependMapPipelineIdentifier,
|
|
7822
|
+
keyedArrayStructuralPrependMapPipelineIdentifier(),
|
|
7784
7823
|
core.types.identifier("createCompilerKeyedArrayStructuralPrependMapPipeline")
|
|
7785
7824
|
)
|
|
7786
7825
|
] : [],
|
|
7787
7826
|
...hasKeyedArrayMapReorderHints ? [
|
|
7788
7827
|
core.types.importSpecifier(
|
|
7789
|
-
keyedArrayMapReorderIdentifier,
|
|
7828
|
+
keyedArrayMapReorderIdentifier(),
|
|
7790
7829
|
core.types.identifier("createCompilerKeyedArrayMapReorder")
|
|
7791
7830
|
)
|
|
7792
7831
|
] : [],
|
|
7793
7832
|
...compilerUsage.keyedArrayMappedStructuralHints > 0 ? [
|
|
7794
7833
|
core.types.importSpecifier(
|
|
7795
|
-
keyedArrayMappedStructuralIdentifier,
|
|
7834
|
+
keyedArrayMappedStructuralIdentifier(),
|
|
7796
7835
|
core.types.identifier("finalizeCompilerKeyedArrayMappedStructuralUpdate")
|
|
7797
7836
|
)
|
|
7798
7837
|
] : [],
|
|
7799
7838
|
...compilerUsage.keyedArrayMappedStructuralAppendHints > 0 || compilerUsage.keyedArrayMappedRollingWindowHints > compilerUsage.keyedArrayMappedRollingWindowChainHints ? [
|
|
7800
7839
|
core.types.importSpecifier(
|
|
7801
|
-
keyedArrayMappedStructuralAppendIdentifier,
|
|
7840
|
+
keyedArrayMappedStructuralAppendIdentifier(),
|
|
7802
7841
|
core.types.identifier("createCompilerKeyedArrayMappedStructuralAppend")
|
|
7803
7842
|
)
|
|
7804
7843
|
] : [],
|
|
7805
7844
|
...compilerUsage.keyedArrayMappedStructuralPrependHints > 0 ? [
|
|
7806
7845
|
core.types.importSpecifier(
|
|
7807
|
-
keyedArrayMappedStructuralPrependIdentifier,
|
|
7846
|
+
keyedArrayMappedStructuralPrependIdentifier(),
|
|
7808
7847
|
core.types.identifier("createCompilerKeyedArrayMappedStructuralPrepend")
|
|
7809
7848
|
)
|
|
7810
7849
|
] : [],
|
|
7811
7850
|
...compilerUsage.keyedArrayQueuedMapUpdateHints > 0 ? [
|
|
7812
7851
|
core.types.importSpecifier(
|
|
7813
|
-
keyedArrayQueuedMapPipelineIdentifier,
|
|
7852
|
+
keyedArrayQueuedMapPipelineIdentifier(),
|
|
7814
7853
|
core.types.identifier("createCompilerKeyedArrayQueuedMapPipeline")
|
|
7815
7854
|
)
|
|
7816
7855
|
] : [],
|
|
7817
7856
|
...compilerUsage.keyedArrayMappedRollingWindowChainHints > 0 ? [
|
|
7818
7857
|
core.types.importSpecifier(
|
|
7819
|
-
keyedArrayRollingWindowMapPipelineIdentifier,
|
|
7858
|
+
keyedArrayRollingWindowMapPipelineIdentifier(),
|
|
7820
7859
|
core.types.identifier("createCompilerKeyedArrayRollingWindowMapPipeline")
|
|
7821
7860
|
)
|
|
7822
7861
|
] : [],
|
|
7823
7862
|
...compilerUsage.keyedArrayMappedRollingWindowChainHints > 0 ? [
|
|
7824
7863
|
core.types.importSpecifier(
|
|
7825
|
-
keyedArrayMappedRollingWindowIdentifier,
|
|
7864
|
+
keyedArrayMappedRollingWindowIdentifier(),
|
|
7826
7865
|
core.types.identifier("createCompilerKeyedArrayMappedRollingWindow")
|
|
7827
7866
|
)
|
|
7828
7867
|
] : [],
|
|
7829
7868
|
...hasUnmappedKeyedArrayAppendHints || compilerUsage.keyedArrayStructuralRollingWindowHints > 0 ? [
|
|
7830
7869
|
core.types.importSpecifier(
|
|
7831
|
-
keyedArrayAppendIdentifier,
|
|
7870
|
+
keyedArrayAppendIdentifier(),
|
|
7832
7871
|
core.types.identifier(
|
|
7833
7872
|
hasKeyedArrayStructuralAppendHints ? "createCompilerKeyedArrayStructuralAppend" : "createCompilerKeyedArrayAppend"
|
|
7834
7873
|
)
|
|
@@ -7836,13 +7875,13 @@ async function compileReactModule(code, id, options) {
|
|
|
7836
7875
|
] : [],
|
|
7837
7876
|
...optimizationCounts.keyedArrayFilterHints > 0 ? [
|
|
7838
7877
|
core.types.importSpecifier(
|
|
7839
|
-
keyedArrayFilterIdentifier,
|
|
7878
|
+
keyedArrayFilterIdentifier(),
|
|
7840
7879
|
core.types.identifier("createCompilerKeyedArrayFilter")
|
|
7841
7880
|
)
|
|
7842
7881
|
] : [],
|
|
7843
7882
|
...hasUnmappedKeyedArrayPrependHints ? [
|
|
7844
7883
|
core.types.importSpecifier(
|
|
7845
|
-
keyedArrayPrependIdentifier,
|
|
7884
|
+
keyedArrayPrependIdentifier(),
|
|
7846
7885
|
core.types.identifier(
|
|
7847
7886
|
hasKeyedArrayStructuralPrependHints ? "createCompilerKeyedArrayStructuralPrepend" : "createCompilerKeyedArrayPrepend"
|
|
7848
7887
|
)
|
|
@@ -7850,65 +7889,65 @@ async function compileReactModule(code, id, options) {
|
|
|
7850
7889
|
] : [],
|
|
7851
7890
|
...optimizationCounts.keyedArrayPositionHints > compilerUsage.keyedArrayBatchInsertHints + compilerUsage.keyedArrayWindowReplaceHints ? [
|
|
7852
7891
|
core.types.importSpecifier(
|
|
7853
|
-
keyedArrayPositionIdentifier,
|
|
7892
|
+
keyedArrayPositionIdentifier(),
|
|
7854
7893
|
core.types.identifier("createCompilerKeyedArrayPositionUpdate")
|
|
7855
7894
|
)
|
|
7856
7895
|
] : [],
|
|
7857
7896
|
...compilerUsage.keyedArrayBatchInsertHints > 0 ? [
|
|
7858
7897
|
core.types.importSpecifier(
|
|
7859
|
-
keyedArrayBatchInsertIdentifier,
|
|
7898
|
+
keyedArrayBatchInsertIdentifier(),
|
|
7860
7899
|
core.types.identifier("createCompilerKeyedArrayBatchInsert")
|
|
7861
7900
|
)
|
|
7862
7901
|
] : [],
|
|
7863
7902
|
...compilerUsage.keyedArrayWindowReplaceHints > 0 ? [
|
|
7864
7903
|
core.types.importSpecifier(
|
|
7865
|
-
keyedArrayWindowReplaceIdentifier,
|
|
7904
|
+
keyedArrayWindowReplaceIdentifier(),
|
|
7866
7905
|
core.types.identifier("createCompilerKeyedArrayWindowReplace")
|
|
7867
7906
|
)
|
|
7868
7907
|
] : [],
|
|
7869
7908
|
...optimizationCounts.keyedArrayReorderHints > compilerUsage.keyedArrayStructuralReorderHints + compilerUsage.keyedArrayMapReorderHints ? [
|
|
7870
7909
|
core.types.importSpecifier(
|
|
7871
|
-
keyedArrayReorderIdentifier,
|
|
7910
|
+
keyedArrayReorderIdentifier(),
|
|
7872
7911
|
core.types.identifier("createCompilerKeyedArrayReorder")
|
|
7873
7912
|
)
|
|
7874
7913
|
] : [],
|
|
7875
7914
|
...compilerUsage.keyedArrayStructuralReorderHints > 0 ? [
|
|
7876
7915
|
core.types.importSpecifier(
|
|
7877
|
-
keyedArrayStructuralReorderIdentifier,
|
|
7916
|
+
keyedArrayStructuralReorderIdentifier(),
|
|
7878
7917
|
core.types.identifier("createCompilerKeyedArrayStructuralReorder")
|
|
7879
7918
|
)
|
|
7880
7919
|
] : [],
|
|
7881
7920
|
...optimizationCounts.keyedArraySortHints > compilerUsage.keyedArrayStructuralSortHints + compilerUsage.keyedArrayMapSortHints ? [
|
|
7882
7921
|
core.types.importSpecifier(
|
|
7883
|
-
keyedArraySortIdentifier,
|
|
7922
|
+
keyedArraySortIdentifier(),
|
|
7884
7923
|
core.types.identifier("createCompilerKeyedArraySort")
|
|
7885
7924
|
)
|
|
7886
7925
|
] : [],
|
|
7887
7926
|
...compilerUsage.keyedArrayStructuralSortHints > 0 ? [
|
|
7888
7927
|
core.types.importSpecifier(
|
|
7889
|
-
keyedArrayStructuralSortIdentifier,
|
|
7928
|
+
keyedArrayStructuralSortIdentifier(),
|
|
7890
7929
|
core.types.identifier("createCompilerKeyedArrayStructuralSort")
|
|
7891
7930
|
)
|
|
7892
7931
|
] : [],
|
|
7893
7932
|
...optimizationCounts.keyedArrayRollingWindowHints > compilerUsage.keyedArrayMappedRollingWindowHints + compilerUsage.keyedArrayStructuralRollingWindowHints ? [
|
|
7894
7933
|
core.types.importSpecifier(
|
|
7895
|
-
keyedArrayRollingWindowIdentifier,
|
|
7934
|
+
keyedArrayRollingWindowIdentifier(),
|
|
7896
7935
|
core.types.identifier("createCompilerKeyedArrayRollingWindow")
|
|
7897
7936
|
)
|
|
7898
7937
|
] : [],
|
|
7899
7938
|
...optimizationCounts.keyedArraySliceHints > 0 || optimizationCounts.keyedArrayRollingWindowHints > 0 ? [
|
|
7900
7939
|
core.types.importSpecifier(
|
|
7901
|
-
keyedArraySliceIdentifier,
|
|
7940
|
+
keyedArraySliceIdentifier(),
|
|
7902
7941
|
core.types.identifier("createCompilerKeyedArraySlice")
|
|
7903
7942
|
)
|
|
7904
7943
|
] : [],
|
|
7905
7944
|
...optimizationCounts.keyedCollectionUpdateHints > 0 ? [
|
|
7906
7945
|
core.types.importSpecifier(
|
|
7907
|
-
keyedCollectionUpdateIdentifier,
|
|
7946
|
+
keyedCollectionUpdateIdentifier(),
|
|
7908
7947
|
core.types.identifier("createCompilerKeyedCollectionUpdate")
|
|
7909
7948
|
),
|
|
7910
7949
|
core.types.importSpecifier(
|
|
7911
|
-
keyedCollectionMutationIdentifier,
|
|
7950
|
+
keyedCollectionMutationIdentifier(),
|
|
7912
7951
|
core.types.identifier("applyCompilerKeyedCollectionMutation")
|
|
7913
7952
|
)
|
|
7914
7953
|
] : [],
|