octane 0.7.0 → 0.7.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.
|
@@ -5880,8 +5880,9 @@ async function prerender(entryComponent, props, options) {
|
|
|
5880
5880
|
signal: preparedOptions?.signal === void 0 ? cancelRender.signal : AbortSignal.any([preparedOptions.signal, cancelRender.signal])
|
|
5881
5881
|
};
|
|
5882
5882
|
const nonceAttr = nonceAttrOf(renderOptions);
|
|
5883
|
-
|
|
5883
|
+
let resolved;
|
|
5884
5884
|
try {
|
|
5885
|
+
resolved = newResolvedMap(renderOptions ?? null);
|
|
5885
5886
|
const pass = await runBuffered(component, props, renderOptions, nonceAttr, resolved);
|
|
5886
5887
|
if (injection !== void 0) {
|
|
5887
5888
|
try {
|
|
@@ -5908,7 +5909,7 @@ async function prerender(entryComponent, props, options) {
|
|
|
5908
5909
|
}
|
|
5909
5910
|
throw error;
|
|
5910
5911
|
} finally {
|
|
5911
|
-
releaseServerRenderResources(resolved);
|
|
5912
|
+
if (resolved !== void 0) releaseServerRenderResources(resolved);
|
|
5912
5913
|
}
|
|
5913
5914
|
}
|
|
5914
5915
|
async function prerenderToNodeStream(entryComponent, props, options) {
|
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.7.
|
|
24
|
+
const version = "0.7.1";
|
|
25
25
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
26
|
0 && (module.exports = {
|
|
27
27
|
version
|
package/dist/compiler/compile.js
CHANGED
|
@@ -34714,7 +34714,10 @@ function lowerJsxReturnBranchComponents(ast) {
|
|
|
34714
34714
|
* lowers the helper. The runtime itself renders the function arguments of
|
|
34715
34715
|
* three calls, which keep that path: a `createPortal` body, matched by name as
|
|
34716
34716
|
* the portal lowering matches it, and the component or render-function child
|
|
34717
|
-
* given to octane's `memo` or `createElement`.
|
|
34717
|
+
* given to octane's `memo` or `createElement`. So does a component given to an
|
|
34718
|
+
* `Object` static that only stores or returns it, as
|
|
34719
|
+
* `Object.assign(Button, { Item })` does: the component is rendered later, and
|
|
34720
|
+
* inside a module-level function only its template body can own a directive.
|
|
34718
34721
|
*
|
|
34719
34722
|
* Module-level template bindings are components, which this pass leaves to
|
|
34720
34723
|
* the component pipeline. Async and generator functions keep their bodies,
|
|
@@ -34752,9 +34755,11 @@ function lowerDirectlyCalledTemplateFunctions(ast) {
|
|
|
34752
34755
|
if (expressions.size === 0 && candidates.size === 0) return ast;
|
|
34753
34756
|
|
|
34754
34757
|
let renderingCallees = null;
|
|
34755
|
-
// True when the
|
|
34756
|
-
|
|
34758
|
+
// True when the callee never calls the call's function arguments: the runtime
|
|
34759
|
+
// renders them, or an `Object` static stores or returns them.
|
|
34760
|
+
const keepsArguments = (call) => {
|
|
34757
34761
|
const callee = unwrapTsExpr(call.callee);
|
|
34762
|
+
if (isObjectPassThroughCallee(callee)) return true;
|
|
34758
34763
|
if (callee?.type !== 'Identifier') return false;
|
|
34759
34764
|
if (callee.name === 'createPortal') return true;
|
|
34760
34765
|
renderingCallees ??= collectOctaneImportLocals(ast.body, ['memo', 'createElement']);
|
|
@@ -34788,8 +34793,8 @@ function lowerDirectlyCalledTemplateFunctions(ast) {
|
|
|
34788
34793
|
for (let i = 0; i < args.length; i++) {
|
|
34789
34794
|
const arg = unwrapTsExpr(args[i]);
|
|
34790
34795
|
if (expressions.has(arg)) {
|
|
34791
|
-
if (!
|
|
34792
|
-
} else if (arg?.type === 'Identifier' && names.has(arg.name) && !
|
|
34796
|
+
if (!keepsArguments(node)) lowered.add(arg);
|
|
34797
|
+
} else if (arg?.type === 'Identifier' && names.has(arg.name) && !keepsArguments(node)) {
|
|
34793
34798
|
markCalled(functions, arg.name);
|
|
34794
34799
|
}
|
|
34795
34800
|
}
|
|
@@ -34807,6 +34812,29 @@ function isLowerableTemplateFunction(fn) {
|
|
|
34807
34812
|
return fn.body?.type === 'JSXCodeBlock' && !fn.async && !fn.generator;
|
|
34808
34813
|
}
|
|
34809
34814
|
|
|
34815
|
+
// The `Object` statics that return their first argument and call none of their
|
|
34816
|
+
// arguments. `Object.groupBy` calls its callback, so it is not one of them.
|
|
34817
|
+
const OBJECT_PASS_THROUGH_METHODS = new Set([
|
|
34818
|
+
'assign',
|
|
34819
|
+
'defineProperties',
|
|
34820
|
+
'defineProperty',
|
|
34821
|
+
'freeze',
|
|
34822
|
+
'preventExtensions',
|
|
34823
|
+
'seal',
|
|
34824
|
+
'setPrototypeOf',
|
|
34825
|
+
]);
|
|
34826
|
+
|
|
34827
|
+
/** `Object.assign`, `Object.freeze`, or another pass-through `Object` static. */
|
|
34828
|
+
function isObjectPassThroughCallee(callee) {
|
|
34829
|
+
return (
|
|
34830
|
+
callee?.type === 'MemberExpression' &&
|
|
34831
|
+
!callee.computed &&
|
|
34832
|
+
callee.object?.type === 'Identifier' &&
|
|
34833
|
+
callee.object.name === 'Object' &&
|
|
34834
|
+
OBJECT_PASS_THROUGH_METHODS.has(callee.property?.name)
|
|
34835
|
+
);
|
|
34836
|
+
}
|
|
34837
|
+
|
|
34810
34838
|
/**
|
|
34811
34839
|
* The name a call invokes as a function, or null. `helper(…)` and
|
|
34812
34840
|
* `helper?.(…)` call it, and so do `helper.call(…)`, `helper.apply(…)`, and
|
|
@@ -5798,8 +5798,9 @@ async function prerender(entryComponent, props, options) {
|
|
|
5798
5798
|
signal: preparedOptions?.signal === void 0 ? cancelRender.signal : AbortSignal.any([preparedOptions.signal, cancelRender.signal])
|
|
5799
5799
|
};
|
|
5800
5800
|
const nonceAttr = nonceAttrOf(renderOptions);
|
|
5801
|
-
|
|
5801
|
+
let resolved;
|
|
5802
5802
|
try {
|
|
5803
|
+
resolved = newResolvedMap(renderOptions ?? null);
|
|
5803
5804
|
const pass = await runBuffered(component, props, renderOptions, nonceAttr, resolved);
|
|
5804
5805
|
if (injection !== void 0) {
|
|
5805
5806
|
try {
|
|
@@ -5826,7 +5827,7 @@ async function prerender(entryComponent, props, options) {
|
|
|
5826
5827
|
}
|
|
5827
5828
|
throw error;
|
|
5828
5829
|
} finally {
|
|
5829
|
-
releaseServerRenderResources(resolved);
|
|
5830
|
+
if (resolved !== void 0) releaseServerRenderResources(resolved);
|
|
5830
5831
|
}
|
|
5831
5832
|
}
|
|
5832
5833
|
async function prerenderToNodeStream(entryComponent, props, options) {
|
package/dist/node/version.js
CHANGED
package/dist/runtime.server.js
CHANGED
|
@@ -5797,8 +5797,9 @@ async function prerender(entryComponent, props, options) {
|
|
|
5797
5797
|
signal: preparedOptions?.signal === void 0 ? cancelRender.signal : AbortSignal.any([preparedOptions.signal, cancelRender.signal])
|
|
5798
5798
|
};
|
|
5799
5799
|
const nonceAttr = nonceAttrOf(renderOptions);
|
|
5800
|
-
|
|
5800
|
+
let resolved;
|
|
5801
5801
|
try {
|
|
5802
|
+
resolved = newResolvedMap(renderOptions ?? null);
|
|
5802
5803
|
const pass = await runBuffered(component, props, renderOptions, nonceAttr, resolved);
|
|
5803
5804
|
if (injection !== void 0) {
|
|
5804
5805
|
try {
|
|
@@ -5825,7 +5826,7 @@ async function prerender(entryComponent, props, options) {
|
|
|
5825
5826
|
}
|
|
5826
5827
|
throw error;
|
|
5827
5828
|
} finally {
|
|
5828
|
-
releaseServerRenderResources(resolved);
|
|
5829
|
+
if (resolved !== void 0) releaseServerRenderResources(resolved);
|
|
5829
5830
|
}
|
|
5830
5831
|
}
|
|
5831
5832
|
async function prerenderToNodeStream(entryComponent, props, options) {
|
package/dist/version.js
CHANGED