@absolutejs/absolute 0.19.0-beta.337 → 0.19.0-beta.339
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/angular/browser.js +33 -19
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +33 -19
- package/dist/angular/index.js.map +3 -3
- package/dist/client/index.js +33 -19
- package/dist/client/index.js.map +3 -3
- package/dist/islands/browser.js +33 -19
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +33 -19
- package/dist/islands/index.js.map +3 -3
- package/dist/islands/server.js +33 -19
- package/dist/islands/server.js.map +3 -3
- package/dist/react/browser.js +33 -19
- package/dist/react/browser.js.map +3 -3
- package/dist/react/hooks/index.js +33 -19
- package/dist/react/hooks/index.js.map +3 -3
- package/dist/react/index.js +33 -19
- package/dist/react/index.js.map +3 -3
- package/dist/src/client/islandStore.d.ts +11 -8
- package/dist/svelte/browser.js +33 -19
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +33 -19
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/browser.js +33 -19
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +33 -19
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/islands/server.js
CHANGED
|
@@ -30266,31 +30266,45 @@ var initializeIslandStores = (state) => {
|
|
|
30266
30266
|
};
|
|
30267
30267
|
globalThis.__ABS_ISLAND_STATE__ = nextSnapshot;
|
|
30268
30268
|
for (const [storeId, store] of getIslandStores()) {
|
|
30269
|
-
|
|
30269
|
+
for (const instance of store) {
|
|
30270
|
+
instance.applyExternalSnapshot(nextSnapshot[storeId] ?? {});
|
|
30271
|
+
}
|
|
30270
30272
|
}
|
|
30271
30273
|
};
|
|
30272
|
-
var createIslandStore = (storeId
|
|
30274
|
+
var createIslandStore = (storeId, createState) => {
|
|
30275
|
+
const store = createStore(createState);
|
|
30273
30276
|
const stores = getIslandStores();
|
|
30274
|
-
const
|
|
30275
|
-
if (existingStore) {
|
|
30276
|
-
return existingStore;
|
|
30277
|
-
}
|
|
30278
|
-
const store = createStore()((set, get, api) => createState((update) => {
|
|
30279
|
-
set((state) => {
|
|
30280
|
-
const nextPartial = typeof update === "function" ? update(state) : update;
|
|
30281
|
-
return {
|
|
30282
|
-
...state,
|
|
30283
|
-
...nextPartial
|
|
30284
|
-
};
|
|
30285
|
-
});
|
|
30286
|
-
}, get, api));
|
|
30277
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
30287
30278
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
30288
30279
|
applySnapshot(store, initialSnapshot);
|
|
30289
|
-
|
|
30280
|
+
let isApplyingExternalSnapshot = false;
|
|
30281
|
+
const applyExternalSnapshot = (snapshot) => {
|
|
30282
|
+
isApplyingExternalSnapshot = true;
|
|
30283
|
+
applySnapshot(store, snapshot);
|
|
30284
|
+
};
|
|
30285
|
+
const syncSnapshot = (state) => {
|
|
30286
|
+
const nextSnapshot = toSerializableState(state);
|
|
30287
|
+
getIslandStoreSnapshot()[storeId] = nextSnapshot;
|
|
30288
|
+
for (const peerStore of storeInstances) {
|
|
30289
|
+
if (peerStore.store === store) {
|
|
30290
|
+
continue;
|
|
30291
|
+
}
|
|
30292
|
+
peerStore.applyExternalSnapshot(nextSnapshot);
|
|
30293
|
+
}
|
|
30294
|
+
};
|
|
30295
|
+
storeInstances.add({
|
|
30296
|
+
applyExternalSnapshot,
|
|
30297
|
+
store
|
|
30298
|
+
});
|
|
30299
|
+
stores.set(storeId, storeInstances);
|
|
30300
|
+
syncSnapshot(store.getState());
|
|
30290
30301
|
store.subscribe((state) => {
|
|
30291
|
-
|
|
30302
|
+
if (isApplyingExternalSnapshot) {
|
|
30303
|
+
isApplyingExternalSnapshot = false;
|
|
30304
|
+
return;
|
|
30305
|
+
}
|
|
30306
|
+
syncSnapshot(state);
|
|
30292
30307
|
});
|
|
30293
|
-
stores.set(storeId, store);
|
|
30294
30308
|
return store;
|
|
30295
30309
|
};
|
|
30296
30310
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -30312,5 +30326,5 @@ export {
|
|
|
30312
30326
|
createIslandStore
|
|
30313
30327
|
};
|
|
30314
30328
|
|
|
30315
|
-
//# debugId=
|
|
30329
|
+
//# debugId=3BD49DBE8F59104B64756E2164756E21
|
|
30316
30330
|
//# sourceMappingURL=server.js.map
|