@absolutejs/absolute 0.14.0 → 0.15.1
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/.claude/settings.local.json +11 -0
- package/CLAUDE.md +11 -2
- package/LICENSE +74 -18
- package/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +61 -0
- package/dist/cli/index.js +24 -8
- package/dist/dev/client/cssUtils.ts +288 -0
- package/dist/dev/client/domDiff.ts +261 -0
- package/dist/dev/client/domState.ts +271 -0
- package/dist/dev/client/errorOverlay.ts +145 -0
- package/dist/dev/client/frameworkDetect.ts +63 -0
- package/dist/dev/client/handlers/html.ts +415 -0
- package/dist/dev/client/handlers/htmx.ts +248 -0
- package/dist/dev/client/handlers/react.ts +80 -0
- package/dist/dev/client/handlers/rebuild.ts +147 -0
- package/dist/dev/client/handlers/svelte.ts +129 -0
- package/dist/dev/client/handlers/vue.ts +254 -0
- package/dist/dev/client/headPatch.ts +213 -0
- package/dist/dev/client/hmrClient.ts +204 -0
- package/dist/dev/client/moduleVersions.ts +57 -0
- package/dist/dev/client/reactRefreshSetup.ts +21 -0
- package/dist/index.js +3028 -478
- package/dist/index.js.map +49 -19
- package/dist/{build → src/build}/compileSvelte.d.ts +2 -1
- package/dist/src/build/compileVue.d.ts +33 -0
- package/dist/src/build/generateReactIndexes.d.ts +1 -0
- package/dist/src/build/htmlScriptHMRPlugin.d.ts +13 -0
- package/dist/src/build/wrapHTMLScript.d.ts +24 -0
- package/dist/{core → src/core}/build.d.ts +2 -2
- package/dist/src/core/devBuild.d.ts +6 -0
- package/dist/{core → src/core}/index.d.ts +2 -1
- package/dist/src/core/lookup.d.ts +3 -0
- package/dist/{core → src/core}/pageHandlers.d.ts +4 -4
- package/dist/src/dev/assetStore.d.ts +12 -0
- package/dist/src/dev/buildHMRClient.d.ts +1 -0
- package/dist/src/dev/clientManager.d.ts +26 -0
- package/dist/src/dev/configResolver.d.ts +13 -0
- package/dist/src/dev/dependencyGraph.d.ts +13 -0
- package/dist/src/dev/fileHashTracker.d.ts +2 -0
- package/dist/src/dev/fileWatcher.d.ts +3 -0
- package/dist/src/dev/moduleMapper.d.ts +21 -0
- package/dist/src/dev/moduleVersionTracker.d.ts +7 -0
- package/dist/src/dev/pathUtils.d.ts +5 -0
- package/dist/src/dev/reactComponentClassifier.d.ts +2 -0
- package/dist/src/dev/rebuildTrigger.d.ts +10 -0
- package/dist/src/dev/simpleHTMLHMR.d.ts +4 -0
- package/dist/src/dev/simpleHTMXHMR.d.ts +4 -0
- package/dist/src/dev/simpleSvelteHMR.d.ts +1 -0
- package/dist/src/dev/simpleVueHMR.d.ts +1 -0
- package/dist/src/dev/webSocket.d.ts +9 -0
- package/dist/{index.d.ts → src/index.d.ts} +1 -0
- package/dist/src/plugins/hmr.d.ts +62 -0
- package/dist/{plugins → src/plugins}/index.d.ts +2 -1
- package/dist/{svelte → src/svelte}/renderToReadableStream.d.ts +3 -1
- package/dist/src/utils/getRegisterClientScript.d.ts +10 -0
- package/dist/{utils → src/utils}/index.d.ts +2 -0
- package/dist/src/utils/logger.d.ts +45 -0
- package/dist/src/utils/networking.d.ts +2 -0
- package/dist/src/utils/normalizePath.d.ts +9 -0
- package/dist/src/utils/registerClientScript.d.ts +51 -0
- package/dist/{types.d.ts → types/build.d.ts} +6 -0
- package/dist/types/client.d.ts +104 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/messages.d.ts +138 -0
- package/dist/types/websocket.d.ts +6 -0
- package/eslint.config.mjs +5 -1
- package/package.json +19 -14
- package/tsconfig.build.json +1 -1
- package/types/build.ts +46 -0
- package/types/client.ts +109 -0
- package/types/index.ts +4 -0
- package/types/messages.ts +205 -0
- package/types/websocket.ts +12 -0
- package/types/window-globals.ts +53 -0
- package/dist/build/compileVue.d.ts +0 -5
- package/dist/build/generateReactIndexes.d.ts +0 -1
- package/dist/core/lookup.d.ts +0 -1
- package/dist/utils/networking.d.ts +0 -1
- /package/dist/{build → src/build}/generateManifest.d.ts +0 -0
- /package/dist/{build → src/build}/outputLogs.d.ts +0 -0
- /package/dist/{build → src/build}/scanEntryPoints.d.ts +0 -0
- /package/dist/{build → src/build}/updateAssetPaths.d.ts +0 -0
- /package/dist/{cli → src/cli}/index.d.ts +0 -0
- /package/dist/{constants.d.ts → src/constants.d.ts} +0 -0
- /package/dist/{plugins → src/plugins}/networking.d.ts +0 -0
- /package/dist/{plugins → src/plugins}/pageRouter.d.ts +0 -0
- /package/dist/{svelte → src/svelte}/renderToPipeableStream.d.ts +0 -0
- /package/dist/{svelte → src/svelte}/renderToString.d.ts +0 -0
- /package/dist/{utils → src/utils}/cleanup.d.ts +0 -0
- /package/dist/{utils → src/utils}/commonAncestor.d.ts +0 -0
- /package/dist/{utils → src/utils}/escapeScriptContent.d.ts +0 -0
- /package/dist/{utils → src/utils}/generateHeadElement.d.ts +0 -0
- /package/dist/{utils → src/utils}/getDurationString.d.ts +0 -0
- /package/dist/{utils → src/utils}/getEnv.d.ts +0 -0
- /package/dist/{utils → src/utils}/stringModifiers.d.ts +0 -0
- /package/dist/{utils → src/utils}/validateSafePath.d.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Module version validation and sync */
|
|
2
|
+
|
|
3
|
+
export const checkModuleVersions = (
|
|
4
|
+
serverVersions: Record<string, number> | undefined,
|
|
5
|
+
clientVersions: Record<string, number> | undefined
|
|
6
|
+
) => {
|
|
7
|
+
if (!serverVersions || !clientVersions) {
|
|
8
|
+
return { needsSync: false, stale: [] };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const stale: string[] = [];
|
|
12
|
+
let needsSync = false;
|
|
13
|
+
|
|
14
|
+
for (const [modulePath, serverVersion] of Object.entries(serverVersions)) {
|
|
15
|
+
const clientVersion = clientVersions[modulePath];
|
|
16
|
+
|
|
17
|
+
if (clientVersion === undefined || clientVersion < serverVersion) {
|
|
18
|
+
stale.push(modulePath);
|
|
19
|
+
needsSync = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return { needsSync, stale };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const prefetchModules = (
|
|
27
|
+
modulePaths: string[],
|
|
28
|
+
manifest: Record<string, string> | undefined
|
|
29
|
+
) => {
|
|
30
|
+
const prefetchPromises: Promise<unknown>[] = [];
|
|
31
|
+
|
|
32
|
+
for (const modulePath of modulePaths) {
|
|
33
|
+
let manifestPath = modulePath;
|
|
34
|
+
for (const key in manifest || {}) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(manifest, key)) {
|
|
36
|
+
const path = manifest![key]!;
|
|
37
|
+
if (path === modulePath || path.includes(modulePath)) {
|
|
38
|
+
manifestPath = path;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const cacheBuster = '?t=' + Date.now();
|
|
45
|
+
const fullPath = manifestPath.startsWith('/')
|
|
46
|
+
? manifestPath + cacheBuster
|
|
47
|
+
: '/' + manifestPath + cacheBuster;
|
|
48
|
+
|
|
49
|
+
prefetchPromises.push(
|
|
50
|
+
import(/* @vite-ignore */ fullPath).catch(function () {
|
|
51
|
+
/* ignore */
|
|
52
|
+
})
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return Promise.all(prefetchPromises);
|
|
57
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* React Refresh runtime setup — must be imported before any component modules.
|
|
2
|
+
Bun's reactFastRefresh flag injects $RefreshSig$/$RefreshReg$ calls into
|
|
3
|
+
component code. This module ensures those globals exist before components
|
|
4
|
+
initialize.
|
|
5
|
+
|
|
6
|
+
IMPORTANT: This module is idempotent. On HMR re-import the existing runtime
|
|
7
|
+
is preserved so new component registrations feed into the SAME RefreshRuntime
|
|
8
|
+
instance that owns the current React tree. */
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11
|
+
// @ts-ignore — react-refresh has no type declarations
|
|
12
|
+
import RefreshRuntime from 'react-refresh/runtime';
|
|
13
|
+
|
|
14
|
+
if (!window.$RefreshRuntime$) {
|
|
15
|
+
RefreshRuntime.injectIntoGlobalHook(window);
|
|
16
|
+
window.$RefreshRuntime$ = RefreshRuntime;
|
|
17
|
+
window.$RefreshReg$ = (type: unknown, id: string) =>
|
|
18
|
+
RefreshRuntime.register(type, id);
|
|
19
|
+
window.$RefreshSig$ = () =>
|
|
20
|
+
RefreshRuntime.createSignatureFunctionForTransform();
|
|
21
|
+
}
|