@absolutejs/absolute 0.19.0-beta.337 → 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 -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 +7 -5
- 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/client/index.js
CHANGED
|
@@ -29933,31 +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()((set, get, api) => createState((update) => {
|
|
29946
|
-
set((state) => {
|
|
29947
|
-
const nextPartial = typeof update === "function" ? update(state) : update;
|
|
29948
|
-
return {
|
|
29949
|
-
...state,
|
|
29950
|
-
...nextPartial
|
|
29951
|
-
};
|
|
29952
|
-
});
|
|
29953
|
-
}, get, api));
|
|
29944
|
+
const storeInstances = stores.get(storeId) ?? new Set;
|
|
29954
29945
|
const initialSnapshot = getIslandStoreSnapshot()[storeId];
|
|
29955
29946
|
applySnapshot(store, initialSnapshot);
|
|
29956
|
-
|
|
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());
|
|
29957
29968
|
store.subscribe((state) => {
|
|
29958
|
-
|
|
29969
|
+
if (isApplyingExternalSnapshot) {
|
|
29970
|
+
isApplyingExternalSnapshot = false;
|
|
29971
|
+
return;
|
|
29972
|
+
}
|
|
29973
|
+
syncSnapshot(state);
|
|
29959
29974
|
});
|
|
29960
|
-
stores.set(storeId, store);
|
|
29961
29975
|
return store;
|
|
29962
29976
|
};
|
|
29963
29977
|
var readIslandStore = (store, selector) => selector(store.getState());
|
|
@@ -30244,5 +30258,5 @@ export {
|
|
|
30244
30258
|
createIslandManifestResolver
|
|
30245
30259
|
};
|
|
30246
30260
|
|
|
30247
|
-
//# debugId=
|
|
30261
|
+
//# debugId=EA1E2AFA54A352E864756E2164756E21
|
|
30248
30262
|
//# sourceMappingURL=index.js.map
|