fix: serialized compute signals re-created as normal signals (#3183)
Fixes https://github.com/denoland/fresh/issues/3182
This commit is contained in:
@@ -27,6 +27,7 @@ import type { FreshConfig } from "../src/config.ts";
|
||||
import { FreshAttrs } from "./fixtures_islands/FreshAttrs.tsx";
|
||||
import { FakeServer } from "../src/test_utils.ts";
|
||||
import { PARTIAL_SEARCH_PARAM } from "../src/constants.ts";
|
||||
import { ComputedSignal } from "./fixtures_islands/Computed.tsx";
|
||||
|
||||
const allIslandCache = await buildProd({ islandDir: ALL_ISLAND_DIR });
|
||||
const islandGroupCache = await buildProd({ root: ISLAND_GROUP_DIR });
|
||||
@@ -123,6 +124,29 @@ Deno.test({
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
// Note that computed signals are detached because we cannot
|
||||
// serialize the whole signal tree at the moment.
|
||||
name: "islands - should serialize computed",
|
||||
fn: async () => {
|
||||
const app = testApp()
|
||||
.get("/", (ctx) => {
|
||||
return ctx.render(
|
||||
<Doc>
|
||||
<ComputedSignal id="comp" />
|
||||
</Doc>,
|
||||
);
|
||||
});
|
||||
|
||||
await withBrowserApp(app, async (page, address) => {
|
||||
await page.goto(address, { waitUntil: "load" });
|
||||
await page.locator("#comp.ready").wait();
|
||||
await page.locator("#comp .trigger").click();
|
||||
await waitForText(page, "#comp .output", "it works");
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Deno.test({
|
||||
name: "islands - import json",
|
||||
fn: async () => {
|
||||
|
||||
Reference in New Issue
Block a user