feat: more advanced prop serializer for islands (#1224)
This commit adds support for an advanced (de)serializer that is used for page state (island props and plugin state). This new serializer supports maintaining references (thus supporting circular objects, and multi-referenced objects). This is a pre-requisite for allowing to pass signals, JSX, Uint8Arrays, Date, and many other "advanced" values.
This commit is contained in:
@@ -33,7 +33,7 @@ Deno.test("/static page prerender", async () => {
|
||||
assertEquals(resp.status, Status.OK);
|
||||
const body = await resp.text();
|
||||
assertStringIncludes(body, '<style id="abc">body { color: red; }</style>');
|
||||
assert(!body.includes(`>[[],[]]</script>`));
|
||||
assert(!body.includes(`>{"v":[[],[]]}</script>`));
|
||||
assert(!body.includes(`import`));
|
||||
});
|
||||
|
||||
@@ -46,7 +46,7 @@ Deno.test("/with-island prerender", async () => {
|
||||
body,
|
||||
'<style id="abc">body { color: red; } h1 { color: blue; }</style>',
|
||||
);
|
||||
assertStringIncludes(body, `>[[{}],["JS injected!"]]</script>`);
|
||||
assertStringIncludes(body, `>{"v":[[{}],["JS injected!"]]}</script>`);
|
||||
assertStringIncludes(body, `/plugin-js-inject-main.js"`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user