octane 0.2.6 → 0.2.7
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/README.md +5 -0
- package/dist/cjs/runtime.cjs +435 -274
- package/dist/cjs/runtime.server.cjs +13 -11
- package/dist/cjs/version.cjs +1 -1
- package/dist/compiler/bundler.js +6 -6
- package/dist/compiler/compile-universal.js +1 -1
- package/dist/compiler/compile.js +236 -113
- package/dist/compiler/index.d.ts +1 -3
- package/dist/compiler/native-read-diagnostics.js +43 -35
- package/dist/compiler/slot-hooks.d.ts +0 -1
- package/dist/compiler/slot-hooks.js +3 -3
- package/dist/compiler/text-type-facts.js +38 -24
- package/dist/compiler/typescript.d.ts +8 -1
- package/dist/compiler/typescript.js +48 -20
- package/dist/compiler/vite.d.ts +6 -2
- package/dist/compiler/vite.js +85 -5
- package/dist/compiler/volar.d.ts +1 -1
- package/dist/compiler/volar.js +12 -7
- package/dist/runtime.d.ts +11 -2
- package/dist/runtime.js +433 -274
- package/dist/runtime.server.d.ts +1 -1
- package/dist/runtime.server.js +13 -11
- package/dist/signals/index.d.ts +1 -1
- package/dist/signals/types.d.ts +1 -1
- package/dist/universal-core.js +59 -51
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -2392,7 +2392,8 @@ function ssrComponent(parent, comp, props, inherit, key, identityScoped) {
|
|
|
2392
2392
|
occ: null,
|
|
2393
2393
|
path: null,
|
|
2394
2394
|
deferred: false,
|
|
2395
|
-
asyncScope: ASYNC_SCOPE
|
|
2395
|
+
asyncScope: ASYNC_SCOPE,
|
|
2396
|
+
namespace: explicitNamespace ?? void 0
|
|
2396
2397
|
} : {
|
|
2397
2398
|
parent: pf,
|
|
2398
2399
|
seg: nextChildSegment(pf),
|
|
@@ -2401,9 +2402,9 @@ function ssrComponent(parent, comp, props, inherit, key, identityScoped) {
|
|
|
2401
2402
|
occ: null,
|
|
2402
2403
|
path: null,
|
|
2403
2404
|
deferred: false,
|
|
2404
|
-
asyncScope: ASYNC_SCOPE
|
|
2405
|
+
asyncScope: ASYNC_SCOPE,
|
|
2406
|
+
namespace: explicitNamespace ?? pf.namespace
|
|
2405
2407
|
};
|
|
2406
|
-
frame.namespace = explicitNamespace ?? pf?.namespace;
|
|
2407
2408
|
return renderComponentFramed(comp, props, parent, frame, inherit);
|
|
2408
2409
|
} finally {
|
|
2409
2410
|
if (identityScoped !== true) ASYNC_SCOPE = previousIdentityScope;
|
|
@@ -2645,6 +2646,7 @@ function vtSsrAnnotate(html, attrs) {
|
|
|
2645
2646
|
return html.slice(0, insertion) + inject + html.slice(insertion);
|
|
2646
2647
|
}
|
|
2647
2648
|
function vtSsrClaimArm(html, kind) {
|
|
2649
|
+
if (!VT_SSR_HAS_CANDIDATES) return html;
|
|
2648
2650
|
const start = vtSsrFirstVisibleOpenTag(html);
|
|
2649
2651
|
if (start === -1) return html;
|
|
2650
2652
|
const end = vtSsrOpenTagEnd(html, start + 1);
|
|
@@ -3783,14 +3785,12 @@ function namespaceHeadElement(headKey, tag, attrs, text, authoredKey) {
|
|
|
3783
3785
|
return createElement(namespaceHead, config);
|
|
3784
3786
|
}
|
|
3785
3787
|
function spliceHead(body, head) {
|
|
3786
|
-
if (head === ""
|
|
3788
|
+
if (!isDocumentRoot(body)) return head === "" ? body : head + body;
|
|
3787
3789
|
const headClose = body.indexOf("</head>");
|
|
3788
3790
|
if (headClose !== -1) return body.slice(0, headClose) + head + body.slice(headClose);
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
return body.slice(0, openingEnd) + "<head>" + head + "</head>" + body.slice(openingEnd);
|
|
3793
|
-
}
|
|
3791
|
+
const openingEnd = documentTagEnd(body, body.indexOf("<html") + 5);
|
|
3792
|
+
if (openingEnd !== -1)
|
|
3793
|
+
return body.slice(0, openingEnd) + "<head>" + head + "</head>" + body.slice(openingEnd);
|
|
3794
3794
|
if (head === "") return body;
|
|
3795
3795
|
return head + body;
|
|
3796
3796
|
}
|
|
@@ -4050,7 +4050,8 @@ function runFullFramedPass(component, props, resolved, nonceAttr = "", identifie
|
|
|
4050
4050
|
occ: null,
|
|
4051
4051
|
path: "",
|
|
4052
4052
|
deferred: false,
|
|
4053
|
-
asyncScope: ""
|
|
4053
|
+
asyncScope: "",
|
|
4054
|
+
namespace: void 0
|
|
4054
4055
|
};
|
|
4055
4056
|
CURRENT_COMP = component;
|
|
4056
4057
|
CURRENT_PROPS = props;
|
|
@@ -4156,7 +4157,8 @@ function runDiscoveryRound(jobs, resolved, identifierPrefix) {
|
|
|
4156
4157
|
occ: null,
|
|
4157
4158
|
path: null,
|
|
4158
4159
|
deferred: false,
|
|
4159
|
-
asyncScope: job.frame.asyncScope
|
|
4160
|
+
asyncScope: job.frame.asyncScope,
|
|
4161
|
+
namespace: void 0
|
|
4160
4162
|
};
|
|
4161
4163
|
try {
|
|
4162
4164
|
renderComponentFramed(job.comp, job.props, job.parentScope, frame);
|
package/dist/cjs/version.cjs
CHANGED
|
@@ -21,7 +21,7 @@ __export(version_exports, {
|
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(version_exports);
|
|
24
|
-
const version = "0.2.
|
|
24
|
+
const version = "0.2.7";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
package/dist/compiler/bundler.js
CHANGED
|
@@ -516,7 +516,6 @@ class OctaneBundlerCompiler {
|
|
|
516
516
|
profile: options.profile === true,
|
|
517
517
|
inlineHookMemo: options.inlineHookMemo !== false,
|
|
518
518
|
strong: options.strong === true,
|
|
519
|
-
nativeReads: options.nativeReads === true,
|
|
520
519
|
universalRuntime: normalizeUniversalRuntime(options.universalRuntime),
|
|
521
520
|
};
|
|
522
521
|
this.renderers = normalizeRendererConfig(options.renderers);
|
|
@@ -1086,7 +1085,6 @@ class OctaneBundlerCompiler {
|
|
|
1086
1085
|
// byte identical even when a shared client/server bundler configuration opts in.
|
|
1087
1086
|
const profile = environment === 'client' && (options.profile ?? this.defaults.profile) === true;
|
|
1088
1087
|
const inlineHookMemo = (options.inlineHookMemo ?? this.defaults.inlineHookMemo) !== false;
|
|
1089
|
-
const nativeReads = (options.nativeReads ?? this.defaults.nativeReads) === true;
|
|
1090
1088
|
// An application's global policy never leaks into installed or linked
|
|
1091
1089
|
// compatibility packages, including workspace packages nested inside the
|
|
1092
1090
|
// project root. Modules may still opt themselves in with their own
|
|
@@ -1186,11 +1184,13 @@ class OctaneBundlerCompiler {
|
|
|
1186
1184
|
hmr,
|
|
1187
1185
|
mode: environment,
|
|
1188
1186
|
dev,
|
|
1187
|
+
...(renderer.target === 'dom' && options.textTypeFacts !== undefined
|
|
1188
|
+
? { textTypeFacts: options.textTypeFacts }
|
|
1189
|
+
: null),
|
|
1189
1190
|
profile,
|
|
1190
1191
|
profileFilename,
|
|
1191
1192
|
...(inlineHookMemo ? null : { inlineHookMemo: false }),
|
|
1192
1193
|
...(strong ? { strong: true } : null),
|
|
1193
|
-
...(nativeReads ? { nativeReads: true } : null),
|
|
1194
1194
|
...(universalRuntime === undefined ? null : { universalRuntime }),
|
|
1195
1195
|
// Keep the established DOM compiler call byte-for-byte equivalent. A
|
|
1196
1196
|
// renderer descriptor is an orthogonal compiler input only for the
|
|
@@ -1280,9 +1280,9 @@ class OctaneBundlerCompiler {
|
|
|
1280
1280
|
const nativeHookImport = /from\s*['"]octane\/signals\/(?:client|server)['"]/.test(code);
|
|
1281
1281
|
const hasHookRuntimeImport =
|
|
1282
1282
|
/from\s*['"]octane['"]/.test(code) ||
|
|
1283
|
-
|
|
1283
|
+
/from\s*['"]octane\/server['"]/.test(code) ||
|
|
1284
1284
|
nativeHookImport ||
|
|
1285
|
-
|
|
1285
|
+
/from\s*['"]octane\/signals['"]/.test(code);
|
|
1286
1286
|
// Manual factories can import only other binding helpers, so their
|
|
1287
1287
|
// escaping hooks still need a provider boundary. Unrelated helpers keep
|
|
1288
1288
|
// their cheap pass-through without collecting unused manifest watches.
|
|
@@ -1332,7 +1332,7 @@ class OctaneBundlerCompiler {
|
|
|
1332
1332
|
inlineHookMemo: inlinePlainMemo,
|
|
1333
1333
|
...(manualSlots ? { manualSlots: true } : null),
|
|
1334
1334
|
...(strong ? { strong: true } : null),
|
|
1335
|
-
|
|
1335
|
+
renderer,
|
|
1336
1336
|
...(specializeVoidRoot
|
|
1337
1337
|
? {
|
|
1338
1338
|
isVoidComponentImport: options.isVoidComponentImport,
|
|
@@ -550,7 +550,7 @@ const RUNTIME_TYPESCRIPT_NODES = new Set([
|
|
|
550
550
|
'TSTypeAssertion',
|
|
551
551
|
]);
|
|
552
552
|
|
|
553
|
-
function forEachRuntimeAstChild(node, visit) {
|
|
553
|
+
export function forEachRuntimeAstChild(node, visit) {
|
|
554
554
|
if (
|
|
555
555
|
typeof node?.type === 'string' &&
|
|
556
556
|
node.type.startsWith('TS') &&
|