diff --git a/src/compile/render-ssr/handlers/AwaitBlock.ts b/src/compile/render-ssr/handlers/AwaitBlock.ts index 8405099521..05da3a4ad6 100644 --- a/src/compile/render-ssr/handlers/AwaitBlock.ts +++ b/src/compile/render-ssr/handlers/AwaitBlock.ts @@ -7,10 +7,10 @@ export default function(node, renderer: Renderer, options: CompileOptions) { renderer.render(node.pending.children, options); - renderer.append('`; return function(ctx) { return `'); + renderer.append('`; return function(' + (node.value || '') + ') { return `'); renderer.render(node.then.children, options); const snippet = snip(node.expression); - renderer.append(`\`;}(Object.assign({}, ctx, { ${node.value}: __value }));}(${snippet})) }`); + renderer.append(`\`;}(__value);}(${snippet})) }`); } \ No newline at end of file diff --git a/src/compile/render-ssr/handlers/InlineComponent.ts b/src/compile/render-ssr/handlers/InlineComponent.ts index a5f5f7d3ce..408286b6ac 100644 --- a/src/compile/render-ssr/handlers/InlineComponent.ts +++ b/src/compile/render-ssr/handlers/InlineComponent.ts @@ -70,7 +70,7 @@ export default function(node, renderer: Renderer, options) { .concat(binding_props.map(p => `{ ${p} }`)) .join(', ') })`; - } else if (node.attributes.length || binding_props.length) { + } else { props = stringifyProps( node.attributes .map(attribute => `${attribute.name}: ${getAttributeValue(attribute)}`) diff --git a/src/internal/ssr.js b/src/internal/ssr.js index fdce205100..a6eb13107b 100644 --- a/src/internal/ssr.js +++ b/src/internal/ssr.js @@ -1,5 +1,5 @@ import { set_current_component } from './lifecycle.js'; -import { run_all } from './utils.js'; +import { run_all, blankObject } from './utils.js'; export const invalidAttributeNameCharacter = /[\s'">\/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u; // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 @@ -74,7 +74,8 @@ export function create_ssr_component($$render) { on_mount: [], on_destroy: [], before_render: [], - after_render: [] + after_render: [], + callbacks: blankObject() }; set_current_component({ $$ }); diff --git a/test/runtime/samples/immutable-nested/_config.js b/test/runtime/samples/immutable-nested/_config.js index c45574e78e..e5c515fc78 100644 --- a/test/runtime/samples/immutable-nested/_config.js +++ b/test/runtime/samples/immutable-nested/_config.js @@ -1,7 +1,10 @@ export default { immutable: true, + html: `