diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index 03838039ad10..4357f963552f 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -119,9 +119,11 @@ export default function(node: Element, renderer: Renderer, options: RenderOption } else if (binding.name === 'value' && node.name === 'textarea') { const snippet = expression.node; node_contents = x`${snippet} || ""`; + } else if (binding.name === 'value' && node.name === 'select') { + // NOTE: do not add "value" attribute on +

`, diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js index 1180424e81db..907aa52e6e69 100644 --- a/test/runtime/samples/bindings-global-dependency/_config.js +++ b/test/runtime/samples/bindings-global-dependency/_config.js @@ -1,3 +1,4 @@ export default { - html: '' + html: '', + ssrHtml: '' }; diff --git a/test/runtime/samples/component-binding-computed/_config.js b/test/runtime/samples/component-binding-computed/_config.js index b2870140659c..f43a6834a883 100644 --- a/test/runtime/samples/component-binding-computed/_config.js +++ b/test/runtime/samples/component-binding-computed/_config.js @@ -3,6 +3,10 @@ export default { `, + ssrHtml: ` + + + `, async test({ assert, component, target, window }) { const input = new window.Event('input'); diff --git a/test/runtime/samples/component-binding-store/_config.js b/test/runtime/samples/component-binding-store/_config.js index d17b9e2d8098..8bbdab17ee50 100644 --- a/test/runtime/samples/component-binding-store/_config.js +++ b/test/runtime/samples/component-binding-store/_config.js @@ -4,6 +4,11 @@ export default {
`, + ssrHtml: ` + + +
+ `, async test({ assert, component, target, window }) { let count = 0; diff --git a/test/runtime/samples/component-slot-fallback-6/_config.js b/test/runtime/samples/component-slot-fallback-6/_config.js index b32d96db2e81..be47d31d0338 100644 --- a/test/runtime/samples/component-slot-fallback-6/_config.js +++ b/test/runtime/samples/component-slot-fallback-6/_config.js @@ -4,6 +4,10 @@ export default { {"value":""} `, + ssrHtml: ` + + {"value":""} + `, async test({ assert, target, window }) { const input = target.querySelector('input'); diff --git a/test/runtime/samples/component-slot-spread-props/_config.js b/test/runtime/samples/component-slot-spread-props/_config.js index 042bdca6ecec..7beda8d3d5a7 100644 --- a/test/runtime/samples/component-slot-spread-props/_config.js +++ b/test/runtime/samples/component-slot-spread-props/_config.js @@ -5,6 +5,12 @@ export default {
`, + ssrHtml: ` +
+ +
+
+ `, async test({ assert, component, target }) { component.value = 'foo'; diff --git a/test/runtime/samples/each-block-destructured-default-binding/_config.js b/test/runtime/samples/each-block-destructured-default-binding/_config.js index 3697e374412d..2ba27bff0361 100644 --- a/test/runtime/samples/each-block-destructured-default-binding/_config.js +++ b/test/runtime/samples/each-block-destructured-default-binding/_config.js @@ -4,7 +4,7 @@ export default { `, ssrHtml: ` - + `, 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 6a931afeaf13..0f8ff1809b06 100644 --- a/test/runtime/samples/store-invalidation-while-update-1/_config.js +++ b/test/runtime/samples/store-invalidation-while-update-1/_config.js @@ -5,6 +5,12 @@ export default {
simple
`, + ssrHtml: ` + +
+
simple
+ + `, async test({ assert, component, target, window }) { const input = target.querySelector('input'); 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 6c2538e564b4..2465b7d44495 100644 --- a/test/runtime/samples/store-invalidation-while-update-2/_config.js +++ b/test/runtime/samples/store-invalidation-while-update-2/_config.js @@ -5,6 +5,12 @@ export default { `, + ssrHtml: ` +
+
simple
+ + + `, async test({ assert, component, target, window }) { const input = target.querySelector('input'); diff --git a/test/server-side-rendering/samples/bindings-empty-string/_expected.html b/test/server-side-rendering/samples/bindings-empty-string/_expected.html new file mode 100644 index 000000000000..8344e198fad1 --- /dev/null +++ b/test/server-side-rendering/samples/bindings-empty-string/_expected.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/server-side-rendering/samples/bindings-empty-string/main.svelte b/test/server-side-rendering/samples/bindings-empty-string/main.svelte new file mode 100644 index 000000000000..7257d0f85e55 --- /dev/null +++ b/test/server-side-rendering/samples/bindings-empty-string/main.svelte @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/test/server-side-rendering/samples/bindings-zero/_expected.html b/test/server-side-rendering/samples/bindings-zero/_expected.html new file mode 100644 index 000000000000..d634c4b80f37 --- /dev/null +++ b/test/server-side-rendering/samples/bindings-zero/_expected.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/test/server-side-rendering/samples/bindings-zero/main.svelte b/test/server-side-rendering/samples/bindings-zero/main.svelte new file mode 100644 index 000000000000..5689bb8d9c48 --- /dev/null +++ b/test/server-side-rendering/samples/bindings-zero/main.svelte @@ -0,0 +1,6 @@ + + + + \ No newline at end of file