diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index ad5c421bc4..e33ca9ea56 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -124,7 +124,7 @@ export default function(node: Element, renderer: Renderer, options: RenderOption node_contents = x`${snippet} || ""`; } else { const snippet = expression.node; - renderer.add_expression(x`@add_attribute("${name}", ${snippet}, 1)`); + renderer.add_expression(x`@add_attribute("${name}", ${snippet}, 0)`); } }); diff --git a/src/runtime/internal/ssr.ts b/src/runtime/internal/ssr.ts index 0e03afb0db..646a81d817 100644 --- a/src/runtime/internal/ssr.ts +++ b/src/runtime/internal/ssr.ts @@ -128,7 +128,7 @@ export function create_ssr_component(fn) { } export function add_attribute(name, value, boolean) { - if (value == null || (boolean && !value && value !== 0)) return ''; + if (value == null || (boolean && !value)) return ''; return ` ${name}${value === true ? '' : `=${typeof value === 'string' ? JSON.stringify(escape(value)) : `"${value}"`}`}`; } diff --git a/test/runtime/samples/apply-directives-in-order/_config.js b/test/runtime/samples/apply-directives-in-order/_config.js index e5e8980ed1..03cdc24645 100644 --- a/test/runtime/samples/apply-directives-in-order/_config.js +++ b/test/runtime/samples/apply-directives-in-order/_config.js @@ -9,7 +9,7 @@ export default { `, ssrHtml: ` - +

`, diff --git a/test/runtime/samples/binding-indirect-computed/_config.js b/test/runtime/samples/binding-indirect-computed/_config.js index 7519c4b0ed..9834d0a228 100644 --- a/test/runtime/samples/binding-indirect-computed/_config.js +++ b/test/runtime/samples/binding-indirect-computed/_config.js @@ -11,6 +11,14 @@ export default { `, + ssrHtml: ` + + `, + async test({ assert, component, target, window }) { const select = target.querySelector('select'); const options = target.querySelectorAll('option'); diff --git a/test/runtime/samples/binding-input-checkbox-deep-contextual-b/_config.js b/test/runtime/samples/binding-input-checkbox-deep-contextual-b/_config.js index 539a07312b..a4c9dacb6e 100644 --- a/test/runtime/samples/binding-input-checkbox-deep-contextual-b/_config.js +++ b/test/runtime/samples/binding-input-checkbox-deep-contextual-b/_config.js @@ -13,13 +13,13 @@ export default { ssrHtml: `
-

one

+

one

-

two

+

two

-

three

+

three

`, diff --git a/test/runtime/samples/binding-input-checkbox-deep-contextual/_config.js b/test/runtime/samples/binding-input-checkbox-deep-contextual/_config.js index 959b17777b..ed75021b67 100644 --- a/test/runtime/samples/binding-input-checkbox-deep-contextual/_config.js +++ b/test/runtime/samples/binding-input-checkbox-deep-contextual/_config.js @@ -25,10 +25,10 @@ export default {

one

-

two

+

two

-

three

+

three

1 completed

`, diff --git a/test/runtime/samples/binding-input-checkbox-with-event-in-each/_config.js b/test/runtime/samples/binding-input-checkbox-with-event-in-each/_config.js index b502ed40af..1ce561647f 100644 --- a/test/runtime/samples/binding-input-checkbox-with-event-in-each/_config.js +++ b/test/runtime/samples/binding-input-checkbox-with-event-in-each/_config.js @@ -17,6 +17,11 @@ export default { `, + ssrHtml: ` + + + `, + test({ assert, component, target, window }) { const { cats } = component; const newCats = cats.slice(); diff --git a/test/runtime/samples/binding-input-text-contextual-reactive/_config.js b/test/runtime/samples/binding-input-text-contextual-reactive/_config.js index 6fdfc4be52..91f243a8b6 100644 --- a/test/runtime/samples/binding-input-text-contextual-reactive/_config.js +++ b/test/runtime/samples/binding-input-text-contextual-reactive/_config.js @@ -26,7 +26,7 @@ export default { ssrHtml: `
- +

one

@@ -34,7 +34,7 @@ export default {

two

- +

three

diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js index f5ab04de78..78e5a4b267 100644 --- a/test/runtime/samples/bindings-global-dependency/_config.js +++ b/test/runtime/samples/bindings-global-dependency/_config.js @@ -1,3 +1,5 @@ export default { - html: '' + html: '', + + ssrHtml: '' }; \ No newline at end of file diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js index b287014065..862d71df5b 100644 --- a/test/runtime/samples/component-binding-computed/_config.js +++ b/test/runtime/samples/component-binding-computed/_config.js @@ -4,6 +4,11 @@ export default { `, + ssrHtml: ` + + + `, + async test({ assert, component, target, window }) { const input = new window.Event('input'); const inputs = target.querySelectorAll('input'); diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js index 042bdca6ec..4241401013 100644 --- a/test/runtime/samples/component-slot-spread-props/_config.js +++ b/test/runtime/samples/component-slot-spread-props/_config.js @@ -6,6 +6,13 @@ export default { `, + ssrHtml: ` +
+ +
+
+ `, + async test({ assert, component, target }) { component.value = 'foo'; diff --git a/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js b/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js index d5f3def7f1..5daeeb1792 100644 --- a/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js +++ b/test/runtime/samples/globals-not-overwritten-by-bindings/_config.js @@ -28,7 +28,7 @@ export default {
- +
`, diff --git a/test/runtime/samples/store-invalidation-while-update-1/_config.js b/test/runtime/samples/store-invalidation-while-update-1/_config.js index d0361d2d23..0c187e97df 100644 --- a/test/runtime/samples/store-invalidation-while-update-1/_config.js +++ b/test/runtime/samples/store-invalidation-while-update-1/_config.js @@ -6,6 +6,13 @@ export default { `, + ssrHtml: ` + +
+
simple
+ + `, + async test({ assert, component, target, window }) { const input = target.querySelector('input'); const button = target.querySelector('button'); diff --git a/test/runtime/samples/store-invalidation-while-update-2/_config.js b/test/runtime/samples/store-invalidation-while-update-2/_config.js index 422034bc11..aaa7e28333 100644 --- a/test/runtime/samples/store-invalidation-while-update-2/_config.js +++ b/test/runtime/samples/store-invalidation-while-update-2/_config.js @@ -6,6 +6,13 @@ export default { `, + ssrHtml: ` +
+
simple
+ + + `, + async test({ assert, component, target, window }) { const input = target.querySelector('input'); const button = target.querySelector('button');