@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/client/index.js
CHANGED
|
@@ -29933,23 +29933,45 @@ var initializeIslandStores = (state) => {
|
|
|
29933
29933
|
};
|
|
29934
29934
|
globalThis.__ABS_ISLAND_STATE__ = nextSnapshot;
|
|
29935
29935
|
for (const [storeId, store] of getIslandStores()) {
|
|
29936
|
-
|
|
29936
|
+
for (const instance of store) {
|
|
29937
|
+
instance.applyExternalSnapshot(nextSnapshot[storeId] ?? {});
|
|
29938
|
+
}
|
|
29937
29939
|
}
|
|
29938
29940
|
};
|
|
29939
|
-
var createIslandStore = (storeId
|
|
29941
|
+
var createIslandStore = (storeId, createState) => {
|
|
29942
|
+
const store = createStore(createState);
|
|
29940
29943
|
const stores = getIslandStores();
|
|
29941
|
-
const
|
|
29942
|
-
if (existingStore) {
|
|
29943
|
-
return existingStore;
|
|
29944
|
-
}
|
|
29945
|
-
const store = createStore()(createState);
|
|
29944
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
29946
29945
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
29947
29946
|
applySnapshot(store, initialSnapshot);
|
|
29948
|
-
|
|
29947
|
+
let isApplyingExternalSnapshot = false;
|
|
29948
|
+
const applyExternalSnapshot = (snapshot) => {
|
|
29949
|
+
isApplyingExternalSnapshot = true;
|
|
29950
|
+
applySnapshot(store, snapshot);
|
|
29951
|
+
};
|
|
29952
|
+
const syncSnapshot = (state) => {
|
|
29953
|
+
const nextSnapshot = toSerializableState(state);
|
|
29954
|
+
getIslandStoreSnapshot()[storeId] = nextSnapshot;
|
|
29955
|
+
for (const peerStore of storeInstances) {
|
|
29956
|
+
if (peerStore.store === store) {
|
|
29957
|
+
continue;
|
|
29958
|
+
}
|
|
29959
|
+
peerStore.applyExternalSnapshot(nextSnapshot);
|
|
29960
|
+
}
|
|
29961
|
+
};
|
|
29962
|
+
storeInstances.add({
|
|
29963
|
+
applyExternalSnapshot,
|
|
29964
|
+
store
|
|
29965
|
+
});
|
|
29966
|
+
stores.set(storeId, storeInstances);
|
|
29967
|
+
syncSnapshot(store.getState());
|
|
29949
29968
|
store.subscribe((state) => {
|
|
29950
|
-
|
|
29969
|
+
if (isApplyingExternalSnapshot) {
|
|
29970
|
+
isApplyingExternalSnapshot = false;
|
|
29971
|
+
return;
|
|
29972
|
+
}
|
|
29973
|
+
syncSnapshot(state);
|
|
29951
29974
|
});
|
|
29952
|
-
stores.set(storeId, store);
|
|
29953
29975
|
return store;
|
|
29954
29976
|
};
|
|
29955
29977
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -30236,5 +30258,5 @@ export {
|
|
|
30236
30258
|
createIslandManifestResolver
|
|
30237
30259
|
};
|
|
30238
30260
|
|
|
30239
|
-
//# debugId=
|
|
30261
|
+
//# debugId=EA1E2AFA54A352E864756E2164756E21
|
|
30240
30262
|
//# sourceMappingURL=index.js.map
|