@farm.js/react 0.1.0-beta.27 → 0.1.0-beta.29

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/dist/vite.mjs CHANGED
@@ -240,6 +240,14 @@ function collectStateDependencies(expression, statesByValue) {
240
240
  return [...dependencies].sort((left, right) => left - right);
241
241
  }
242
242
  function referencesIdentifier(expression, name) {
243
+ let possible = false;
244
+ types.traverseFast(expression, (node) => {
245
+ if ((types.isIdentifier(node) || types.isJSXIdentifier(node)) && node.name === name) {
246
+ possible = true;
247
+ return types.traverseFast.stop;
248
+ }
249
+ });
250
+ if (!possible) return false;
243
251
  let referenced = false;
244
252
  traverse(expressionFile(cloneExpression(expression)), {
245
253
  ReferencedIdentifier(path) {
@@ -1459,7 +1467,7 @@ function rewriteKeyedArrayReorderPipelineHints(root, hintedStateIndices, statesB
1459
1467
  };
1460
1468
  }
1461
1469
  function rewriteQueuedKeyedArrayReorderMapHints(root, statesBySetter, mapUpdateIdentifier, queuedMapPipelineIdentifier, mapReorderIdentifier, reorderIdentifier, sortIdentifier, structuralReorderIdentifier, structuralSortIdentifier, allowed) {
1462
- if (!allowed) return { root: types.cloneNode(root, true), mapCount: 0 };
1470
+ if (!allowed) return { root, mapCount: 0 };
1463
1471
  const file = expressionFile(types.cloneNode(root, true));
1464
1472
  let mapCount = 0;
1465
1473
  const containsHelperCall = (updater, helperNames) => {
@@ -1555,7 +1563,7 @@ function countKeyedArrayMapPipeline(updater, mapUpdateIdentifier) {
1555
1563
  function rewriteQueuedKeyedArrayMappedStructuralHints(root, statesBySetter, mapUpdateIdentifier, queuedMapPipelineIdentifier, mappedStructuralIdentifier, filterIdentifier, sliceIdentifier, allowed) {
1556
1564
  if (!allowed) {
1557
1565
  return {
1558
- root: types.cloneNode(root, true),
1566
+ root,
1559
1567
  mapCount: 0,
1560
1568
  structuralCount: 0,
1561
1569
  stateIndices: /* @__PURE__ */ new Set()
@@ -1652,7 +1660,7 @@ function rewriteQueuedKeyedArrayMappedStructuralHints(root, statesBySetter, mapU
1652
1660
  function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpdateIdentifier, mapPipelineIdentifier, appendIdentifier, mappedStructuralAppendIdentifier, structuralAppendMapPipelineIdentifier, filterIdentifier, sliceIdentifier, mappedStructuralIdentifier, allowed) {
1653
1661
  if (!allowed) {
1654
1662
  return {
1655
- root: types.cloneNode(root, true),
1663
+ root,
1656
1664
  mapCount: 0,
1657
1665
  mappedStructuralAppendCount: 0,
1658
1666
  structuralAppendMapCount: 0,
@@ -1776,7 +1784,7 @@ function rewriteQueuedKeyedArrayStructuralMapHints(root, statesBySetter, mapUpda
1776
1784
  function rewriteQueuedKeyedArrayStructuralPrependMapHints(root, statesBySetter, mapUpdateIdentifier, mapPipelineIdentifier, prependIdentifier, mappedStructuralPrependIdentifier, structuralPrependMapPipelineIdentifier, filterIdentifier, sliceIdentifier, mappedStructuralIdentifier, allowed) {
1777
1785
  if (!allowed) {
1778
1786
  return {
1779
- root: types.cloneNode(root, true),
1787
+ root,
1780
1788
  mapCount: 0,
1781
1789
  mappedStructuralPrependCount: 0,
1782
1790
  structuralPrependMapCount: 0,
@@ -1902,7 +1910,7 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
1902
1910
  return {
1903
1911
  chainedMapCount: 0,
1904
1912
  chainedRollingWindowCount: 0,
1905
- root: types.cloneNode(root, true),
1913
+ root,
1906
1914
  leadingMapCount: 0,
1907
1915
  mappedRollingWindowCount: 0,
1908
1916
  rollingWindowCount: 0,
@@ -2060,7 +2068,7 @@ function rewriteQueuedKeyedArrayRollingWindowMapHints(root, statesBySetter, mapU
2060
2068
  function rewriteQueuedKeyedArrayStructuralReorderHints(root, statesBySetter, filterIdentifier, sliceIdentifier, mapPipelineIdentifier, queuedMapPipelineIdentifier, mappedStructuralIdentifier, mapReorderIdentifier, reorderIdentifier, sortIdentifier, structuralReorderIdentifier, structuralSortIdentifier, allowed) {
2061
2069
  if (!allowed) {
2062
2070
  return {
2063
- root: types.cloneNode(root, true),
2071
+ root,
2064
2072
  reorderCount: 0,
2065
2073
  sortCount: 0,
2066
2074
  replacedMapReorderCount: 0,
@@ -2190,7 +2198,7 @@ function rewriteQueuedKeyedArrayStructuralReorderHints(root, statesBySetter, fil
2190
2198
  function rewriteQueuedKeyedArrayMapReorderHints(root, statesBySetter, mapUpdateIdentifier, queuedMapPipelineIdentifier, mapReorderIdentifier, reorderIdentifier, sortIdentifier, structuralReorderIdentifier, structuralSortIdentifier, allowed) {
2191
2199
  if (!allowed) {
2192
2200
  return {
2193
- root: types.cloneNode(root, true),
2201
+ root,
2194
2202
  mapCount: 0,
2195
2203
  mapReorderCount: 0,
2196
2204
  mapSortCount: 0