fix: close durable queue and runtime gaps
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@wrnexus/compiler",
|
||||
"version": "0.8.20",
|
||||
"version": "0.8.21",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
||||
@@ -1857,6 +1857,8 @@ ${declarations}
|
||||
${
|
||||
visible.length
|
||||
? ` const __values = await Promise.all([${visible.map((entry) => `__load_${entry.name}()`).join(", ")}]);
|
||||
const __response = __values.find((value) => value instanceof Response);
|
||||
if (__response) return __response;
|
||||
return { ${visible.map((entry, index) => `${JSON.stringify(entry.name)}: __values[${index}]`).join(", ")} };`
|
||||
: ""
|
||||
}
|
||||
|
||||
@@ -56,6 +56,17 @@ test("named loads support memoized dependencies and deferred execution", () => {
|
||||
expect(code).toContain('return { "audit": __values[0] }');
|
||||
});
|
||||
|
||||
test("named server loads propagate redirect responses instead of wrapping them as data", () => {
|
||||
const code = generate(
|
||||
parse(`page Private {
|
||||
load server gate { return Response.redirect("/login", 303) }
|
||||
view { <p>Private</p> }
|
||||
}`),
|
||||
);
|
||||
expect(code).toContain("__values.find((value) => value instanceof Response)");
|
||||
expect(code).toContain("if (__response) return __response");
|
||||
});
|
||||
|
||||
test("load dependency cycles and cross-phase server dependencies fail compilation", () => {
|
||||
expect(() =>
|
||||
parse(
|
||||
|
||||
Reference in New Issue
Block a user