@absolutejs/absolute 0.19.0-beta.336 → 0.19.0-beta.338
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 -11
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/index.js +33 -11
- package/dist/angular/index.js.map +3 -3
- package/dist/client/index.js +33 -11
- package/dist/client/index.js.map +3 -3
- package/dist/islands/browser.js +33 -11
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +33 -11
- package/dist/islands/index.js.map +3 -3
- package/dist/islands/server.js +33 -11
- package/dist/islands/server.js.map +3 -3
- package/dist/react/browser.js +33 -11
- package/dist/react/browser.js.map +3 -3
- package/dist/react/hooks/index.js +33 -11
- package/dist/react/hooks/index.js.map +3 -3
- package/dist/react/index.js +33 -11
- package/dist/react/index.js.map +3 -3
- package/dist/src/client/islandStore.d.ts +6 -2
- package/dist/svelte/browser.js +33 -11
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/index.js +33 -11
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/browser.js +33 -11
- package/dist/vue/browser.js.map +3 -3
- package/dist/vue/index.js +33 -11
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/islands/server.js
CHANGED
|
@@ -30266,23 +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()(createState);
|
|
30277
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
30279
30278
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
30280
30279
|
applySnapshot(store, initialSnapshot);
|
|
30281
|
-
|
|
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());
|
|
30282
30301
|
store.subscribe((state) => {
|
|
30283
|
-
|
|
30302
|
+
if (isApplyingExternalSnapshot) {
|
|
30303
|
+
isApplyingExternalSnapshot = false;
|
|
30304
|
+
return;
|
|
30305
|
+
}
|
|
30306
|
+
syncSnapshot(state);
|
|
30284
30307
|
});
|
|
30285
|
-
stores.set(storeId, store);
|
|
30286
30308
|
return store;
|
|
30287
30309
|
};
|
|
30288
30310
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -30304,5 +30326,5 @@ export {
|
|
|
30304
30326
|
createIslandStore
|
|
30305
30327
|
};
|
|
30306
30328
|
|
|
30307
|
-
//# debugId=
|
|
30329
|
+
//# debugId=3BD49DBE8F59104B64756E2164756E21
|
|
30308
30330
|
//# sourceMappingURL=server.js.map
|