@absolutejs/absolute 0.20.0-beta.173 → 0.20.0-beta.175
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/CHANGELOG.md +30 -0
- package/changelog.json +71 -0
- package/dist/angular/browser.js +13 -2
- package/dist/angular/browser.js.map +3 -3
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/index.js +113 -34
- package/dist/angular/index.js.map +12 -9
- package/dist/angular/server.js +113 -34
- package/dist/angular/server.js.map +12 -9
- package/dist/build.js +946 -731
- package/dist/build.js.map +40 -37
- package/dist/cli/{add-ae6mg79m.js → add-ntg96znk.js} +32 -31
- package/dist/cli/{compile-ndc36zna.js → compile-w2z6c9vt.js} +16 -14
- package/dist/cli/config/server.js +85 -65
- package/dist/cli/{dev-x49583aj.js → dev-8br5mr7t.js} +17 -3
- package/dist/cli/{expoProject-h404n2r8.js → expoProject-1qtw97js.js} +2 -1
- package/dist/cli/{generate-brvjesd6.js → generate-5vyz1s44.js} +7 -6
- package/dist/cli/{htmx-5twhjz7p.js → htmx-26hs6jdm.js} +2 -1
- package/dist/cli/{index-gyjxrnnz.js → index-23hvdyxf.js} +18 -16
- package/dist/cli/index-4j1twret.js +22 -0
- package/dist/cli/{index-z794p5qg.js → index-6522t968.js} +43 -21
- package/dist/cli/{index-25e7k849.js → index-7z1hh3fg.js} +4 -4
- package/dist/cli/{index-s0r5q839.js → index-cksezef8.js} +10 -8
- package/dist/cli/{index-q3snnhyd.js → index-enbw9484.js} +34 -33
- package/dist/cli/{index-b1wht4q5.js → index-kes8he5s.js} +6 -4
- package/dist/cli/{index-vh68jb0e.js → index-pkw3jktb.js} +17 -16
- package/dist/cli/{index-rervww4p.js → index-zyd80s3h.js} +119 -119
- package/dist/cli/index.js +11 -11
- package/dist/cli/{islands-p4vgx7a2.js → islands-bx67g15t.js} +8 -7
- package/dist/cli/{mobile-nqdkk3gd.js → mobile-we5q51ey.js} +5 -4
- package/dist/cli/{remove-abaf0w6k.js → remove-4jh862qa.js} +6 -5
- package/dist/cli/{start-t3cq57wn.js → start-srs11bm8.js} +5 -4
- package/dist/cli/{typecheck-fag7djt5.js → typecheck-7fvww3b7.js} +28 -26
- package/dist/client/chunks/index-4j1snyh2.js +18 -0
- package/dist/client/chunks/index-4j1snyh2.js.map +10 -0
- package/dist/client/chunks/{index-6b66nzyf.js → index-a3rpg5kw.js} +6 -16
- package/dist/client/chunks/{index-6b66nzyf.js.map → index-a3rpg5kw.js.map} +3 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js → islands-mfjmdwnb.js} +11 -4
- package/dist/client/chunks/{islands-s2ta5ajb.js.map → islands-mfjmdwnb.js.map} +3 -3
- package/dist/client/chunks/{react-dcvkaba2.js → react-sprprqzs.js} +20 -4
- package/dist/client/chunks/react-sprprqzs.js.map +10 -0
- package/dist/client/chunks/svelte-6ewphsvj.js +30 -0
- package/dist/client/chunks/svelte-6ewphsvj.js.map +10 -0
- package/dist/client/chunks/{vue-a84fzp3v.js → vue-db6ppn1f.js} +14 -4
- package/dist/client/chunks/vue-db6ppn1f.js.map +10 -0
- package/dist/client/index.js +65 -8
- package/dist/client/index.js.map +4 -4
- package/dist/client/navigation.js +5 -3
- package/dist/client/navigation.js.map +2 -2
- package/dist/client/prefetch.js +1 -1
- package/dist/dev/client/handlers/islands.ts +85 -0
- package/dist/dev/client/hmrClient.ts +6 -0
- package/dist/dev/importCostReport.js +45 -26
- package/dist/index.js +1080 -852
- package/dist/index.js.map +41 -38
- package/dist/islands/index.js +57 -10
- package/dist/islands/index.js.map +9 -7
- package/dist/mobile/index.js +115 -95
- package/dist/mobile/index.js.map +6 -5
- package/dist/mobile/remoteMacAgentEntry.js +205 -651
- package/dist/react/browser.js +15 -4
- package/dist/react/browser.js.map +5 -5
- package/dist/react/components/client.js +506 -0
- package/dist/react/components/index.js +14 -15
- package/dist/react/components/index.js.map +4 -4
- package/dist/react/components/server/index.js +728 -0
- package/dist/react/hooks/index.js +14 -15
- package/dist/react/hooks/index.js.map +4 -4
- package/dist/react/index.js +66 -6
- package/dist/react/index.js.map +11 -9
- package/dist/react/router/browser.js +7 -8
- package/dist/react/router/browser.js.map +4 -4
- package/dist/react/router/index.js +7 -8
- package/dist/react/router/index.js.map +4 -4
- package/dist/react/server.js +14 -1
- package/dist/react/server.js.map +4 -4
- package/dist/src/build/buildReactServerComponents.d.ts +4 -0
- package/dist/src/build/islandEntries.d.ts +5 -0
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +3 -3
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +3 -3
- package/dist/src/client/hydrators/react.d.ts +7 -0
- package/dist/src/client/hydrators/svelte.d.ts +3 -0
- package/dist/src/client/hydrators/vue.d.ts +3 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +5 -0
- package/dist/src/core/islandServerGeneration.d.ts +3 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +2 -2
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +2 -2
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +40 -40
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +3 -3
- package/dist/src/react/components/client.d.ts +4 -0
- package/dist/src/react/components/server/index.d.ts +8 -0
- package/dist/src/react/serverComponents/constants.d.ts +2 -1
- package/dist/src/utils/lazyTypescript.d.ts +3 -0
- package/dist/svelte/index.js +66 -6
- package/dist/svelte/index.js.map +10 -8
- package/dist/svelte/server.js +38 -3
- package/dist/svelte/server.js.map +6 -5
- package/dist/types/build.d.ts +3 -2
- package/dist/types/globals.d.ts +15 -0
- package/dist/vue/browser.js +26 -16
- package/dist/vue/browser.js.map +5 -5
- package/dist/vue/index.js +65 -21
- package/dist/vue/index.js.map +10 -9
- package/package.json +1 -1
- package/dist/client/chunks/react-dcvkaba2.js.map +0 -10
- package/dist/client/chunks/svelte-4yfa5bxa.js +0 -17
- package/dist/client/chunks/svelte-4yfa5bxa.js.map +0 -10
- package/dist/client/chunks/vue-a84fzp3v.js.map +0 -10
package/dist/cli/index.js
CHANGED
|
@@ -54,7 +54,7 @@ if (command === "dev") {
|
|
|
54
54
|
}
|
|
55
55
|
const positionalArgs = stripNamedArgs("--config", "--android-device", "--ios-device").filter((arg) => arg !== "--no-mobile" && arg !== "--eager");
|
|
56
56
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
57
|
-
const { dev } = await import("./dev-
|
|
57
|
+
const { dev } = await import("./dev-8br5mr7t.js");
|
|
58
58
|
await dev(serverEntry, configPath, {
|
|
59
59
|
androidDevice,
|
|
60
60
|
eager: args.includes("--eager"),
|
|
@@ -70,7 +70,7 @@ if (command === "dev") {
|
|
|
70
70
|
const configPath = parseNamedArg("--config");
|
|
71
71
|
const positionalArgs = stripNamedArgs("--outdir", "--config").filter((arg) => arg !== "--prebuilt");
|
|
72
72
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
73
|
-
const { start } = await import("./start-
|
|
73
|
+
const { start } = await import("./start-srs11bm8.js");
|
|
74
74
|
await start(serverEntry, outdir, configPath, {
|
|
75
75
|
prebuilt: args.includes("--prebuilt")
|
|
76
76
|
});
|
|
@@ -80,7 +80,7 @@ if (command === "dev") {
|
|
|
80
80
|
const configPath = parseNamedArg("--config");
|
|
81
81
|
const positionalArgs = stripNamedArgs("--outdir", "--config");
|
|
82
82
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
83
|
-
const { start } = await import("./start-
|
|
83
|
+
const { start } = await import("./start-srs11bm8.js");
|
|
84
84
|
await start(serverEntry, outdir, configPath, { prepareOnly: true });
|
|
85
85
|
} else if (command === "build") {
|
|
86
86
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -133,11 +133,11 @@ if (command === "dev") {
|
|
|
133
133
|
await runMem(args);
|
|
134
134
|
} else if (command === "generate" || command === "g") {
|
|
135
135
|
sendTelemetryEvent("cli:command", { command: "generate" });
|
|
136
|
-
const { runGenerate } = await import("./generate-
|
|
136
|
+
const { runGenerate } = await import("./generate-5vyz1s44.js");
|
|
137
137
|
await runGenerate(args);
|
|
138
138
|
} else if (command === "add") {
|
|
139
139
|
sendTelemetryEvent("cli:command", { command: "add" });
|
|
140
|
-
const { runAdd } = await import("./add-
|
|
140
|
+
const { runAdd } = await import("./add-ntg96znk.js");
|
|
141
141
|
await runAdd(args);
|
|
142
142
|
} else if (command === "analyze") {
|
|
143
143
|
sendTelemetryEvent("cli:command", { command: "analyze" });
|
|
@@ -149,11 +149,11 @@ if (command === "dev") {
|
|
|
149
149
|
await runApi(args);
|
|
150
150
|
} else if (command === "remove") {
|
|
151
151
|
sendTelemetryEvent("cli:command", { command: "remove" });
|
|
152
|
-
const { runRemove } = await import("./remove-
|
|
152
|
+
const { runRemove } = await import("./remove-4jh862qa.js");
|
|
153
153
|
await runRemove(args);
|
|
154
154
|
} else if (command === "htmx") {
|
|
155
155
|
sendTelemetryEvent("cli:command", { command: "htmx" });
|
|
156
|
-
const { runHtmx } = await import("./htmx-
|
|
156
|
+
const { runHtmx } = await import("./htmx-26hs6jdm.js");
|
|
157
157
|
await runHtmx(args);
|
|
158
158
|
} else if (command === "env") {
|
|
159
159
|
sendTelemetryEvent("cli:command", { command: "env" });
|
|
@@ -188,7 +188,7 @@ if (command === "dev") {
|
|
|
188
188
|
await runInspect(args);
|
|
189
189
|
} else if (command === "islands") {
|
|
190
190
|
sendTelemetryEvent("cli:command", { command: "islands" });
|
|
191
|
-
const { runIslands } = await import("./islands-
|
|
191
|
+
const { runIslands } = await import("./islands-bx67g15t.js");
|
|
192
192
|
await runIslands(args);
|
|
193
193
|
} else if (command === "info") {
|
|
194
194
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -205,13 +205,13 @@ if (command === "dev") {
|
|
|
205
205
|
const configPath = parseNamedArg("--config");
|
|
206
206
|
const positionalArgs = stripNamedArgs("--outdir", "--outfile", "--config");
|
|
207
207
|
const serverEntry = positionalArgs[0] ?? DEFAULT_SERVER_ENTRY;
|
|
208
|
-
const { compile } = await import("./compile-
|
|
208
|
+
const { compile } = await import("./compile-w2z6c9vt.js");
|
|
209
209
|
await compile(serverEntry, outdir, outfile, configPath);
|
|
210
210
|
} else if (command === "mobile") {
|
|
211
211
|
sendTelemetryEvent("cli:command", {
|
|
212
212
|
command: `mobile:${workspaceCommand ?? "unknown"}`
|
|
213
213
|
});
|
|
214
|
-
const { runMobile } = await import("./mobile-
|
|
214
|
+
const { runMobile } = await import("./mobile-we5q51ey.js");
|
|
215
215
|
try {
|
|
216
216
|
await runMobile(args);
|
|
217
217
|
} catch (error) {
|
|
@@ -221,7 +221,7 @@ if (command === "dev") {
|
|
|
221
221
|
} else if (command === "typecheck") {
|
|
222
222
|
sendTelemetryEvent("cli:command", { command });
|
|
223
223
|
const configPath = parseNamedArg("--config");
|
|
224
|
-
const { typecheck } = await import("./typecheck-
|
|
224
|
+
const { typecheck } = await import("./typecheck-7fvww3b7.js");
|
|
225
225
|
await typecheck(configPath);
|
|
226
226
|
} else if (command === "migrate") {
|
|
227
227
|
sendTelemetryEvent("cli:command", { command });
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import
|
|
3
|
-
getIslandManifestKey,
|
|
4
|
-
loadIslandRegistryBuildInfo
|
|
5
|
-
} from "./index-z794p5qg.js";
|
|
2
|
+
import"./index-4j1twret.js";
|
|
6
3
|
import {
|
|
7
4
|
loadConfig
|
|
8
5
|
} from "./index-wk0pyxrg.js";
|
|
@@ -14,6 +11,11 @@ import {
|
|
|
14
11
|
import {
|
|
15
12
|
formatBytes
|
|
16
13
|
} from "./index-7854xf0m.js";
|
|
14
|
+
import {
|
|
15
|
+
getIslandManifestKey,
|
|
16
|
+
resolveIslandSourceFile,
|
|
17
|
+
loadIslandRegistryBuildInfo
|
|
18
|
+
} from "./index-6522t968.js";
|
|
17
19
|
|
|
18
20
|
// src/cli/scripts/islands.ts
|
|
19
21
|
import { existsSync as existsSync2, readFileSync as readFileSync2, statSync } from "fs";
|
|
@@ -21,7 +23,7 @@ import { join, relative, resolve as resolve2 } from "path";
|
|
|
21
23
|
|
|
22
24
|
// src/islands/pageMetadata.ts
|
|
23
25
|
import { readFileSync } from "fs";
|
|
24
|
-
import {
|
|
26
|
+
import { resolve } from "path";
|
|
25
27
|
|
|
26
28
|
// src/build/scanEntryPoints.ts
|
|
27
29
|
import { existsSync } from "fs";
|
|
@@ -141,8 +143,7 @@ var buildIslandSourceLookup = async (config) => {
|
|
|
141
143
|
const source = definition.buildReference?.source;
|
|
142
144
|
if (!source)
|
|
143
145
|
continue;
|
|
144
|
-
|
|
145
|
-
lookup.set(`${definition.framework}:${definition.component}`, resolve(resolvedSource));
|
|
146
|
+
lookup.set(`${definition.framework}:${definition.component}`, resolve(resolveIslandSourceFile(buildInfo.resolvedRegistryPath, source)));
|
|
146
147
|
}
|
|
147
148
|
return lookup;
|
|
148
149
|
};
|
|
@@ -26,11 +26,12 @@ import {
|
|
|
26
26
|
renderAbsoluteMobileBrandingPreview,
|
|
27
27
|
writeAbsoluteExpoProject2,
|
|
28
28
|
syncAbsoluteExpoWebAssets2
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-cksezef8.js";
|
|
30
30
|
import {
|
|
31
31
|
projectUsesAbsoluteAuth2,
|
|
32
32
|
projectUsesAbsoluteSync2
|
|
33
33
|
} from "./index-pch0v1z6.js";
|
|
34
|
+
import"./index-4j1twret.js";
|
|
34
35
|
import {
|
|
35
36
|
normalizeAbsoluteMobileConfig2
|
|
36
37
|
} from "./index-t7yf3vxs.js";
|
|
@@ -62,7 +63,7 @@ import {
|
|
|
62
63
|
resolveAbsoluteMobileRoute,
|
|
63
64
|
ABSOLUTE_MOBILE_PAGE_PROTOCOL_VERSION,
|
|
64
65
|
ABSOLUTE_MOBILE_CLIENT_MANIFEST_FORMAT
|
|
65
|
-
} from "./index-
|
|
66
|
+
} from "./index-zyd80s3h.js";
|
|
66
67
|
import {
|
|
67
68
|
buildAbsoluteExpoAndroidWslBundle2
|
|
68
69
|
} from "./index-3sfcmb49.js";
|
|
@@ -76,10 +77,9 @@ import {
|
|
|
76
77
|
parseIosSimulators2,
|
|
77
78
|
repairAbsoluteIosDevSession2
|
|
78
79
|
} from "./index-prza6tkp.js";
|
|
79
|
-
import"./index-z794p5qg.js";
|
|
80
80
|
import {
|
|
81
81
|
start2
|
|
82
|
-
} from "./index-
|
|
82
|
+
} from "./index-7z1hh3fg.js";
|
|
83
83
|
import {
|
|
84
84
|
captureAbsoluteRemoteMacCommand2,
|
|
85
85
|
getAbsoluteRemoteMacProfile2,
|
|
@@ -99,6 +99,7 @@ import {
|
|
|
99
99
|
import {
|
|
100
100
|
formatBytes
|
|
101
101
|
} from "./index-7854xf0m.js";
|
|
102
|
+
import"./index-6522t968.js";
|
|
102
103
|
import {
|
|
103
104
|
sendTelemetryEvent
|
|
104
105
|
} from "./index-qyxd5n9a.js";
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import"./index-4j1twret.js";
|
|
2
3
|
import {
|
|
3
4
|
isFrameworkKey,
|
|
4
5
|
frameworks,
|
|
5
6
|
resolveProject
|
|
6
|
-
} from "./index-
|
|
7
|
-
import {
|
|
8
|
-
applyAbsoluteConfigEdit
|
|
9
|
-
} from "./index-b1wht4q5.js";
|
|
7
|
+
} from "./index-enbw9484.js";
|
|
10
8
|
import"./index-wk0pyxrg.js";
|
|
11
9
|
import"./index-t8jmj8w1.js";
|
|
12
10
|
import {
|
|
13
11
|
findRoutingFile
|
|
14
|
-
} from "./index-
|
|
12
|
+
} from "./index-23hvdyxf.js";
|
|
15
13
|
import {
|
|
16
14
|
colors
|
|
17
15
|
} from "./index-9djrap79.js";
|
|
16
|
+
import {
|
|
17
|
+
applyAbsoluteConfigEdit
|
|
18
|
+
} from "./index-kes8he5s.js";
|
|
18
19
|
import {
|
|
19
20
|
frameworkDependencyNames
|
|
20
21
|
} from "./index-jjfbjv1z.js";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
start2
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-7z1hh3fg.js";
|
|
5
|
+
import"./index-zyd80s3h.js";
|
|
6
|
+
import"./index-6522t968.js";
|
|
7
7
|
import"./index-71gchbzt.js";
|
|
8
8
|
import"./index-wk0pyxrg.js";
|
|
9
9
|
import"./index-qyxd5n9a.js";
|
|
10
10
|
import"./index-43a1vvb7.js";
|
|
11
11
|
import"./index-t7yf3vxs.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-cksezef8.js";
|
|
13
|
+
import"./index-4j1twret.js";
|
|
13
14
|
import"./index-pch0v1z6.js";
|
|
14
15
|
import"./index-125cfzvn.js";
|
|
15
16
|
import"./index-3ewt17wm.js";
|
|
@@ -5,6 +5,9 @@ import {
|
|
|
5
5
|
loadConfig,
|
|
6
6
|
loadRawConfig
|
|
7
7
|
} from "./index-wk0pyxrg.js";
|
|
8
|
+
import {
|
|
9
|
+
lazyTypescript
|
|
10
|
+
} from "./index-4j1twret.js";
|
|
8
11
|
import {
|
|
9
12
|
ANSI_ESCAPE_CODE
|
|
10
13
|
} from "./index-t8jmj8w1.js";
|
|
@@ -831,24 +834,23 @@ var ParseErrorCode;
|
|
|
831
834
|
})(ParseErrorCode || (ParseErrorCode = {}));
|
|
832
835
|
|
|
833
836
|
// src/dev/importCost/deferability.ts
|
|
834
|
-
import ts from "typescript";
|
|
835
837
|
var DEFERRED = "deferred";
|
|
836
838
|
var scriptKindFor = (fileName) => {
|
|
837
839
|
if (fileName.endsWith(".tsx"))
|
|
838
|
-
return
|
|
840
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
839
841
|
if (fileName.endsWith(".jsx"))
|
|
840
|
-
return
|
|
842
|
+
return lazyTypescript.ScriptKind.JSX;
|
|
841
843
|
if (fileName.endsWith(".js") || fileName.endsWith(".mjs")) {
|
|
842
|
-
return
|
|
844
|
+
return lazyTypescript.ScriptKind.JS;
|
|
843
845
|
}
|
|
844
|
-
return
|
|
846
|
+
return lazyTypescript.ScriptKind.TS;
|
|
845
847
|
};
|
|
846
848
|
var namedBindings = (clause) => {
|
|
847
849
|
const names = clause.name === undefined ? [] : [clause.name.text];
|
|
848
850
|
const { namedBindings: bindings } = clause;
|
|
849
851
|
if (bindings === undefined)
|
|
850
852
|
return names;
|
|
851
|
-
if (
|
|
853
|
+
if (lazyTypescript.isNamespaceImport(bindings))
|
|
852
854
|
return [...names, bindings.name.text];
|
|
853
855
|
return [
|
|
854
856
|
...names,
|
|
@@ -857,20 +859,20 @@ var namedBindings = (clause) => {
|
|
|
857
859
|
};
|
|
858
860
|
var declarationFrom = (statement, source) => {
|
|
859
861
|
const specifier = statement.moduleSpecifier;
|
|
860
|
-
if (!
|
|
862
|
+
if (!lazyTypescript.isStringLiteral(specifier))
|
|
861
863
|
return null;
|
|
862
864
|
const clause = statement.importClause;
|
|
863
865
|
const bindings = clause === undefined ? [] : namedBindings(clause);
|
|
864
866
|
const declaration = {
|
|
865
867
|
bindings,
|
|
866
|
-
line:
|
|
868
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
867
869
|
sideEffect: clause === undefined,
|
|
868
870
|
specifier: specifier.text,
|
|
869
871
|
typeOnly: clause !== undefined && (clause.isTypeOnly || bindings.length === 0)
|
|
870
872
|
};
|
|
871
873
|
return declaration;
|
|
872
874
|
};
|
|
873
|
-
var isTypePosition = (node) =>
|
|
875
|
+
var isTypePosition = (node) => lazyTypescript.isTypeNode(node) && !lazyTypescript.isExpressionWithTypeArguments(node);
|
|
874
876
|
var isDeferredPosition = (current, child) => {
|
|
875
877
|
if (Reflect.get(current, "body") === child)
|
|
876
878
|
return true;
|
|
@@ -878,19 +880,19 @@ var isDeferredPosition = (current, child) => {
|
|
|
878
880
|
return Array.isArray(parameters) && parameters.some((parameter) => parameter === child);
|
|
879
881
|
};
|
|
880
882
|
var classifyAncestor = (current, child) => {
|
|
881
|
-
if (
|
|
883
|
+
if (lazyTypescript.isExportSpecifier(current))
|
|
882
884
|
return "re-exported by the entry";
|
|
883
|
-
if (
|
|
885
|
+
if (lazyTypescript.isDecorator(current))
|
|
884
886
|
return "decorator";
|
|
885
|
-
if (
|
|
887
|
+
if (lazyTypescript.isPropertyDeclaration(current) && current.initializer === child) {
|
|
886
888
|
return "class field initializer";
|
|
887
889
|
}
|
|
888
890
|
if (isTypePosition(current))
|
|
889
891
|
return DEFERRED;
|
|
890
|
-
if (
|
|
892
|
+
if (lazyTypescript.isFunctionLike(current) && isDeferredPosition(current, child)) {
|
|
891
893
|
return DEFERRED;
|
|
892
894
|
}
|
|
893
|
-
if (
|
|
895
|
+
if (lazyTypescript.isSourceFile(current))
|
|
894
896
|
return "module scope";
|
|
895
897
|
return null;
|
|
896
898
|
};
|
|
@@ -910,9 +912,9 @@ var classifyUsage = (node) => {
|
|
|
910
912
|
return pending ?? "module scope";
|
|
911
913
|
};
|
|
912
914
|
var isDeclarationName = (parent, node) => {
|
|
913
|
-
if (
|
|
915
|
+
if (lazyTypescript.isExportSpecifier(parent))
|
|
914
916
|
return false;
|
|
915
|
-
if (
|
|
917
|
+
if (lazyTypescript.isShorthandPropertyAssignment(parent))
|
|
916
918
|
return false;
|
|
917
919
|
return Reflect.get(parent, "name") === node;
|
|
918
920
|
};
|
|
@@ -920,7 +922,7 @@ var isReferencePosition = (node) => {
|
|
|
920
922
|
const { parent } = node;
|
|
921
923
|
if (parent === undefined)
|
|
922
924
|
return false;
|
|
923
|
-
if (
|
|
925
|
+
if (lazyTypescript.isQualifiedName(parent) && parent.right === node)
|
|
924
926
|
return false;
|
|
925
927
|
return !isDeclarationName(parent, node);
|
|
926
928
|
};
|
|
@@ -937,13 +939,13 @@ var recordUsage = (node, owners, reasons) => {
|
|
|
937
939
|
var collectUnsafeReasons = (source, owners) => {
|
|
938
940
|
const reasons = new Map;
|
|
939
941
|
const visit = (node) => {
|
|
940
|
-
if (
|
|
942
|
+
if (lazyTypescript.isImportDeclaration(node))
|
|
941
943
|
return;
|
|
942
|
-
if (
|
|
944
|
+
if (lazyTypescript.isIdentifier(node))
|
|
943
945
|
recordUsage(node, owners, reasons);
|
|
944
|
-
|
|
946
|
+
lazyTypescript.forEachChild(node, visit);
|
|
945
947
|
};
|
|
946
|
-
|
|
948
|
+
lazyTypescript.forEachChild(source, visit);
|
|
947
949
|
return reasons;
|
|
948
950
|
};
|
|
949
951
|
var verdictFor = (declaration, reason) => {
|
|
@@ -957,12 +959,12 @@ var verdictFor = (declaration, reason) => {
|
|
|
957
959
|
};
|
|
958
960
|
var reExportOf = (statement, source) => {
|
|
959
961
|
const specifier = statement.moduleSpecifier;
|
|
960
|
-
if (specifier === undefined || !
|
|
962
|
+
if (specifier === undefined || !lazyTypescript.isStringLiteral(specifier))
|
|
961
963
|
return null;
|
|
962
964
|
if (statement.isTypeOnly)
|
|
963
965
|
return null;
|
|
964
966
|
const entry = {
|
|
965
|
-
line:
|
|
967
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
966
968
|
reason: "re-exported by the entry",
|
|
967
969
|
specifier: specifier.text,
|
|
968
970
|
verdict: "used at module scope"
|
|
@@ -970,9 +972,9 @@ var reExportOf = (statement, source) => {
|
|
|
970
972
|
return entry;
|
|
971
973
|
};
|
|
972
974
|
var analyzeEntryImports = (sourceText, fileName) => {
|
|
973
|
-
const source =
|
|
974
|
-
const declarations = source.statements.filter(
|
|
975
|
-
const reExports = source.statements.filter(
|
|
975
|
+
const source = lazyTypescript.createSourceFile(fileName, sourceText, lazyTypescript.ScriptTarget.ESNext, true, scriptKindFor(fileName));
|
|
976
|
+
const declarations = source.statements.filter(lazyTypescript.isImportDeclaration).map((statement) => declarationFrom(statement, source)).filter((declaration) => declaration !== null);
|
|
977
|
+
const reExports = source.statements.filter(lazyTypescript.isExportDeclaration).map((statement) => reExportOf(statement, source)).filter((entry) => entry !== null);
|
|
976
978
|
const owners = new Map;
|
|
977
979
|
declarations.forEach((declaration, index) => {
|
|
978
980
|
for (const binding of declaration.bindings)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/dev/client/cspNonce.ts
|
|
2
|
+
var applyPageNonce = (element) => {
|
|
3
|
+
const nonce = readPageNonce();
|
|
4
|
+
if (nonce)
|
|
5
|
+
element.nonce = nonce;
|
|
6
|
+
return element;
|
|
7
|
+
};
|
|
8
|
+
var readPageNonce = () => {
|
|
9
|
+
if (typeof document === "undefined")
|
|
10
|
+
return;
|
|
11
|
+
const carrier = document.querySelector("script[nonce], style[nonce]");
|
|
12
|
+
return carrier?.nonce || undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { applyPageNonce, readPageNonce };
|
|
16
|
+
|
|
17
|
+
//# debugId=EF4FD25E95EDA90564756E2164756E21
|
|
18
|
+
//# sourceMappingURL=index-4j1snyh2.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/dev/client/cspNonce.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/* The page's CSP nonce, read back in the browser from an element the server\n * gave it to. Browsers hide the attribute's value but keep the `nonce`\n * property, so a script that runs can hand the nonce to the <style>/<script>\n * elements it creates; a nonce-based policy blocks them otherwise. Without\n * secureHeaders() there is no nonce and this does nothing.\n *\n * Lives in the dev client because that ships as raw TypeScript and may only\n * import from its own directory; the bundled client runtime\n * (src/client/prefetch.ts) imports it from here. */\n\nexport const applyPageNonce = <Element extends HTMLElement>(\n\telement: Element\n) => {\n\tconst nonce = readPageNonce();\n\tif (nonce) element.nonce = nonce;\n\n\treturn element;\n};\n\nexport const readPageNonce = () => {\n\tif (typeof document === 'undefined') return undefined;\n\tconst carrier = document.querySelector<HTMLElement>(\n\t\t'script[nonce], style[nonce]'\n\t);\n\n\treturn carrier?.nonce || undefined;\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";AAUO,IAAM,iBAAiB,CAC7B,YACI;AAAA,EACJ,MAAM,QAAQ,cAAc;AAAA,EAC5B,IAAI;AAAA,IAAO,QAAQ,QAAQ;AAAA,EAE3B,OAAO;AAAA;AAGD,IAAM,gBAAgB,MAAM;AAAA,EAClC,IAAI,OAAO,aAAa;AAAA,IAAa;AAAA,EACrC,MAAM,UAAU,SAAS,cACxB,6BACD;AAAA,EAEA,OAAO,SAAS,SAAS;AAAA;",
|
|
8
|
+
"debugId": "EF4FD25E95EDA90564756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
if (nonce)
|
|
5
|
-
element.nonce = nonce;
|
|
6
|
-
return element;
|
|
7
|
-
};
|
|
8
|
-
var readPageNonce = () => {
|
|
9
|
-
if (typeof document === "undefined")
|
|
10
|
-
return;
|
|
11
|
-
const carrier = document.querySelector("script[nonce], style[nonce]");
|
|
12
|
-
return carrier?.nonce || undefined;
|
|
13
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
applyPageNonce
|
|
3
|
+
} from "./index-4j1snyh2.js";
|
|
14
4
|
|
|
15
5
|
// src/client/prefetch.ts
|
|
16
6
|
var PREFETCH_CACHE_LIMIT = 16;
|
|
@@ -375,7 +365,7 @@ var resetPrefetchState2 = () => {
|
|
|
375
365
|
viewportObserver = null;
|
|
376
366
|
};
|
|
377
367
|
|
|
378
|
-
export {
|
|
368
|
+
export { ROUTE_DATA_MEDIA_TYPE2, canPrefetch2, isDevelopmentClient2, isPrefetchableHref2, resolveDefaultPrefetchMode2, clearPrefetchCache2, consumePrefetch2, hasPrefetched2, prefetchStylesheet2, preloadModule2, prefetch2, speculate2, scheduleHoverPrefetch2, observeViewport2, resetPrefetchState2 };
|
|
379
369
|
|
|
380
|
-
//# debugId=
|
|
381
|
-
//# sourceMappingURL=index-
|
|
370
|
+
//# debugId=23E0D01680231D5664756E2164756E21
|
|
371
|
+
//# sourceMappingURL=index-a3rpg5kw.js.map
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
3
|
+
"sources": ["../src/client/prefetch.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"/* The page's CSP nonce, read back in the browser from an element the server\n * gave it to. Browsers hide the attribute's value but keep the `nonce`\n * property, so a script that runs can hand the nonce to the <style>/<script>\n * elements it creates; a nonce-based policy blocks them otherwise. Without\n * secureHeaders() there is no nonce and this does nothing.\n *\n * Lives in the dev client because that ships as raw TypeScript and may only\n * import from its own directory; the bundled client runtime\n * (src/client/prefetch.ts) imports it from here. */\n\nexport const applyPageNonce = <Element extends HTMLElement>(\n\telement: Element\n) => {\n\tconst nonce = readPageNonce();\n\tif (nonce) element.nonce = nonce;\n\n\treturn element;\n};\n\nexport const readPageNonce = () => {\n\tif (typeof document === 'undefined') return undefined;\n\tconst carrier = document.querySelector<HTMLElement>(\n\t\t'script[nonce], style[nonce]'\n\t);\n\n\treturn carrier?.nonce || undefined;\n};\n",
|
|
6
5
|
"/**\n * Framework-neutral navigation prefetch primitive.\n *\n * Pure DOM + `fetch` — no framework imports — so the React, Vue and Svelte\n * `<Link>` components (and user code) share one cache, one in-flight\n * budget, one IntersectionObserver and one set of data-saver guards.\n *\n * import { prefetch, speculate } from '@absolutejs/absolute/client/prefetch';\n *\n * What a prefetch buys the click that follows:\n * - `'document'` — the HTML lands in the browser's HTTP cache (pages\n * carry a content-hash `ETag`), so the real navigation revalidates\n * with a 304 instead of re-rendering.\n * - `'module'` — `<link rel=\"modulepreload\">` parses + compiles the\n * client module graph ahead of time.\n * - `'data'` — the route-data payload\n * (`application/vnd.absolute.route+json`): the page's props plus the\n * client entry and stylesheets it needs, which are `modulepreload`ed\n * / prefetched as the payload lands. A 404 / 406 from a server that\n * doesn't speak route data is remembered as \"no data\".\n * - `'route'` — `'document'` + `'data'`, i.e. everything a click\n * needs. What a `<Link>` warms on hover / pointerdown.\n * - `speculate()` — a prerender speculation rule; the browser renders\n * the whole target page in a hidden tab so the click is instant.\n *\n * Global opt-out: `window.__ABSOLUTE_PREFETCH__ = false` disables every\n * entry point in this module (useful for analytics-sensitive pages).\n */\nimport { applyPageNonce } from '../dev/client/cspNonce';\nimport type {\n\tHoverPrefetchHandle,\n\tHoverPrefetchOptions,\n\tPrefetchKind,\n\tPrefetchOptions,\n\tViewportPrefetchOptions\n} from '../../types/prefetch';\n\nconst PREFETCH_CACHE_LIMIT = 16;\nconst HOVER_DEBOUNCE_MS = 250;\nconst MAX_IN_FLIGHT = 2;\nconst MAX_LIVE_SPECULATION_RULES = 2;\nconst VIEWPORT_ROOT_MARGIN = '128px';\nconst SLOW_EFFECTIVE_TYPES = new Set(['slow-2g', '2g']);\nconst NOT_FOUND = 404;\nconst NOT_ACCEPTABLE = 406;\n\nexport const ROUTE_DATA_MEDIA_TYPE = 'application/vnd.absolute.route+json';\n\ntype CacheEntry = {\n\tabort: () => void;\n\tkind: PrefetchKind;\n\tpromise: Promise<Response>;\n\turl: string;\n};\n\ntype QueuedTask = {\n\tcancelled: boolean;\n\tstart: () => void;\n};\n\nconst cache = new Map<string, CacheEntry>();\nconst queue: QueuedTask[] = [];\nlet inFlight = 0;\n\nconst preloadedModules = new Set<string>();\nconst prefetchedStyles = new Set<string>();\nconst liveSpeculationRules = new Map<string, HTMLScriptElement>();\n\nconst offlineResponse = () => new Response(null, { status: 0 });\n\n/** `'route'` is a compound trigger, not a cache entry of its own: it\n * warms the `'document'` and `'data'` entries, so lookups for it read\n * the document it warmed. */\nconst storageKind = (kind: PrefetchKind) =>\n\tkind === 'route' ? 'document' : kind;\n\nconst cacheKey = (kind: PrefetchKind, url: string) =>\n\t`${storageKind(kind)}:${url}`;\n\nconst resolveHref = (url: string) => {\n\tif (typeof window === 'undefined') return url;\n\n\ttry {\n\t\treturn new URL(url, window.location.href).href;\n\t} catch {\n\t\treturn url;\n\t}\n};\n\n/* ------------------------------------------------------------------ */\n/* Guards */\n/* ------------------------------------------------------------------ */\n\nconst isGloballyDisabled = () =>\n\ttypeof window !== 'undefined' &&\n\tReflect.get(window, '__ABSOLUTE_PREFETCH__') === false;\n\nconst isSlowConnection = () => {\n\tif (typeof navigator === 'undefined') return false;\n\n\tconst connection = Reflect.get(navigator, 'connection');\n\tif (typeof connection !== 'object' || connection === null) return false;\n\tif (Reflect.get(connection, 'saveData') === true) return true;\n\n\tconst effectiveType = Reflect.get(connection, 'effectiveType');\n\n\treturn (\n\t\ttypeof effectiveType === 'string' &&\n\t\tSLOW_EFFECTIVE_TYPES.has(effectiveType)\n\t);\n};\n\nconst prefersReducedData = () => {\n\tif (typeof window === 'undefined' || !window.matchMedia) return false;\n\n\treturn window.matchMedia('(prefers-reduced-data: reduce)').matches;\n};\n\n/** `true` when prefetching is allowed right now: we're in a browser, the\n * page hasn't opted out via `window.__ABSOLUTE_PREFETCH__ = false`, and\n * the user hasn't asked for less data (Save-Data, 2g, reduced-data). */\nexport const canPrefetch = () =>\n\ttypeof window !== 'undefined' &&\n\t!isGloballyDisabled() &&\n\t!isSlowConnection() &&\n\t!prefersReducedData();\n\nconst readNodeEnv = () => {\n\t// Deliberately not the bare `process.env.NODE_ENV` member expression:\n\t// bundlers substitute that at build time, which would bake this\n\t// package's own build environment into the shipped client entry. In a\n\t// browser `process` is undefined and this yields `undefined`.\n\tconst processLike = Reflect.get(globalThis, 'process');\n\tif (typeof processLike !== 'object' || processLike === null) {\n\t\treturn undefined;\n\t}\n\tconst env = Reflect.get(processLike, 'env');\n\tif (typeof env !== 'object' || env === null) return undefined;\n\tconst value = Reflect.get(env, 'NODE_ENV');\n\n\treturn typeof value === 'string' ? value : undefined;\n};\n\n/** Whether the page was served by the AbsoluteJS dev server. The HMR\n * client is only injected in dev, so its markers are the reliable\n * signal; `NODE_ENV` is the fallback for environments that bundle\n * without the dev server (tests, custom hosts). */\nexport const isDevelopmentClient = () => {\n\tif (typeof window === 'undefined') return false;\n\tif (Reflect.get(window, '__HMR_FRAMEWORK__') !== undefined) return true;\n\tif (Reflect.get(window, '__HMR_WS__') !== undefined) return true;\n\tif (\n\t\ttypeof document !== 'undefined' &&\n\t\tdocument.querySelector('script[data-hmr-client]') !== null\n\t) {\n\t\treturn true;\n\t}\n\n\treturn readNodeEnv() === 'development';\n};\n\n/** Same-origin, non-hash, http(s) URL — the only kind worth prefetching. */\nexport const isPrefetchableHref = (href: string) => {\n\tif (typeof window === 'undefined') return false;\n\tif (href === '' || href.startsWith('#')) return false;\n\n\ttry {\n\t\tconst url = new URL(href, window.location.href);\n\t\tif (url.protocol !== 'http:' && url.protocol !== 'https:') return false;\n\n\t\treturn url.origin === window.location.origin;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\n/** Production → `'viewport'` (viewport + hover). Development → `'hover'`\n * only, so a page full of links doesn't fan out into the dev server. */\nexport const resolveDefaultPrefetchMode = () =>\n\tisDevelopmentClient() ? 'hover' : 'viewport';\n\n/* ------------------------------------------------------------------ */\n/* In-flight budget */\n/* ------------------------------------------------------------------ */\n\nconst runQueue = () => {\n\twhile (inFlight < MAX_IN_FLIGHT) {\n\t\tconst next = queue.shift();\n\t\tif (!next) return;\n\t\tif (next.cancelled) continue;\n\t\tnext.start();\n\t}\n};\n\nconst finishTask = () => {\n\tinFlight = Math.max(0, inFlight - 1);\n\trunQueue();\n};\n\n/** Run `task` when one of the `MAX_IN_FLIGHT` slots frees up. The\n * returned promise never rejects — network failures resolve to a\n * status-0 response so consumers can treat \"no prefetch\" uniformly. */\nconst runWhenReleased = async (\n\tgate: Promise<void>,\n\ttask: (signal: AbortSignal) => Promise<Response>,\n\tsignal: AbortSignal\n) => {\n\tawait gate;\n\ttry {\n\t\treturn await task(signal);\n\t} catch {\n\t\treturn offlineResponse();\n\t} finally {\n\t\tfinishTask();\n\t}\n};\n\nconst enqueue = (task: (signal: AbortSignal) => Promise<Response>) => {\n\tconst controller = new AbortController();\n\tlet release: () => void = () => undefined;\n\tconst gate = new Promise<void>((resolve) => {\n\t\trelease = resolve;\n\t});\n\tconst queued: QueuedTask = {\n\t\tcancelled: false,\n\t\tstart: () => {\n\t\t\t// Count the slot synchronously so `runQueue` can't overshoot the\n\t\t\t// budget while the async runner is still waiting on the gate.\n\t\t\tinFlight += 1;\n\t\t\trelease();\n\t\t}\n\t};\n\tconst promise = runWhenReleased(gate, task, controller.signal);\n\tqueue.push(queued);\n\trunQueue();\n\n\tconst abort = () => {\n\t\tif (queued.cancelled) return;\n\t\tqueued.cancelled = true;\n\t\tcontroller.abort();\n\t};\n\n\treturn { abort, promise };\n};\n\n/* ------------------------------------------------------------------ */\n/* Cache */\n/* ------------------------------------------------------------------ */\n\nconst evictOldest = () => {\n\tconst oldest = cache.keys().next();\n\tif (oldest.done) return;\n\tcache.get(oldest.value)?.abort();\n\tcache.delete(oldest.value);\n};\n\nconst touch = (key: string, entry: CacheEntry) => {\n\t// Re-insert so Map iteration order doubles as LRU recency.\n\tcache.delete(key);\n\tcache.set(key, entry);\n};\n\nexport const clearPrefetchCache = () => {\n\tfor (const entry of cache.values()) entry.abort();\n\tcache.clear();\n};\n\n/** Take the prefetched response for `url` out of the cache. Returns\n * `undefined` when nothing was prefetched (or it was evicted). Callers\n * that fetch the same URL themselves can await this instead. */\nexport const consumePrefetch = (\n\turl: string,\n\tkind: PrefetchKind = 'document'\n) => {\n\tconst key = cacheKey(kind, url);\n\tconst entry = cache.get(key);\n\tif (!entry) return undefined;\n\tcache.delete(key);\n\n\treturn entry.promise;\n};\n\n/** Whether `url` is already prefetched (in flight, queued or settled). */\nexport const hasPrefetched = (url: string, kind: PrefetchKind = 'document') =>\n\tcache.has(cacheKey(kind, url));\n\n/* ------------------------------------------------------------------ */\n/* Kinds */\n/* ------------------------------------------------------------------ */\n\nconst injectLink = (rel: string, href: string, asType?: string) => {\n\tif (typeof document === 'undefined') return;\n\tconst link = document.createElement('link');\n\tlink.rel = rel;\n\tlink.href = href;\n\tif (asType) link.setAttribute('as', asType);\n\tdocument.head.append(link);\n};\n\n/** Without `fetch` (very old engines) fall back to a `<link rel=\"prefetch\">`\n * for documents; other kinds have no declarative equivalent. */\nconst injectPrefetchFallback = (kind: PrefetchKind, url: string) => {\n\tif (kind !== 'document' || !supportsLinkRel('prefetch')) return;\n\tinjectLink('prefetch', url, 'document');\n};\n\nconst supportsLinkRel = (rel: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst link = document.createElement('link');\n\n\treturn (\n\t\ttypeof link.relList?.supports === 'function' &&\n\t\tlink.relList.supports(rel)\n\t);\n};\n\n/** Inject `<link rel=\"prefetch\" as=\"style\">` once per resolved href, so\n * the target page's stylesheets are in the HTTP cache before the click.\n * `prefetch` rather than `preload`: the sheet is for the NEXT document,\n * so preloading it would warn about an unused preload on this one. */\nexport const prefetchStylesheet = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (prefetchedStyles.has(resolved)) return false;\n\tprefetchedStyles.add(resolved);\n\t// No `relList.supports` gate: a browser that doesn't know `prefetch`\n\t// simply ignores the tag, and there is no fallback worth branching to.\n\tinjectLink('prefetch', href, 'style');\n\n\treturn true;\n};\n\n/** Inject `<link rel=\"modulepreload\">` once per resolved href. Returns\n * `true` when a new tag was added. */\nexport const preloadModule = (href: string) => {\n\tif (typeof document === 'undefined') return false;\n\tconst resolved = resolveHref(href);\n\tif (preloadedModules.has(resolved)) return false;\n\n\tconst existing = Array.from(\n\t\tdocument.querySelectorAll<HTMLLinkElement>('link[rel=\"modulepreload\"]')\n\t);\n\tif (existing.some((link) => resolveHref(link.href) === resolved)) {\n\t\tpreloadedModules.add(resolved);\n\n\t\treturn false;\n\t}\n\n\tpreloadedModules.add(resolved);\n\tinjectLink('modulepreload', href);\n\n\treturn true;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n\ttypeof value === 'object' && value !== null;\n\nconst isHref = (value: unknown): value is string =>\n\ttypeof value === 'string' && value.length > 0;\n\n/** Warm what a route-data envelope points at: `modulepreload` for the\n * page's client entry (and a separate client module when it has one),\n * `<link rel=\"prefetch\">` for its stylesheets. Anything unexpected in\n * the payload is ignored — a prefetch must never break a page. */\nconst warmRouteDataAssets = (envelope: unknown) => {\n\tif (!isRecord(envelope)) return;\n\tconst { assets } = envelope;\n\tif (!isRecord(assets)) return;\n\tconst { client, css, index } = assets;\n\tfor (const href of [index, client].filter(isHref)) preloadModule(href);\n\tif (!Array.isArray(css)) return;\n\tfor (const href of css.filter(isHref)) prefetchStylesheet(href);\n};\n\n/** Read the envelope out of a clone so the cached response body is still\n * unconsumed for whoever calls `consumePrefetch`. */\nconst warmFromRouteData = async (response: Response) => {\n\ttry {\n\t\twarmRouteDataAssets(await response.clone().json());\n\t} catch {\n\t\t/* malformed payload — the document prefetch still stands */\n\t}\n\n\treturn response;\n};\n\nconst fetchDocument = (url: string, signal: AbortSignal) =>\n\tfetch(url, { credentials: 'same-origin', signal });\n\nconst fetchRouteData = async (url: string, signal: AbortSignal) => {\n\tconst response = await fetch(url, {\n\t\tcredentials: 'same-origin',\n\t\theaders: { Accept: ROUTE_DATA_MEDIA_TYPE },\n\t\tsignal\n\t});\n\tconst contentType = response.headers.get('content-type') ?? '';\n\tconst isRouteData =\n\t\tresponse.ok && contentType.includes(ROUTE_DATA_MEDIA_TYPE);\n\tif (isRouteData) return warmFromRouteData(response);\n\n\t// The server doesn't speak route data (yet) — 404 / 406 / HTML fallback.\n\t// Remember that as \"no data\" so the URL isn't asked again, and drain\n\t// the body so the connection can be reused.\n\tawait response.body?.cancel().catch(() => undefined);\n\tconst status =\n\t\tresponse.status === NOT_FOUND || response.status === NOT_ACCEPTABLE\n\t\t\t? response.status\n\t\t\t: NOT_ACCEPTABLE;\n\n\treturn new Response(null, { status });\n};\n\n/**\n * Prefetch `url`. No-op when the user signalled data-saver / reduced-data\n * / 2g, when the page opted out, or when the URL is already cached. At\n * most two prefetches are in flight at once; the rest queue in order.\n */\nexport const prefetch = (url: string, options: PrefetchOptions = {}) => {\n\tconst kind = options.kind ?? 'document';\n\tif (!canPrefetch()) return;\n\n\tif (kind === 'module') {\n\t\tpreloadModule(url);\n\n\t\treturn;\n\t}\n\n\t// `'route'` is document + data: the HTML for the navigation itself and\n\t// the payload that names the modules and CSS to warm alongside it.\n\tif (kind === 'route') {\n\t\tprefetch(url, { kind: 'document' });\n\t\tprefetch(url, { kind: 'data' });\n\n\t\treturn;\n\t}\n\n\tconst key = cacheKey(kind, url);\n\tconst existing = cache.get(key);\n\tif (existing) {\n\t\ttouch(key, existing);\n\n\t\treturn;\n\t}\n\n\tif (typeof fetch === 'undefined') {\n\t\tinjectPrefetchFallback(kind, url);\n\n\t\treturn;\n\t}\n\n\twhile (cache.size >= PREFETCH_CACHE_LIMIT) evictOldest();\n\n\tconst { abort, promise } = enqueue((signal) =>\n\t\tkind === 'data'\n\t\t\t? fetchRouteData(url, signal)\n\t\t\t: fetchDocument(url, signal)\n\t);\n\tcache.set(key, { abort, kind, promise, url });\n};\n\n/* ------------------------------------------------------------------ */\n/* Speculation rules */\n/* ------------------------------------------------------------------ */\n\nconst supportsSpeculationRules = () =>\n\ttypeof HTMLScriptElement !== 'undefined' &&\n\ttypeof HTMLScriptElement.supports === 'function' &&\n\tHTMLScriptElement.supports('speculationrules');\n\n/**\n * Ask the browser to prerender `url` right away via a speculation-rules\n * script. Deduped per URL and capped to two live rules — the oldest is\n * removed when a third arrives, so a hover trail can't pile up hidden\n * prerendered tabs. Silently no-ops where the API is unsupported.\n */\nexport const speculate = (url: string) => {\n\tif (!canPrefetch() || !supportsSpeculationRules()) return false;\n\tif (typeof document === 'undefined') return false;\n\n\tconst resolved = resolveHref(url);\n\tif (liveSpeculationRules.has(resolved)) return false;\n\n\twhile (liveSpeculationRules.size >= MAX_LIVE_SPECULATION_RULES) {\n\t\tconst oldest = liveSpeculationRules.keys().next();\n\t\tif (oldest.done) break;\n\t\tliveSpeculationRules.get(oldest.value)?.remove();\n\t\tliveSpeculationRules.delete(oldest.value);\n\t}\n\n\tconst script = applyPageNonce(document.createElement('script'));\n\tscript.type = 'speculationrules';\n\tscript.textContent = JSON.stringify({\n\t\tprerender: [{ eagerness: 'immediate', urls: [url] }]\n\t});\n\tdocument.head.append(script);\n\tliveSpeculationRules.set(resolved, script);\n\n\treturn true;\n};\n\n/* ------------------------------------------------------------------ */\n/* Triggers */\n/* ------------------------------------------------------------------ */\n\nconst noopHandle: HoverPrefetchHandle = {\n\tcancel: () => {\n\t\t/* nothing scheduled */\n\t}\n};\n\n/**\n * Wrap a prefetch trigger in a hover-debounce so glancing across many links\n * doesn't fire a fetch storm. The returned handle's `cancel()` aborts the\n * pending hover prefetch (e.g. on `pointerleave`).\n *\n * Defaults to `kind: 'route'` — a hover is deliberate enough to be worth\n * the document AND the route data (and the modules + CSS that payload\n * names). Viewport prefetching stays document-only.\n */\nexport const scheduleHoverPrefetch = (\n\turl: string,\n\toptions: HoverPrefetchOptions = {}\n): HoverPrefetchHandle => {\n\tif (typeof window === 'undefined') return noopHandle;\n\n\tconst timer = window.setTimeout(() => {\n\t\tprefetch(url, { kind: options.kind ?? 'route' });\n\t\tif (options.prerender) speculate(url);\n\t\toptions.onPrefetch?.();\n\t}, HOVER_DEBOUNCE_MS);\n\n\treturn {\n\t\tcancel: () => window.clearTimeout(timer)\n\t};\n};\n\ntype ViewportTarget = {\n\toptions: ViewportPrefetchOptions;\n\turl: string;\n};\n\nconst viewportTargets = new WeakMap<Element, ViewportTarget>();\nlet viewportObserver: IntersectionObserver | null = null;\n\nconst handleIntersections = (entries: IntersectionObserverEntry[]) => {\n\tfor (const entry of entries) {\n\t\tif (!entry.isIntersecting) continue;\n\t\tconst target = viewportTargets.get(entry.target);\n\t\tviewportObserver?.unobserve(entry.target);\n\t\tviewportTargets.delete(entry.target);\n\t\tif (!target) continue;\n\t\tprefetch(target.url, { kind: target.options.kind });\n\t\ttarget.options.onVisible?.();\n\t}\n};\n\nconst getViewportObserver = () => {\n\tif (viewportObserver) return viewportObserver;\n\tif (typeof IntersectionObserver === 'undefined') return null;\n\tviewportObserver = new IntersectionObserver(handleIntersections, {\n\t\trootMargin: VIEWPORT_ROOT_MARGIN\n\t});\n\n\treturn viewportObserver;\n};\n\n/**\n * Prefetch `url` once `element` scrolls within 128px of the viewport. One\n * IntersectionObserver is shared by every link on the page. Returns an\n * unobserve function for the caller's unmount hook.\n */\nexport const observeViewport = (\n\telement: Element,\n\turl: string,\n\toptions: ViewportPrefetchOptions = {}\n) => {\n\tconst observer = getViewportObserver();\n\tif (!observer || !canPrefetch()) return () => undefined;\n\n\tviewportTargets.set(element, { options, url });\n\tobserver.observe(element);\n\n\treturn () => {\n\t\tobserver.unobserve(element);\n\t\tviewportTargets.delete(element);\n\t};\n};\n\n/** Test / teardown helper — forgets injected modulepreload + speculation\n * rule bookkeeping and cancels any queued fetches. */\nexport const resetPrefetchState = () => {\n\tclearPrefetchCache();\n\tqueue.length = 0;\n\tpreloadedModules.clear();\n\tprefetchedStyles.clear();\n\tfor (const script of liveSpeculationRules.values()) script.remove();\n\tliveSpeculationRules.clear();\n\tviewportObserver?.disconnect();\n\tviewportObserver = null;\n};\n"
|
|
7
6
|
],
|
|
8
|
-
"mappings": "
|
|
9
|
-
"debugId": "
|
|
7
|
+
"mappings": ";;;;;AAqCA,IAAM,uBAAuB;AAC7B,IAAM,oBAAoB;AAC1B,IAAM,gBAAgB;AACtB,IAAM,6BAA6B;AACnC,IAAM,uBAAuB;AAC7B,IAAM,uBAAuB,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC;AACtD,IAAM,YAAY;AAClB,IAAM,iBAAiB;AAEhB,IAAM,yBAAwB;AAcrC,IAAM,QAAQ,IAAI;AAClB,IAAM,QAAsB,CAAC;AAC7B,IAAI,WAAW;AAEf,IAAM,mBAAmB,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,EAC7C,SAAS,QAAQ,OAAO;AAAA,EAExB,OAAO,MAAM;AAAA,IACZ,SAAS,UAAU,OAAO;AAAA,IAC1B,gBAAgB,OAAO,OAAO;AAAA;AAAA;AAMzB,IAAM,sBAAqB,MAAM;AAAA,EACvC,oBAAmB;AAAA,EACnB,MAAM,SAAS;AAAA,EACf,iBAAiB,MAAM;AAAA,EACvB,iBAAiB,MAAM;AAAA,EACvB,WAAW,UAAU,qBAAqB,OAAO;AAAA,IAAG,OAAO,OAAO;AAAA,EAClE,qBAAqB,MAAM;AAAA,EAC3B,kBAAkB,WAAW;AAAA,EAC7B,mBAAmB;AAAA;",
|
|
8
|
+
"debugId": "23E0D01680231D5664756E2164756E21",
|
|
10
9
|
"names": []
|
|
11
10
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TRANSLATABLE_ATTRIBUTES
|
|
3
3
|
} from "./index-8m2qq61n.js";
|
|
4
|
+
import {
|
|
5
|
+
readPageNonce
|
|
6
|
+
} from "./index-4j1snyh2.js";
|
|
4
7
|
|
|
5
8
|
// src/angular/resolveAngularPackage.ts
|
|
6
9
|
var {existsSync, readFileSync} = (() => ({}));
|
|
@@ -382,10 +385,14 @@ var getClientAngularComponentSelector = (component) => {
|
|
|
382
385
|
return typeof selector === "string" && selector.length > 0 ? selector : null;
|
|
383
386
|
};
|
|
384
387
|
var createAngularIslandApp = async () => {
|
|
385
|
-
const { EnvironmentInjector, provideZonelessChangeDetection } = await import("@angular/core");
|
|
388
|
+
const { CSP_NONCE, EnvironmentInjector, provideZonelessChangeDetection } = await import("@angular/core");
|
|
386
389
|
const { createApplication } = await import("@angular/platform-browser");
|
|
390
|
+
const nonce = readPageNonce();
|
|
387
391
|
const app = await createApplication({
|
|
388
|
-
providers: [
|
|
392
|
+
providers: [
|
|
393
|
+
provideZonelessChangeDetection(),
|
|
394
|
+
...nonce ? [{ provide: CSP_NONCE, useValue: nonce }] : []
|
|
395
|
+
]
|
|
389
396
|
});
|
|
390
397
|
const environmentInjector = app.injector.get(EnvironmentInjector);
|
|
391
398
|
return { app, environmentInjector };
|
|
@@ -435,5 +442,5 @@ export {
|
|
|
435
442
|
mountAngularIsland
|
|
436
443
|
};
|
|
437
444
|
|
|
438
|
-
//# debugId=
|
|
439
|
-
//# sourceMappingURL=islands-
|
|
445
|
+
//# debugId=BAB2ED48C1DBFB7D64756E2164756E21
|
|
446
|
+
//# sourceMappingURL=islands-mfjmdwnb.js.map
|