diff --git a/src/compiler/compile/render_ssr/handlers/Element.ts b/src/compiler/compile/render_ssr/handlers/Element.ts index 5ef354a85a..35a15aff63 100644 --- a/src/compiler/compile/render_ssr/handlers/Element.ts +++ b/src/compiler/compile/render_ssr/handlers/Element.ts @@ -126,9 +126,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/binding-circular/_config.js b/test/runtime/samples/binding-circular/_config.js index 505ed22beb..3e58ab2f98 100644 --- a/test/runtime/samples/binding-circular/_config.js +++ b/test/runtime/samples/binding-circular/_config.js @@ -3,11 +3,5 @@ export default { - `, - - ssrHtml: ` - ` }; diff --git a/test/runtime/samples/binding-select-implicit-option-value/_config.js b/test/runtime/samples/binding-select-implicit-option-value/_config.js index cce1172f6a..1266602a47 100644 --- a/test/runtime/samples/binding-select-implicit-option-value/_config.js +++ b/test/runtime/samples/binding-select-implicit-option-value/_config.js @@ -14,16 +14,6 @@ export default {

foo: 2

`, - ssrHtml: ` - - -

foo: 2

- `, - async test({ assert, component, target, window }) { const select = target.querySelector('select'); const options = [...target.querySelectorAll('option')]; diff --git a/test/runtime/samples/binding-select-in-each-block/_config.js b/test/runtime/samples/binding-select-in-each-block/_config.js index 89f40f8d48..80ea375b78 100644 --- a/test/runtime/samples/binding-select-in-each-block/_config.js +++ b/test/runtime/samples/binding-select-in-each-block/_config.js @@ -1,17 +1,4 @@ export default { - - ssrHtml: ` - - - - `, - html: ` - - - - - -

selected: b

- `, - props: { selected: 'b' }, diff --git a/test/runtime/samples/binding-select-late-2/_config.js b/test/runtime/samples/binding-select-late-2/_config.js index 42c45d1366..f4b0088fb9 100644 --- a/test/runtime/samples/binding-select-late-2/_config.js +++ b/test/runtime/samples/binding-select-late-2/_config.js @@ -9,11 +9,6 @@ export default {

selected: two

`, - ssrHtml: ` - -

selected: two

- `, - test({ assert, component, target }) { component.items = [ 'one', 'two', 'three' ]; diff --git a/test/runtime/samples/binding-select-multiple/_config.js b/test/runtime/samples/binding-select-multiple/_config.js index b7d6c3589f..70a5620d05 100644 --- a/test/runtime/samples/binding-select-multiple/_config.js +++ b/test/runtime/samples/binding-select-multiple/_config.js @@ -4,16 +4,6 @@ export default { selected: [ 'two', 'three' ] }, - ssrHtml: ` - - -

selected: two, three

- `, - html: ` - - - - - -

selected: one

- `, - props: { selected: 'one' }, diff --git a/test/runtime/samples/bindings-global-dependency/_config.js b/test/runtime/samples/bindings-global-dependency/_config.js index 1180424e81..907aa52e6e 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 b287014065..f43a6834a8 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 d17b9e2d80..8bbdab17ee 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 b32d96db2e..be47d31d03 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 042bdca6ec..7beda8d3d5 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 3697e37441..2ba27bff03 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 6a931afeaf..0f8ff1809b 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 6c2538e564..2465b7d444 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 0000000000..8344e198fa --- /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 0000000000..7257d0f85e --- /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 0000000000..d634c4b80f --- /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 0000000000..5689bb8d9c --- /dev/null +++ b/test/server-side-rendering/samples/bindings-zero/main.svelte @@ -0,0 +1,6 @@ + + + + \ No newline at end of file