@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
|
@@ -3,25 +3,44 @@
|
|
|
3
3
|
import { readFileSync as readFileSync2, writeFileSync } from "fs";
|
|
4
4
|
import { dirname as dirname2, relative } from "path";
|
|
5
5
|
|
|
6
|
+
// src/utils/lazyTypescript.ts
|
|
7
|
+
import { createRequire } from "module";
|
|
8
|
+
var loaded;
|
|
9
|
+
var loadTypescript = () => {
|
|
10
|
+
if (loaded)
|
|
11
|
+
return loaded;
|
|
12
|
+
const requireFromHere = createRequire(import.meta.url);
|
|
13
|
+
const typescript = requireFromHere("typescript");
|
|
14
|
+
loaded = typescript;
|
|
15
|
+
return typescript;
|
|
16
|
+
};
|
|
17
|
+
var createLazyTypescript = () => {
|
|
18
|
+
const target = Object.create(null);
|
|
19
|
+
return new Proxy(target, {
|
|
20
|
+
get: (_target, key) => Reflect.get(loadTypescript(), key),
|
|
21
|
+
has: (_target, key) => Reflect.has(loadTypescript(), key)
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var lazyTypescript = createLazyTypescript();
|
|
25
|
+
|
|
6
26
|
// src/dev/importCost/deferability.ts
|
|
7
|
-
import ts from "typescript";
|
|
8
27
|
var DEFERRED = "deferred";
|
|
9
28
|
var scriptKindFor = (fileName) => {
|
|
10
29
|
if (fileName.endsWith(".tsx"))
|
|
11
|
-
return
|
|
30
|
+
return lazyTypescript.ScriptKind.TSX;
|
|
12
31
|
if (fileName.endsWith(".jsx"))
|
|
13
|
-
return
|
|
32
|
+
return lazyTypescript.ScriptKind.JSX;
|
|
14
33
|
if (fileName.endsWith(".js") || fileName.endsWith(".mjs")) {
|
|
15
|
-
return
|
|
34
|
+
return lazyTypescript.ScriptKind.JS;
|
|
16
35
|
}
|
|
17
|
-
return
|
|
36
|
+
return lazyTypescript.ScriptKind.TS;
|
|
18
37
|
};
|
|
19
38
|
var namedBindings = (clause) => {
|
|
20
39
|
const names = clause.name === undefined ? [] : [clause.name.text];
|
|
21
40
|
const { namedBindings: bindings } = clause;
|
|
22
41
|
if (bindings === undefined)
|
|
23
42
|
return names;
|
|
24
|
-
if (
|
|
43
|
+
if (lazyTypescript.isNamespaceImport(bindings))
|
|
25
44
|
return [...names, bindings.name.text];
|
|
26
45
|
return [
|
|
27
46
|
...names,
|
|
@@ -30,20 +49,20 @@ var namedBindings = (clause) => {
|
|
|
30
49
|
};
|
|
31
50
|
var declarationFrom = (statement, source) => {
|
|
32
51
|
const specifier = statement.moduleSpecifier;
|
|
33
|
-
if (!
|
|
52
|
+
if (!lazyTypescript.isStringLiteral(specifier))
|
|
34
53
|
return null;
|
|
35
54
|
const clause = statement.importClause;
|
|
36
55
|
const bindings = clause === undefined ? [] : namedBindings(clause);
|
|
37
56
|
const declaration = {
|
|
38
57
|
bindings,
|
|
39
|
-
line:
|
|
58
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
40
59
|
sideEffect: clause === undefined,
|
|
41
60
|
specifier: specifier.text,
|
|
42
61
|
typeOnly: clause !== undefined && (clause.isTypeOnly || bindings.length === 0)
|
|
43
62
|
};
|
|
44
63
|
return declaration;
|
|
45
64
|
};
|
|
46
|
-
var isTypePosition = (node) =>
|
|
65
|
+
var isTypePosition = (node) => lazyTypescript.isTypeNode(node) && !lazyTypescript.isExpressionWithTypeArguments(node);
|
|
47
66
|
var isDeferredPosition = (current, child) => {
|
|
48
67
|
if (Reflect.get(current, "body") === child)
|
|
49
68
|
return true;
|
|
@@ -51,19 +70,19 @@ var isDeferredPosition = (current, child) => {
|
|
|
51
70
|
return Array.isArray(parameters) && parameters.some((parameter) => parameter === child);
|
|
52
71
|
};
|
|
53
72
|
var classifyAncestor = (current, child) => {
|
|
54
|
-
if (
|
|
73
|
+
if (lazyTypescript.isExportSpecifier(current))
|
|
55
74
|
return "re-exported by the entry";
|
|
56
|
-
if (
|
|
75
|
+
if (lazyTypescript.isDecorator(current))
|
|
57
76
|
return "decorator";
|
|
58
|
-
if (
|
|
77
|
+
if (lazyTypescript.isPropertyDeclaration(current) && current.initializer === child) {
|
|
59
78
|
return "class field initializer";
|
|
60
79
|
}
|
|
61
80
|
if (isTypePosition(current))
|
|
62
81
|
return DEFERRED;
|
|
63
|
-
if (
|
|
82
|
+
if (lazyTypescript.isFunctionLike(current) && isDeferredPosition(current, child)) {
|
|
64
83
|
return DEFERRED;
|
|
65
84
|
}
|
|
66
|
-
if (
|
|
85
|
+
if (lazyTypescript.isSourceFile(current))
|
|
67
86
|
return "module scope";
|
|
68
87
|
return null;
|
|
69
88
|
};
|
|
@@ -83,9 +102,9 @@ var classifyUsage = (node) => {
|
|
|
83
102
|
return pending ?? "module scope";
|
|
84
103
|
};
|
|
85
104
|
var isDeclarationName = (parent, node) => {
|
|
86
|
-
if (
|
|
105
|
+
if (lazyTypescript.isExportSpecifier(parent))
|
|
87
106
|
return false;
|
|
88
|
-
if (
|
|
107
|
+
if (lazyTypescript.isShorthandPropertyAssignment(parent))
|
|
89
108
|
return false;
|
|
90
109
|
return Reflect.get(parent, "name") === node;
|
|
91
110
|
};
|
|
@@ -93,7 +112,7 @@ var isReferencePosition = (node) => {
|
|
|
93
112
|
const { parent } = node;
|
|
94
113
|
if (parent === undefined)
|
|
95
114
|
return false;
|
|
96
|
-
if (
|
|
115
|
+
if (lazyTypescript.isQualifiedName(parent) && parent.right === node)
|
|
97
116
|
return false;
|
|
98
117
|
return !isDeclarationName(parent, node);
|
|
99
118
|
};
|
|
@@ -110,13 +129,13 @@ var recordUsage = (node, owners, reasons) => {
|
|
|
110
129
|
var collectUnsafeReasons = (source, owners) => {
|
|
111
130
|
const reasons = new Map;
|
|
112
131
|
const visit = (node) => {
|
|
113
|
-
if (
|
|
132
|
+
if (lazyTypescript.isImportDeclaration(node))
|
|
114
133
|
return;
|
|
115
|
-
if (
|
|
134
|
+
if (lazyTypescript.isIdentifier(node))
|
|
116
135
|
recordUsage(node, owners, reasons);
|
|
117
|
-
|
|
136
|
+
lazyTypescript.forEachChild(node, visit);
|
|
118
137
|
};
|
|
119
|
-
|
|
138
|
+
lazyTypescript.forEachChild(source, visit);
|
|
120
139
|
return reasons;
|
|
121
140
|
};
|
|
122
141
|
var verdictFor = (declaration, reason) => {
|
|
@@ -130,12 +149,12 @@ var verdictFor = (declaration, reason) => {
|
|
|
130
149
|
};
|
|
131
150
|
var reExportOf = (statement, source) => {
|
|
132
151
|
const specifier = statement.moduleSpecifier;
|
|
133
|
-
if (specifier === undefined || !
|
|
152
|
+
if (specifier === undefined || !lazyTypescript.isStringLiteral(specifier))
|
|
134
153
|
return null;
|
|
135
154
|
if (statement.isTypeOnly)
|
|
136
155
|
return null;
|
|
137
156
|
const entry = {
|
|
138
|
-
line:
|
|
157
|
+
line: lazyTypescript.getLineAndCharacterOfPosition(source, statement.getStart(source)).line + 1,
|
|
139
158
|
reason: "re-exported by the entry",
|
|
140
159
|
specifier: specifier.text,
|
|
141
160
|
verdict: "used at module scope"
|
|
@@ -143,9 +162,9 @@ var reExportOf = (statement, source) => {
|
|
|
143
162
|
return entry;
|
|
144
163
|
};
|
|
145
164
|
var analyzeEntryImports = (sourceText, fileName) => {
|
|
146
|
-
const source =
|
|
147
|
-
const declarations = source.statements.filter(
|
|
148
|
-
const reExports = source.statements.filter(
|
|
165
|
+
const source = lazyTypescript.createSourceFile(fileName, sourceText, lazyTypescript.ScriptTarget.ESNext, true, scriptKindFor(fileName));
|
|
166
|
+
const declarations = source.statements.filter(lazyTypescript.isImportDeclaration).map((statement) => declarationFrom(statement, source)).filter((declaration) => declaration !== null);
|
|
167
|
+
const reExports = source.statements.filter(lazyTypescript.isExportDeclaration).map((statement) => reExportOf(statement, source)).filter((entry) => entry !== null);
|
|
149
168
|
const owners = new Map;
|
|
150
169
|
declarations.forEach((declaration, index) => {
|
|
151
170
|
for (const binding of declaration.bindings)
|