@absolutejs/absolute 0.19.0-beta.1051 → 0.19.0-beta.1053

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.
Files changed (54) hide show
  1. package/dist/angular/browser.js +3 -2
  2. package/dist/angular/browser.js.map +6 -6
  3. package/dist/angular/components/constants.js +6 -0
  4. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  5. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  6. package/dist/angular/hmrPreserveCore.ts +2 -8
  7. package/dist/angular/index.js +3 -2
  8. package/dist/angular/index.js.map +8 -8
  9. package/dist/angular/server.js +3 -2
  10. package/dist/angular/server.js.map +5 -5
  11. package/dist/build.js +49 -15
  12. package/dist/build.js.map +24 -24
  13. package/dist/cli/config/client.js +1 -1
  14. package/dist/cli/config/server.js +93 -28
  15. package/dist/cli/index.js +413 -121
  16. package/dist/client/index.js.map +1 -1
  17. package/dist/dev/client/errorOverlay.ts +4 -4
  18. package/dist/dev/client/handlers/angularHmrShim.ts +1 -1
  19. package/dist/dev/client/handlers/angularRemount.ts +1 -4
  20. package/dist/dev/client/handlers/angularRemountWiring.ts +0 -1
  21. package/dist/index.js +50 -15
  22. package/dist/index.js.map +26 -26
  23. package/dist/islands/browser.js.map +1 -1
  24. package/dist/islands/index.js +3 -2
  25. package/dist/islands/index.js.map +4 -4
  26. package/dist/react/browser.js.map +1 -1
  27. package/dist/react/components/index.js +3 -2
  28. package/dist/react/components/index.js.map +3 -3
  29. package/dist/react/hooks/index.js.map +1 -1
  30. package/dist/react/index.js +3 -2
  31. package/dist/react/index.js.map +6 -6
  32. package/dist/react/server.js +3 -2
  33. package/dist/react/server.js.map +5 -5
  34. package/dist/src/angular/components/constants.d.ts +1 -0
  35. package/dist/src/cli/scripts/db.d.ts +20 -0
  36. package/dist/src/constants.d.ts +1 -0
  37. package/dist/svelte/browser.js.map +1 -1
  38. package/dist/svelte/index.js +3 -2
  39. package/dist/svelte/index.js.map +6 -6
  40. package/dist/svelte/router/hashMode.ts +1 -1
  41. package/dist/svelte/router/prefetchCache.ts +3 -3
  42. package/dist/svelte/server.js +3 -2
  43. package/dist/svelte/server.js.map +5 -5
  44. package/dist/types/globals.d.ts +1 -3
  45. package/dist/vue/browser.js.map +1 -1
  46. package/dist/vue/components/Image.js +3 -2
  47. package/dist/vue/components/Image.js.map +3 -3
  48. package/dist/vue/components/index.js +3 -2
  49. package/dist/vue/components/index.js.map +3 -3
  50. package/dist/vue/index.js +3 -2
  51. package/dist/vue/index.js.map +7 -7
  52. package/dist/vue/server.js +3 -2
  53. package/dist/vue/server.js.map +6 -6
  54. package/package.json +2 -1
@@ -21,7 +21,7 @@
21
21
  "import type { IslandFramework } from '../../types/island';\nimport {\n\tgetIslandManifestEntries,\n\tgetIslandManifestKey\n} from '../core/islandManifest';\n\nexport const createIslandManifestResolver = (\n\tmanifest: Record<string, string>\n) => {\n\tconst islandManifest = getIslandManifestEntries(manifest);\n\n\treturn async (framework: IslandFramework, component: string) => {\n\t\tconst modulePath =\n\t\t\tislandManifest[framework]?.[component] ??\n\t\t\tmanifest[getIslandManifestKey(framework, component)];\n\t\tif (!modulePath) return undefined;\n\n\t\tconst loadedModule = await import(modulePath);\n\n\t\treturn loadedModule.default;\n\t};\n};\n",
22
22
  "const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n",
23
23
  "const reduxImpl = (reducer, initial) => (set, _get, api) => {\n api.dispatch = (action) => {\n set((state) => reducer(state, action), false, action);\n return action;\n };\n api.dispatchFromDevtools = true;\n return { dispatch: (...args) => api.dispatch(...args), ...initial };\n};\nconst redux = reduxImpl;\n\nconst shouldDispatchFromDevtools = (api) => !!api.dispatchFromDevtools && typeof api.dispatch === \"function\";\nconst trackedConnections = /* @__PURE__ */ new Map();\nconst getTrackedConnectionState = (name) => {\n const api = trackedConnections.get(name);\n if (!api) return {};\n return Object.fromEntries(\n Object.entries(api.stores).map(([key, api2]) => [key, api2.getState()])\n );\n};\nconst extractConnectionInformation = (store, extensionConnector, options) => {\n if (store === void 0) {\n return {\n type: \"untracked\",\n connection: extensionConnector.connect(options)\n };\n }\n const existingConnection = trackedConnections.get(options.name);\n if (existingConnection) {\n return { type: \"tracked\", store, ...existingConnection };\n }\n const newConnection = {\n connection: extensionConnector.connect(options),\n stores: {}\n };\n trackedConnections.set(options.name, newConnection);\n return { type: \"tracked\", store, ...newConnection };\n};\nconst removeStoreFromTrackedConnections = (name, store) => {\n if (store === void 0) return;\n const connectionInfo = trackedConnections.get(name);\n if (!connectionInfo) return;\n delete connectionInfo.stores[store];\n if (Object.keys(connectionInfo.stores).length === 0) {\n trackedConnections.delete(name);\n }\n};\nconst findCallerName = (stack) => {\n var _a, _b;\n if (!stack) return void 0;\n const traceLines = stack.split(\"\\n\");\n const apiSetStateLineIndex = traceLines.findIndex(\n (traceLine) => traceLine.includes(\"api.setState\")\n );\n if (apiSetStateLineIndex < 0) return void 0;\n const callerLine = ((_a = traceLines[apiSetStateLineIndex + 1]) == null ? void 0 : _a.trim()) || \"\";\n return (_b = /.+ (.+) .+/.exec(callerLine)) == null ? void 0 : _b[1];\n};\nconst devtoolsImpl = (fn, devtoolsOptions = {}) => (set, get, api) => {\n const { enabled, anonymousActionType, store, ...options } = devtoolsOptions;\n let extensionConnector;\n try {\n extensionConnector = (enabled != null ? enabled : (import.meta.env ? import.meta.env.MODE : void 0) !== \"production\") && window.__REDUX_DEVTOOLS_EXTENSION__;\n } catch (e) {\n }\n if (!extensionConnector) {\n return fn(set, get, api);\n }\n const { connection, ...connectionInformation } = extractConnectionInformation(store, extensionConnector, options);\n let isRecording = true;\n api.setState = ((state, replace, nameOrAction) => {\n const r = set(state, replace);\n if (!isRecording) return r;\n const action = nameOrAction === void 0 ? {\n type: anonymousActionType || findCallerName(new Error().stack) || \"anonymous\"\n } : typeof nameOrAction === \"string\" ? { type: nameOrAction } : nameOrAction;\n if (store === void 0) {\n connection == null ? void 0 : connection.send(action, get());\n return r;\n }\n connection == null ? void 0 : connection.send(\n {\n ...action,\n type: `${store}/${action.type}`\n },\n {\n ...getTrackedConnectionState(options.name),\n [store]: api.getState()\n }\n );\n return r;\n });\n api.devtools = {\n cleanup: () => {\n if (connection && typeof connection.unsubscribe === \"function\") {\n connection.unsubscribe();\n }\n removeStoreFromTrackedConnections(options.name, store);\n }\n };\n const setStateFromDevtools = (...a) => {\n const originalIsRecording = isRecording;\n isRecording = false;\n set(...a);\n isRecording = originalIsRecording;\n };\n const initialState = fn(api.setState, get, api);\n if (connectionInformation.type === \"untracked\") {\n connection == null ? void 0 : connection.init(initialState);\n } else {\n connectionInformation.stores[connectionInformation.store] = api;\n connection == null ? void 0 : connection.init(\n Object.fromEntries(\n Object.entries(connectionInformation.stores).map(([key, store2]) => [\n key,\n key === connectionInformation.store ? initialState : store2.getState()\n ])\n )\n );\n }\n if (shouldDispatchFromDevtools(api)) {\n let didWarnAboutReservedActionType = false;\n const originalDispatch = api.dispatch;\n api.dispatch = (...args) => {\n if ((import.meta.env ? import.meta.env.MODE : void 0) !== \"production\" && args[0].type === \"__setState\" && !didWarnAboutReservedActionType) {\n console.warn(\n '[zustand devtools middleware] \"__setState\" action type is reserved to set state from the devtools. Avoid using it.'\n );\n didWarnAboutReservedActionType = true;\n }\n originalDispatch(...args);\n };\n }\n connection.subscribe((message) => {\n var _a;\n switch (message.type) {\n case \"ACTION\":\n if (typeof message.payload !== \"string\") {\n console.error(\n \"[zustand devtools middleware] Unsupported action format\"\n );\n return;\n }\n return parseJsonThen(\n message.payload,\n (action) => {\n if (action.type === \"__setState\") {\n if (store === void 0) {\n setStateFromDevtools(action.state);\n return;\n }\n if (Object.keys(action.state).length !== 1) {\n console.error(\n `\n [zustand devtools middleware] Unsupported __setState action format.\n When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),\n and value of this only key should be a state object. Example: { \"type\": \"__setState\", \"state\": { \"abc123Store\": { \"foo\": \"bar\" } } }\n `\n );\n }\n const stateFromDevtools = action.state[store];\n if (stateFromDevtools === void 0 || stateFromDevtools === null) {\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(stateFromDevtools)) {\n setStateFromDevtools(stateFromDevtools);\n }\n return;\n }\n if (shouldDispatchFromDevtools(api)) {\n api.dispatch(action);\n }\n }\n );\n case \"DISPATCH\":\n switch (message.payload.type) {\n case \"RESET\":\n setStateFromDevtools(initialState);\n if (store === void 0) {\n return connection == null ? void 0 : connection.init(api.getState());\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"COMMIT\":\n if (store === void 0) {\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n return connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n case \"ROLLBACK\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n connection == null ? void 0 : connection.init(api.getState());\n return;\n }\n setStateFromDevtools(state[store]);\n connection == null ? void 0 : connection.init(getTrackedConnectionState(options.name));\n });\n case \"JUMP_TO_STATE\":\n case \"JUMP_TO_ACTION\":\n return parseJsonThen(message.state, (state) => {\n if (store === void 0) {\n setStateFromDevtools(state);\n return;\n }\n if (JSON.stringify(api.getState()) !== JSON.stringify(state[store])) {\n setStateFromDevtools(state[store]);\n }\n });\n case \"IMPORT_STATE\": {\n const { nextLiftedState } = message.payload;\n const lastComputedState = (_a = nextLiftedState.computedStates.slice(-1)[0]) == null ? void 0 : _a.state;\n if (!lastComputedState) return;\n if (store === void 0) {\n setStateFromDevtools(lastComputedState);\n } else {\n setStateFromDevtools(lastComputedState[store]);\n }\n connection == null ? void 0 : connection.send(\n null,\n // FIXME no-any\n nextLiftedState\n );\n return;\n }\n case \"PAUSE_RECORDING\":\n return isRecording = !isRecording;\n }\n return;\n }\n });\n return initialState;\n};\nconst devtools = devtoolsImpl;\nconst parseJsonThen = (stringified, fn) => {\n let parsed;\n try {\n parsed = JSON.parse(stringified);\n } catch (e) {\n console.error(\n \"[zustand devtools middleware] Could not parse the received json\",\n e\n );\n }\n if (parsed !== void 0) fn(parsed);\n};\n\nconst subscribeWithSelectorImpl = (fn) => (set, get, api) => {\n const origSubscribe = api.subscribe;\n api.subscribe = ((selector, optListener, options) => {\n let listener = selector;\n if (optListener) {\n const equalityFn = (options == null ? void 0 : options.equalityFn) || Object.is;\n let currentSlice = selector(api.getState());\n listener = (state) => {\n const nextSlice = selector(state);\n if (!equalityFn(currentSlice, nextSlice)) {\n const previousSlice = currentSlice;\n optListener(currentSlice = nextSlice, previousSlice);\n }\n };\n if (options == null ? void 0 : options.fireImmediately) {\n optListener(currentSlice, currentSlice);\n }\n }\n return origSubscribe(listener);\n });\n const initialState = fn(set, get, api);\n return initialState;\n};\nconst subscribeWithSelector = subscribeWithSelectorImpl;\n\nfunction combine(initialState, create) {\n return (...args) => Object.assign({}, initialState, create(...args));\n}\n\nfunction createJSONStorage(getStorage, options) {\n let storage;\n try {\n storage = getStorage();\n } catch (e) {\n return;\n }\n const persistStorage = {\n getItem: (name) => {\n var _a;\n const parse = (str2) => {\n if (str2 === null) {\n return null;\n }\n return JSON.parse(str2, options == null ? void 0 : options.reviver);\n };\n const str = (_a = storage.getItem(name)) != null ? _a : null;\n if (str instanceof Promise) {\n return str.then(parse);\n }\n return parse(str);\n },\n setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, options == null ? void 0 : options.replacer)),\n removeItem: (name) => storage.removeItem(name)\n };\n return persistStorage;\n}\nconst toThenable = (fn) => (input) => {\n try {\n const result = fn(input);\n if (result instanceof Promise) {\n return result;\n }\n return {\n then(onFulfilled) {\n return toThenable(onFulfilled)(result);\n },\n catch(_onRejected) {\n return this;\n }\n };\n } catch (e) {\n return {\n then(_onFulfilled) {\n return this;\n },\n catch(onRejected) {\n return toThenable(onRejected)(e);\n }\n };\n }\n};\nconst persistImpl = (config, baseOptions) => (set, get, api) => {\n let options = {\n storage: createJSONStorage(() => window.localStorage),\n partialize: (state) => state,\n version: 0,\n merge: (persistedState, currentState) => ({\n ...currentState,\n ...persistedState\n }),\n ...baseOptions\n };\n let hasHydrated = false;\n let hydrationVersion = 0;\n const hydrationListeners = /* @__PURE__ */ new Set();\n const finishHydrationListeners = /* @__PURE__ */ new Set();\n let storage = options.storage;\n if (!storage) {\n return config(\n (...args) => {\n console.warn(\n `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`\n );\n set(...args);\n },\n get,\n api\n );\n }\n const setItem = () => {\n const state = options.partialize({ ...get() });\n return storage.setItem(options.name, {\n state,\n version: options.version\n });\n };\n const savedSetState = api.setState;\n api.setState = (state, replace) => {\n savedSetState(state, replace);\n return setItem();\n };\n const configResult = config(\n (...args) => {\n set(...args);\n return setItem();\n },\n get,\n api\n );\n api.getInitialState = () => configResult;\n let stateFromStorage;\n const hydrate = () => {\n var _a, _b;\n if (!storage) return;\n const currentVersion = ++hydrationVersion;\n hasHydrated = false;\n hydrationListeners.forEach((cb) => {\n var _a2;\n return cb((_a2 = get()) != null ? _a2 : configResult);\n });\n const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? void 0 : _b.call(options, (_a = get()) != null ? _a : configResult)) || void 0;\n return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {\n if (deserializedStorageValue) {\n if (typeof deserializedStorageValue.version === \"number\" && deserializedStorageValue.version !== options.version) {\n if (options.migrate) {\n const migration = options.migrate(\n deserializedStorageValue.state,\n deserializedStorageValue.version\n );\n if (migration instanceof Promise) {\n return migration.then((result) => [true, result]);\n }\n return [true, migration];\n }\n console.error(\n `State loaded from storage couldn't be migrated since no migrate function was provided`\n );\n } else {\n return [false, deserializedStorageValue.state];\n }\n }\n return [false, void 0];\n }).then((migrationResult) => {\n var _a2;\n if (currentVersion !== hydrationVersion) {\n return;\n }\n const [migrated, migratedState] = migrationResult;\n stateFromStorage = options.merge(\n migratedState,\n (_a2 = get()) != null ? _a2 : configResult\n );\n set(stateFromStorage, true);\n if (migrated) {\n return setItem();\n }\n }).then(() => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(get(), void 0);\n stateFromStorage = get();\n hasHydrated = true;\n finishHydrationListeners.forEach((cb) => cb(stateFromStorage));\n }).catch((e) => {\n if (currentVersion !== hydrationVersion) {\n return;\n }\n postRehydrationCallback == null ? void 0 : postRehydrationCallback(void 0, e);\n });\n };\n api.persist = {\n setOptions: (newOptions) => {\n options = {\n ...options,\n ...newOptions\n };\n if (newOptions.storage) {\n storage = newOptions.storage;\n }\n },\n clearStorage: () => {\n storage == null ? void 0 : storage.removeItem(options.name);\n },\n getOptions: () => options,\n rehydrate: () => hydrate(),\n hasHydrated: () => hasHydrated,\n onHydrate: (cb) => {\n hydrationListeners.add(cb);\n return () => {\n hydrationListeners.delete(cb);\n };\n },\n onFinishHydration: (cb) => {\n finishHydrationListeners.add(cb);\n return () => {\n finishHydrationListeners.delete(cb);\n };\n }\n };\n if (!options.skipHydration) {\n hydrate();\n }\n return stateFromStorage || configResult;\n};\nconst persist = persistImpl;\n\nfunction ssrSafe(config, isSSR = typeof window === \"undefined\") {\n return (set, get, api) => {\n if (!isSSR) {\n return config(set, get, api);\n }\n const ssrSet = () => {\n throw new Error(\"Cannot set state of Zustand store in SSR\");\n };\n api.setState = ssrSet;\n return config(ssrSet, get, api);\n };\n}\n\nexport { combine, createJSONStorage, devtools, persist, redux, subscribeWithSelector, ssrSafe as unstable_ssrSafe };\n",
24
- "import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nexport const ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nexport const ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\t| Map<string, Set<IslandStoreInstance>>\n\t\t| undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n\n\n",
24
+ "import { createStore, type StateCreator, type StoreApi } from 'zustand/vanilla';\nimport { combine } from 'zustand/middleware';\n\nexport type IslandStoreState = object;\ntype IslandStoreSnapshot = Record<string, unknown>;\ntype IslandStoreShape<\n\tTState extends IslandStoreState,\n\tTActions extends object\n> = Omit<TState, keyof TActions> & TActions;\nexport type IslandStateSnapshot = Record<string, IslandStoreSnapshot>;\ntype AnyIslandStore = StoreApi<object>;\ntype IslandStoreInstance = {\n\tapplyExternalSnapshot: (snapshot: IslandStoreSnapshot) => void;\n\tstore: AnyIslandStore;\n};\n\nexport const ABSOLUTE_ISLAND_STATE = '__ABS_ISLAND_STATE__';\nexport const ABSOLUTE_ISLAND_STORES = '__ABS_ISLAND_STORES__';\n\ndeclare global {\n\tvar __ABS_ISLAND_STATE__: IslandStateSnapshot | undefined;\n\tvar __ABS_ISLAND_STORES__:\n\t\t| Map<string, Set<IslandStoreInstance>>\n\t\t| undefined;\n}\n\nconst getIslandStoreSnapshot = () => {\n\tglobalThis.__ABS_ISLAND_STATE__ ??= {};\n\n\treturn globalThis.__ABS_ISLAND_STATE__;\n};\n\nconst getIslandStores = () => {\n\tglobalThis.__ABS_ISLAND_STORES__ ??= new Map();\n\n\treturn globalThis.__ABS_ISLAND_STORES__;\n};\n\nconst isSerializableValue = (value: unknown) =>\n\ttypeof value !== 'function' && value !== undefined;\n\nconst toSerializableState = <T extends object>(state: T) =>\n\tObject.fromEntries(\n\t\tObject.entries(state).filter(([, value]) => isSerializableValue(value))\n\t);\n\nconst applySnapshot = <T extends object>(\n\tstore: StoreApi<T>,\n\tsnapshot: IslandStoreSnapshot | undefined\n) => {\n\tif (!snapshot) {\n\t\treturn;\n\t}\n\n\tstore.setState({\n\t\t...store.getState(),\n\t\t...snapshot\n\t});\n};\n\nconst getPeerStores = (\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => [...storeInstances].filter((peer) => peer.store !== ownerStore);\n\nconst syncIslandSnapshot = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tstate: IslandStoreShape<TState, TActions>,\n\tstoreInstances: Set<IslandStoreInstance>,\n\townerStore: AnyIslandStore\n) => {\n\tconst nextSnapshot = toSerializableState(state);\n\tgetIslandStoreSnapshot()[storeId] = nextSnapshot;\n\n\tfor (const peerStore of getPeerStores(storeInstances, ownerStore)) {\n\t\tpeerStore.applyExternalSnapshot(nextSnapshot);\n\t}\n};\n\nexport const createIslandStore = <\n\tTState extends IslandStoreState,\n\tTActions extends object\n>(\n\tstoreId: string,\n\tinitialState: TState,\n\tcreateState: StateCreator<TState, [], [], TActions>\n) => {\n\tconst store = createStore(combine(initialState, createState));\n\tconst stores = getIslandStores();\n\tconst storeInstances =\n\t\tstores.get(storeId) ?? new Set<IslandStoreInstance>();\n\tconst initialSnapshot = getIslandStoreSnapshot()[storeId];\n\tapplySnapshot(store, initialSnapshot);\n\tlet isApplyingExternalSnapshot = false;\n\n\tconst applyExternalSnapshot = (snapshot: IslandStoreSnapshot) => {\n\t\tisApplyingExternalSnapshot = true;\n\t\tapplySnapshot(store, snapshot);\n\t};\n\n\tstoreInstances.add({\n\t\tapplyExternalSnapshot,\n\t\tstore\n\t});\n\tstores.set(storeId, storeInstances);\n\n\tsyncIslandSnapshot(storeId, store.getState(), storeInstances, store);\n\tstore.subscribe((state) => {\n\t\tif (isApplyingExternalSnapshot) {\n\t\t\tisApplyingExternalSnapshot = false;\n\n\t\t\treturn;\n\t\t}\n\n\t\tsyncIslandSnapshot(storeId, state, storeInstances, store);\n\t});\n\n\treturn store;\n};\nexport const getIslandStoreServerSnapshot = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getInitialState());\nconst applySnapshotToStoreInstances = (\n\tstoreId: string,\n\tinstances: Set<IslandStoreInstance>,\n\tsnapshot: IslandStateSnapshot\n) => {\n\tfor (const instance of instances) {\n\t\tinstance.applyExternalSnapshot(snapshot[storeId] ?? {});\n\t}\n};\n\nexport const initializeIslandStores = (state: IslandStateSnapshot) => {\n\tconst currentSnapshot = getIslandStoreSnapshot();\n\tconst nextSnapshot: IslandStateSnapshot = {\n\t\t...state,\n\t\t...currentSnapshot\n\t};\n\n\tglobalThis.__ABS_ISLAND_STATE__ = nextSnapshot;\n\n\tfor (const [storeId, store] of getIslandStores()) {\n\t\tapplySnapshotToStoreInstances(storeId, store, nextSnapshot);\n\t}\n};\nexport const readIslandStore = <TState extends IslandStoreState, TSelected>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected\n) => selector(store.getState());\nexport const resetIslandStoreForTesting = () => {\n\tdelete globalThis.__ABS_ISLAND_STATE__;\n\tdelete globalThis.__ABS_ISLAND_STORES__;\n};\nexport const subscribeIslandStore = <\n\tTState extends IslandStoreState,\n\tTSelected\n>(\n\tstore: StoreApi<TState>,\n\tselector: (state: TState) => TSelected,\n\tlistener: (value: TSelected) => void\n) => {\n\tlet currentSelection = selector(store.getState());\n\n\treturn store.subscribe((state) => {\n\t\tconst nextSelection = selector(state);\n\t\tif (Object.is(nextSelection, currentSelection)) {\n\t\t\treturn;\n\t\t}\n\n\t\tcurrentSelection = nextSelection;\n\t\tlistener(nextSelection);\n\t});\n};\n",
25
25
  "import type { IslandFramework } from '../../types/island';\nimport { getIslandComponent, parseIslandProps } from '../core/islands';\nimport { initializeIslandMarkupSnapshot } from './preserveIslandMarkup';\n\ninitializeIslandMarkupSnapshot();\n\ntype RuntimeIslandRegistry = Partial<\n\tRecord<IslandFramework, Record<string, unknown>>\n>;\n\ntype StartIslandsOptions = {\n\tregistry: RuntimeIslandRegistry;\n\tresolveComponent?: (\n\t\tframework: IslandFramework,\n\t\tcomponent: string\n\t) => Promise<unknown>;\n\troot?: ParentNode & Node;\n};\n\ntype IslandElement = HTMLElement & {\n\tdataset: DOMStringMap & {\n\t\tcomponent?: string;\n\t\terror?: string;\n\t\tframework?: IslandFramework;\n\t\thydrate?: string;\n\t\tislandId?: string;\n\t\tprops?: string;\n\t};\n};\n\nconst idleDeadline: IdleDeadline = {\n\tdidTimeout: false,\n\ttimeRemaining: () => 0\n};\n\nconst requestIdle =\n\ttypeof window !== 'undefined' && 'requestIdleCallback' in window\n\t\t? window.requestIdleCallback.bind(window)\n\t\t: (callback: IdleRequestCallback) =>\n\t\t\t\twindow.setTimeout(() => callback(idleDeadline), 1);\n\nconst isPropsRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isIslandElement = (value: EventTarget | null): value is IslandElement =>\n\tvalue instanceof HTMLElement && value.dataset.island === 'true';\n\nconst observedRoots = new WeakSet<Node>();\nconst hydratingIslands = new WeakSet<HTMLElement>();\n\n// Framework-specific hydrators are dynamic-imported on first use so the\n// island runtime never statically pulls in a framework's runtime (and its\n// transitive deps) the consumer doesn't actually use. Without this, a\n// React-only project loading `@absolutejs/absolute/client` would resolve\n// every framework's peer deps — including `@angular/core` — and fail at\n// module load if any of them weren't installed.\nconst hydrateByFramework = async (\n\tregistry: RuntimeIslandRegistry,\n\tframework: IslandFramework,\n\tcomponentName: string,\n\telement: IslandElement,\n\tprops: unknown,\n\tresolveComponent?: (\n\t\tframework: IslandFramework,\n\t\tcomponent: string\n\t) => Promise<unknown>\n) => {\n\tconst propsRecord = isPropsRecord(props) ? props : undefined;\n\n\tif (framework === 'react') {\n\t\tconst { hydrateReactIsland, isReactComponent } = await import(\n\t\t\t'./hydrators/react'\n\t\t);\n\t\tconst resolvedComponent =\n\t\t\t(await resolveComponent?.(framework, componentName)) ??\n\t\t\tgetIslandComponent(registry.react?.[componentName]);\n\t\tif (!isReactComponent(resolvedComponent)) return;\n\n\t\thydrateReactIsland(resolvedComponent, element, propsRecord);\n\t\telement.dataset.hydrated = 'true';\n\n\t\treturn;\n\t}\n\n\tif (framework === 'svelte') {\n\t\tconst { hydrateSvelteIsland, isSvelteComponent } = await import(\n\t\t\t'./hydrators/svelte'\n\t\t);\n\t\tconst resolvedComponent =\n\t\t\t(await resolveComponent?.(framework, componentName)) ??\n\t\t\tgetIslandComponent(registry.svelte?.[componentName]);\n\t\tif (!isSvelteComponent(resolvedComponent)) return;\n\n\t\thydrateSvelteIsland(resolvedComponent, element, propsRecord);\n\t\telement.dataset.hydrated = 'true';\n\n\t\treturn;\n\t}\n\n\tif (framework === 'vue') {\n\t\tconst { hydrateVueIsland, isVueComponent } = await import(\n\t\t\t'./hydrators/vue'\n\t\t);\n\t\tconst resolvedComponent =\n\t\t\t(await resolveComponent?.(framework, componentName)) ??\n\t\t\tgetIslandComponent(registry.vue?.[componentName]);\n\t\tif (!isVueComponent(resolvedComponent)) return;\n\n\t\thydrateVueIsland(resolvedComponent, element, propsRecord);\n\t\telement.dataset.hydrated = 'true';\n\n\t\treturn;\n\t}\n\n\tif (framework === 'angular') {\n\t\tconst { mountAngularIsland, isAngularComponent } = await import(\n\t\t\t'../angular/islands'\n\t\t);\n\t\tconst resolvedComponent =\n\t\t\t(await resolveComponent?.(framework, componentName)) ??\n\t\t\tgetIslandComponent(registry.angular?.[componentName]);\n\t\tconst { islandId } = element.dataset;\n\t\tif (!isAngularComponent(resolvedComponent) || !islandId) return;\n\n\t\tawait mountAngularIsland(\n\t\t\tresolvedComponent,\n\t\t\telement,\n\t\t\tpropsRecord ?? {},\n\t\t\tislandId\n\t\t);\n\t\telement.dataset.hydrated = 'true';\n\t}\n};\n\nconst hydrateIsland = async (\n\tregistry: RuntimeIslandRegistry,\n\telement: IslandElement,\n\tresolveComponent?: (\n\t\tframework: IslandFramework,\n\t\tcomponent: string\n\t) => Promise<unknown>\n) => {\n\tif (element.dataset.hydrated === 'true' || hydratingIslands.has(element)) {\n\t\treturn;\n\t}\n\n\tconst { framework } = element.dataset;\n\tconst componentName = element.dataset.component;\n\tif (!framework || !componentName) return;\n\n\tconst props = parseIslandProps(element.getAttribute('data-props'));\n\thydratingIslands.add(element);\n\n\ttry {\n\t\tawait hydrateByFramework(\n\t\t\tregistry,\n\t\t\tframework,\n\t\t\tcomponentName,\n\t\t\telement,\n\t\t\tprops,\n\t\t\tresolveComponent\n\t\t);\n\t} catch (error) {\n\t\tconst message =\n\t\t\terror instanceof Error ? error.message : 'Unknown island error';\n\t\telement.dataset.error = message;\n\t\tconsole.error(\n\t\t\t`[islands] Failed to hydrate ${framework}:${componentName}`,\n\t\t\terror\n\t\t);\n\t} finally {\n\t\thydratingIslands.delete(element);\n\t}\n};\n\nconst scheduleIsland = (\n\tregistry: RuntimeIslandRegistry,\n\telement: IslandElement,\n\tobserver: IntersectionObserver | null,\n\tresolveComponent?: (\n\t\tframework: IslandFramework,\n\t\tcomponent: string\n\t) => Promise<unknown>\n) => {\n\tconst mode = element.dataset.hydrate ?? 'load';\n\tif (mode === 'none') return;\n\tif (mode === 'load') {\n\t\tvoid hydrateIsland(registry, element, resolveComponent);\n\n\t\treturn;\n\t}\n\tif (mode === 'idle') {\n\t\trequestIdle(\n\t\t\t() => void hydrateIsland(registry, element, resolveComponent)\n\t\t);\n\n\t\treturn;\n\t}\n\tif (mode === 'visible' && observer) {\n\t\tobserver.observe(element);\n\n\t\treturn;\n\t}\n\n\tvoid hydrateIsland(registry, element, resolveComponent);\n};\n\nconst collectIslandElements = (node: Node) => {\n\tconst islands: IslandElement[] = [];\n\tif (isIslandElement(node)) islands.push(node);\n\tif (!(node instanceof Element)) return islands;\n\n\tconst nested = node.querySelectorAll<IslandElement>('[data-island=\"true\"]');\n\tfor (const island of nested) {\n\t\tislands.push(island);\n\t}\n\n\treturn islands;\n};\n\nexport const startIslands = ({\n\tregistry,\n\tresolveComponent,\n\troot = document.documentElement\n}: StartIslandsOptions) => {\n\tconst targetRoot = root instanceof Document ? root.documentElement : root;\n\n\tconst observer =\n\t\ttypeof IntersectionObserver === 'undefined'\n\t\t\t? null\n\t\t\t: new IntersectionObserver((entries) => {\n\t\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\t\tif (!entry.isIntersecting) continue;\n\t\t\t\t\t\tif (!isIslandElement(entry.target)) continue;\n\n\t\t\t\t\t\tobserver?.unobserve(entry.target);\n\t\t\t\t\t\tvoid hydrateIsland(\n\t\t\t\t\t\t\tregistry,\n\t\t\t\t\t\t\tentry.target,\n\t\t\t\t\t\t\tresolveComponent\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\tconst islands = targetRoot.querySelectorAll<IslandElement>(\n\t\t'[data-island=\"true\"]'\n\t);\n\tfor (const island of islands) {\n\t\tscheduleIsland(registry, island, observer, resolveComponent);\n\t}\n\n\tif (typeof MutationObserver === 'undefined') return;\n\tif (observedRoots.has(targetRoot)) return;\n\n\tconst mutationObserver = new MutationObserver((records) => {\n\t\tconst addedIslands = records.flatMap((record) =>\n\t\t\tArray.from(record.addedNodes).flatMap(collectIslandElements)\n\t\t);\n\t\tfor (const island of addedIslands) {\n\t\t\tscheduleIsland(registry, island, observer, resolveComponent);\n\t\t}\n\t});\n\n\tobservedRoots.add(targetRoot);\n\tmutationObserver.observe(targetRoot, {\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n};\n",
26
26
  "import type { RuntimeIslandRenderProps } from '../../types/island';\nimport { getIslandMarkerAttributes } from '../core/islandMarkupAttributes';\n\ntype PreservedIslandMarkup = {\n\tattributes: Record<string, string>;\n\tinnerHTML: string;\n};\n\ntype IslandMarkerElement = HTMLElement & {\n\tdataset: DOMStringMap & {\n\t\tcomponent?: string;\n\t\tframework?: string;\n\t\thydrate?: string;\n\t\tisland?: string;\n\t\tislandId?: string;\n\t\tprops?: string;\n\t};\n};\n\nconst getSnapshotMap = () => {\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\twindow.__ABS_SERVER_ISLAND_HTML__ ??= new Map<\n\t\tstring,\n\t\tPreservedIslandMarkup[]\n\t>();\n\n\treturn window.__ABS_SERVER_ISLAND_HTML__;\n};\n\nconst getIslandSignature = (props: RuntimeIslandRenderProps) => {\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn [\n\t\tattributes['data-component'],\n\t\tattributes['data-framework'],\n\t\tattributes['data-hydrate'],\n\t\tattributes['data-props']\n\t].join('::');\n};\n\nconst isMatchingIslandElement = (\n\telement: Element,\n\tprops: RuntimeIslandRenderProps\n): element is IslandMarkerElement => {\n\tif (!(element instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\n\tconst attributes = getIslandMarkerAttributes(props);\n\n\treturn (\n\t\telement.dataset.island === 'true' &&\n\t\telement.dataset.component === attributes['data-component'] &&\n\t\telement.dataset.framework === attributes['data-framework'] &&\n\t\t(element.dataset.hydrate ?? 'load') === attributes['data-hydrate'] &&\n\t\t(element.dataset.props ?? '{}') === attributes['data-props']\n\t);\n};\n\nconst snapshotIslandElement = (\n\telement: HTMLElement,\n\tsnapshotMap: Map<string, PreservedIslandMarkup[]>\n) => {\n\tconst signature = [\n\t\telement.dataset.component,\n\t\telement.dataset.framework,\n\t\telement.dataset.hydrate ?? 'load',\n\t\telement.dataset.props ?? '{}'\n\t].join('::');\n\tconst existing = snapshotMap.get(signature) ?? [];\n\tconst attributes = Object.fromEntries(\n\t\telement\n\t\t\t.getAttributeNames()\n\t\t\t.map((name) => [name, element.getAttribute(name) ?? ''])\n\t);\n\texisting.push({\n\t\tattributes,\n\t\tinnerHTML: element.innerHTML\n\t});\n\tsnapshotMap.set(signature, existing);\n};\n\nexport const initializeIslandMarkupSnapshot = () => {\n\tif (typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\tconst snapshotMap = getSnapshotMap();\n\tif (!snapshotMap || snapshotMap.size > 0) {\n\t\treturn;\n\t}\n\n\tconst elements = Array.from(\n\t\tdocument.querySelectorAll<HTMLElement>('[data-island=\"true\"]')\n\t);\n\tfor (const element of elements) {\n\t\tsnapshotIslandElement(element, snapshotMap);\n\t}\n};\n\nexport const preserveIslandMarkup = (props: RuntimeIslandRenderProps) => {\n\tif (typeof document === 'undefined') {\n\t\treturn {\n\t\t\tattributes: getIslandMarkerAttributes(props),\n\t\t\tinnerHTML: ''\n\t\t};\n\t}\n\n\tconst snapshotMap = getSnapshotMap();\n\tconst signature = getIslandSignature(props);\n\t// Islands that share a signature (same component, framework, hydrate mode\n\t// and serialized props) produce byte-identical SSR markup, so the first\n\t// captured snapshot is correct for every instance. Returning it\n\t// unconditionally keeps this stateless: React may call the component many\n\t// times during a single hydration (StrictMode double-render, hydration\n\t// retries, mismatch regeneration), and a per-call claim counter would run\n\t// past the snapshot list and yield empty markup — making the host render\n\t// `dangerouslySetInnerHTML={{ __html: '' }}` and wipe the island's\n\t// server-rendered DOM before the island runtime can hydrate it.\n\tconst snapshotCandidate = snapshotMap?.get(signature)?.[0];\n\tif (snapshotCandidate) {\n\t\treturn snapshotCandidate;\n\t}\n\n\t// Snapshot not captured yet (the island runtime module hasn't evaluated):\n\t// fall back to reading the live SSR DOM directly.\n\tconst liveCandidate = Array.from(\n\t\tdocument.querySelectorAll('[data-island=\"true\"]')\n\t).find((element) => isMatchingIslandElement(element, props));\n\tif (!liveCandidate) {\n\t\treturn {\n\t\t\tattributes: getIslandMarkerAttributes(props),\n\t\t\tinnerHTML: ''\n\t\t};\n\t}\n\n\treturn {\n\t\tattributes: Object.fromEntries(\n\t\t\tliveCandidate\n\t\t\t\t.getAttributeNames()\n\t\t\t\t.map((name) => [name, liveCandidate.getAttribute(name) ?? ''])\n\t\t),\n\t\tinnerHTML: liveCandidate.innerHTML\n\t};\n};\n"
27
27
  ],
@@ -108,7 +108,7 @@ const buildLocationSection = (
108
108
 
109
109
  if (lineText) {
110
110
  const codeBlock = document.createElement('pre');
111
- codeBlock.style.cssText = `${codeBlockStyle }margin-top:8px;`;
111
+ codeBlock.style.cssText = `${codeBlockStyle}margin-top:8px;`;
112
112
  codeBlock.textContent = lineText;
113
113
  locSection.appendChild(codeBlock);
114
114
  }
@@ -141,7 +141,7 @@ const buildStackSection = (stack: string | undefined, message: string) => {
141
141
  label.textContent = 'Stack';
142
142
  section.appendChild(label);
143
143
  const pre = document.createElement('pre');
144
- pre.style.cssText = `${codeBlockStyle }max-height:300px;overflow-y:auto;`;
144
+ pre.style.cssText = `${codeBlockStyle}max-height:300px;overflow-y:auto;`;
145
145
  pre.textContent = cleaned;
146
146
  section.appendChild(pre);
147
147
 
@@ -155,7 +155,7 @@ const collectLoadedScripts = () => {
155
155
  const scripts = Array.from(document.querySelectorAll('script[src]'));
156
156
  const urls: string[] = [];
157
157
  for (const script of scripts) {
158
- const {src} = (script as HTMLScriptElement);
158
+ const { src } = script as HTMLScriptElement;
159
159
  if (!src) continue;
160
160
  // Filter to JS we serve — vendor chunks, generated indexes, root
161
161
  // chunk-XXX.js outputs. Skip user-pasted CDN scripts and the like.
@@ -195,7 +195,7 @@ const buildDiagnosticsSection = () => {
195
195
  }
196
196
 
197
197
  const pre = document.createElement('pre');
198
- pre.style.cssText = `${codeBlockStyle }max-height:200px;overflow-y:auto;`;
198
+ pre.style.cssText = `${codeBlockStyle}max-height:200px;overflow-y:auto;`;
199
199
  pre.textContent = lines.join('\n');
200
200
  section.appendChild(pre);
201
201
 
@@ -33,7 +33,7 @@ declare global {
33
33
  interface Window {
34
34
  __angularHmr?: AngularHmrBus;
35
35
  }
36
-
36
+
37
37
  var __angularHmr: AngularHmrBus | undefined;
38
38
  }
39
39
 
@@ -223,10 +223,7 @@ const teardownOldLView = (oldLView: LView) => {
223
223
  * `def.inputs` metadata format (modern Angular):
224
224
  * - `{ propName: 'classFieldName' }` (simple alias)
225
225
  * - `{ propName: ['publicName', 'classFieldName', transformFn?] }` */
226
- const copyInputsFromOldToNew = (
227
- oldInstance: unknown,
228
- newInstance: unknown
229
- ) => {
226
+ const copyInputsFromOldToNew = (oldInstance: unknown, newInstance: unknown) => {
230
227
  if (!oldInstance || !newInstance) return;
231
228
  const def = (newInstance as { constructor?: { ɵcmp?: unknown } })
232
229
  .constructor?.ɵcmp as { inputs?: Record<string, unknown> } | undefined;
@@ -9,7 +9,6 @@ import type {} from '../../../types/globals';
9
9
  import { remountComponentClass, type RemountResult } from './angularRemount';
10
10
 
11
11
  declare global {
12
-
13
12
  var __absAngularRemount:
14
13
  | ((
15
14
  Class: new (...args: unknown[]) => unknown,
package/dist/index.js CHANGED
@@ -5921,8 +5921,9 @@ var init_compileTailwind = __esm(() => {
5921
5921
  });
5922
5922
 
5923
5923
  // src/constants.ts
5924
- var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
5924
+ var ANGULAR_INIT_TIMEOUT_MS = 500, ANSI_ESCAPE_CODE = 27, ANSI_ESCAPE_LENGTH = 3, ASCII_SPACE = 32, BASE_36_RADIX = 36, BUN_BUILD_WARNING_SUPPRESSION = "wildcard sideEffects are not supported yet", TAILWIND_BUN_CSS_WARNING_PATTERN, BODY_SLICE_LENGTH = 2000, BYTES_PER_KILOBYTE = 1024, CLI_ARGS_OFFSET = 3, CSS_ERROR_RESOLVE_DELAY_MS = 50, CSS_MAX_CHECK_ATTEMPTS = 10, CSS_MAX_PARSE_TIMEOUT_MS = 500, CSS_SHEET_READY_TIMEOUT_MS = 100, DEFAULT_CHUNK_SIZE = 16384, DEFAULT_DEBOUNCE_MS = 15, DEFAULT_PORT = 3000, DEV_SERVER_RESTART_DEBOUNCE_MS = 100, DOM_UPDATE_DELAY_MS = 50, FILE_PROTOCOL_PREFIX_LENGTH = 7, FOCUS_ID_PREFIX_LENGTH = 3, FOCUS_IDX_PREFIX_LENGTH = 4, FOCUS_NAME_PREFIX_LENGTH = 5, ESLINT_STUDIO_DEFAULT_HOST = "eslint.absolute.localhost", ESLINT_STUDIO_DEFAULT_PORT = 4099, CONFIG_DEFAULT_HOST = "config.absolute.localhost", CONFIG_DEFAULT_PORT = 4099, HMR_UPDATE_TIMEOUT_MS = 2000, HOOK_SIGNATURE_LENGTH = 12, EXCLUDE_LAST_OFFSET = -1, HTTP_STATUS_OK = 200, HTTP_STATUS_BAD_REQUEST = 400, HTTP_STATUS_NOT_FOUND = 404, HOURS_IN_DAY = 24, HOURS_IN_HALF_DAY = 12, IMAGE_DEFAULT_DEVICE_SIZES, IMAGE_DEFAULT_IMAGE_SIZES, IMAGE_DEFAULT_QUALITY = 75, IMAGE_GLOB_SUFFIX_LENGTH = 2, INSTANCE_PROBE_TIMEOUT_MS = 250, MAX_ERROR_LENGTH = 200, MAX_RECONNECT_ATTEMPTS = 60, MILLISECONDS_IN_A_SECOND = 1000, MINUTES_IN_AN_HOUR = 60, SECONDS_IN_A_MINUTE = 60, MILLISECONDS_IN_A_MINUTE, MILLISECONDS_IN_A_DAY, OVERLAY_FADE_DURATION_MS = 150, PING_INTERVAL_MS = 30000, LIST_LOG_TAIL_MAX_BYTES = 65536, LIST_TUI_COLUMN_GAP = 2, LIST_TUI_DEFAULT_HEIGHT = 28, LIST_TUI_DEFAULT_WIDTH = 100, LIST_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, LIST_TUI_FOOTER_LINE_COUNT = 2, LIST_TUI_MARKER_WIDTH = 2, LIST_TUI_MIN_LOG_HEIGHT = 3, LIST_TUI_MIN_URL_WIDTH = 16, LIST_TUI_RENDER_DEBOUNCE_MS = 16, LIST_TUI_STATUS_MESSAGE_TIMEOUT_MS = 4000, LIST_WATCH_REFRESH_MS = 1000, RAF_BATCH_COUNT = 3, RANDOM_ID_END_INDEX = 11, REBUILD_BATCH_DELAY_MS = 10, REBUILD_RELOAD_DELAY_MS = 200, RECONNECT_INITIAL_DELAY_MS = 500, RECONNECT_POLL_INTERVAL_MS = 300, REACT_STREAM_SLOT_FAST_DELAY_MS = 5, REACT_STREAM_SLOT_SLOW_DELAY_MS = 20, SIGINT_EXIT_CODE = 130, SIGTERM_EXIT_CODE = 143, SVELTE_CSS_LOAD_TIMEOUT_MS = 500, TIME_PRECISION = 2, TWO_THIRDS, UNFOUND_INDEX = -1, WEBSOCKET_NORMAL_CLOSURE = 1000, WORKSPACE_COMMAND_ARGS_OFFSET = 3, WORKSPACE_FAILURE_LOG_PRINT_LIMIT = 30, WORKSPACE_FAILURE_RECENT_LOG_LIMIT = 60, WORKSPACE_READY_ATTEMPT_TIMEOUT_MS = 5000, WORKSPACE_READY_PROBE_INTERVAL_MS = 250, WORKSPACE_READY_TIMEOUT_MS = 30000, WORKSPACE_SHUTDOWN_TIMEOUT_MS = 1e4, WORKSPACE_TUI_DEFAULT_HEIGHT = 28, WORKSPACE_TUI_DEFAULT_WIDTH = 100, WORKSPACE_TUI_ESCAPE_SEQUENCE_TIMEOUT_MS = 30, WORKSPACE_TUI_FOOTER_LINE_COUNT = 3, WORKSPACE_TUI_MIN_LOG_HEIGHT = 3, WORKSPACE_TUI_MIN_SERVICE_NAME_WIDTH = 7, WORKSPACE_TUI_MIN_TARGET_WIDTH = 8, WORKSPACE_TUI_MIN_WRAP_WIDTH = 12, WORKSPACE_TUI_PROMPT_CURSOR_OFFSET = 3, WORKSPACE_TUI_RECENT_LOG_LIMIT = 40, WORKSPACE_TUI_RENDER_DEBOUNCE_MS = 16, WORKSPACE_TUI_STATUS_WIDTH = 10, WORKSPACE_TUI_TARGET_PADDING_WIDTH = 6, WORKSPACE_TUI_VISIBILITY_WIDTH = 8;
5925
5925
  var init_constants = __esm(() => {
5926
+ TAILWIND_BUN_CSS_WARNING_PATTERN = /invalid @ rule encountered: '@(theme|tailwind|source|utility|variant|custom-variant|apply|reference|plugin|config)'/;
5926
5927
  IMAGE_DEFAULT_DEVICE_SIZES = [
5927
5928
  640,
5928
5929
  750,
@@ -19626,7 +19627,7 @@ var init_htmlScriptHMRPlugin = __esm(() => {
19626
19627
  // src/build/outputLogs.ts
19627
19628
  var outputLogs = (logs) => {
19628
19629
  for (const log2 of logs) {
19629
- if (log2.message.includes(BUN_BUILD_WARNING_SUPPRESSION))
19630
+ if (log2.message.includes(BUN_BUILD_WARNING_SUPPRESSION) || TAILWIND_BUN_CSS_WARNING_PATTERN.test(log2.message))
19630
19631
  continue;
19631
19632
  if (log2.level === "error")
19632
19633
  console.error(log2);
@@ -36785,23 +36786,24 @@ var toSafeFileName6 = (specifier) => {
36785
36786
  dep: Array.from(dep).filter(isResolvable3),
36786
36787
  framework: Array.from(framework).filter(isResolvable3)
36787
36788
  };
36788
- }, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
36789
+ }, collectBareImportsFromFile = async (entryPath, transpiler6, maxDepth = 8) => {
36789
36790
  const { readFileSync: readFileSync31 } = await import("fs");
36790
- const transpiler6 = new Bun.Transpiler({ loader: "js" });
36791
- const newSpecs = new Set;
36792
- for (const spec of specs) {
36793
- if (alreadyScanned.has(spec))
36791
+ const { dirname: dirname27 } = await import("path");
36792
+ const seenFiles = new Set;
36793
+ const bareOut = new Set;
36794
+ const queue = [
36795
+ { depth: 0, path: entryPath }
36796
+ ];
36797
+ while (queue.length > 0) {
36798
+ const { path, depth } = queue.shift();
36799
+ if (seenFiles.has(path))
36794
36800
  continue;
36795
- alreadyScanned.add(spec);
36796
- let resolved;
36797
- try {
36798
- resolved = Bun.resolveSync(spec, process.cwd());
36799
- } catch {
36801
+ seenFiles.add(path);
36802
+ if (depth > maxDepth)
36800
36803
  continue;
36801
- }
36802
36804
  let content;
36803
36805
  try {
36804
- content = readFileSync31(resolved, "utf-8");
36806
+ content = readFileSync31(path, "utf-8");
36805
36807
  } catch {
36806
36808
  continue;
36807
36809
  }
@@ -36811,8 +36813,40 @@ var toSafeFileName6 = (specifier) => {
36811
36813
  } catch {
36812
36814
  continue;
36813
36815
  }
36816
+ const fromDir = dirname27(path);
36814
36817
  for (const imp of imports) {
36815
36818
  const child = imp.path;
36819
+ if (child.startsWith(".") || child.startsWith("/")) {
36820
+ let resolved;
36821
+ try {
36822
+ resolved = Bun.resolveSync(child, fromDir);
36823
+ } catch {
36824
+ continue;
36825
+ }
36826
+ if (!seenFiles.has(resolved)) {
36827
+ queue.push({ depth: depth + 1, path: resolved });
36828
+ }
36829
+ } else {
36830
+ bareOut.add(child);
36831
+ }
36832
+ }
36833
+ }
36834
+ return Array.from(bareOut);
36835
+ }, collectTransitiveImports = async (specs, alreadyVendored, alreadyScanned) => {
36836
+ const transpiler6 = new Bun.Transpiler({ loader: "js" });
36837
+ const newSpecs = new Set;
36838
+ for (const spec of specs) {
36839
+ if (alreadyScanned.has(spec))
36840
+ continue;
36841
+ alreadyScanned.add(spec);
36842
+ let resolved;
36843
+ try {
36844
+ resolved = Bun.resolveSync(spec, process.cwd());
36845
+ } catch {
36846
+ continue;
36847
+ }
36848
+ const bareImports = await collectBareImportsFromFile(resolved, transpiler6);
36849
+ for (const child of bareImports) {
36816
36850
  if (!isBareSpecifier2(child))
36817
36851
  continue;
36818
36852
  if (isFrameworkSpecifier(child))
@@ -46453,6 +46487,7 @@ export {
46453
46487
  UNFOUND_INDEX,
46454
46488
  TWO_THIRDS,
46455
46489
  TIME_PRECISION,
46490
+ TAILWIND_BUN_CSS_WARNING_PATTERN,
46456
46491
  SVELTE_CSS_LOAD_TIMEOUT_MS,
46457
46492
  SIGTERM_EXIT_CODE,
46458
46493
  SIGINT_EXIT_CODE,
@@ -46526,5 +46561,5 @@ export {
46526
46561
  ANGULAR_INIT_TIMEOUT_MS
46527
46562
  };
46528
46563
 
46529
- //# debugId=E401AF0DF6126F1C64756E2164756E21
46564
+ //# debugId=741893954B715E8C64756E2164756E21
46530
46565
  //# sourceMappingURL=index.js.map