Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gileck committed Sep 30, 2024
1 parent af6e1a5 commit abb059b
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 21 deletions.
24 changes: 21 additions & 3 deletions src/babelPlugin/__snapshots__/macro-debug.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -635,7 +641,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -1241,7 +1253,13 @@ const modelBuilder = (function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down
24 changes: 21 additions & 3 deletions src/babelPlugin/__snapshots__/macro-no-current-line.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -635,7 +641,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -1241,7 +1253,13 @@ const modelBuilder = (function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down
24 changes: 21 additions & 3 deletions src/babelPlugin/__snapshots__/macro.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -635,7 +641,13 @@ module.exports = function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down Expand Up @@ -1241,7 +1253,13 @@ const modelBuilder = (function () {
}if (types.some(checkType)) {
return;
}const asString = typeof input === 'object' ? JSON.stringify(input) : input;throw new TypeError(\`\${functionName} expects \${types.join('/')}. \${name} at \${source}: \${asString}.\${functionName}\`);
}const $res = { $model };const $listeners = new Set();const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = new WeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
}const $res = { $model };const $listeners = new Set();function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap();
}if (window.WixMap) {
return new window.WixMap();
}return new WeakMap();
}const $trackingMap = new WeakMap();const $trackingWildcards = new WeakMap();const $invalidatedMap = getWeakMap();const $invalidatedRoots = new Set();$invalidatedRoots.$subKeys = new Map();$invalidatedRoots.$parentKey = null;$invalidatedRoots.$parent = null;$invalidatedRoots.$tracked = new Map();let $first = true;let $tainted = new WeakSet();$invalidatedMap.set($res, $invalidatedRoots);function untrack($targetKeySet, $targetKey) {
const $tracked = $targetKeySet.$tracked;if (!$tracked || !$tracked.has($targetKey)) {
return;
}const $trackedByKey = $tracked.get($targetKey);for (let i = 0; i < $trackedByKey.length; i += 3) {
Expand Down
23 changes: 11 additions & 12 deletions src/templates/optimizing.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap()
}

if (window.WixMap) {
return new window.WixMap()
}

return new WeakMap()
}

function base() {
function $NAME($model, $funcLibRaw, $batchingStrategy) {
let $funcLib = $funcLibRaw
Expand Down Expand Up @@ -177,6 +165,17 @@ function base() {
}

function library() {
function getWeakMap() {
if (typeof window !== 'undefined') {
return new WeakMap()
}

if (window.WixMap) {
return new window.WixMap()
}

return new WeakMap()
}
const $trackingMap = new WeakMap();
const $trackingWildcards = new WeakMap();
const $invalidatedMap = getWeakMap()
Expand Down

0 comments on commit abb059b

Please sign in to comment.