diff --git a/CHANGELOG.md b/CHANGELOG.md index ccdf043a72..62306fdbdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Svelte changelog -## Unreleased +## 3.13.0 * New structured code generation, which eliminates a number of edge cases and obscure bugs ([#3539](https://github.com/sveltejs/svelte/pull/3539)) @@ -25,6 +25,23 @@ Also: * Throw exception immediately when calling `createEventDispatcher()` after component instantiation ([#3667](https://github.com/sveltejs/svelte/pull/3667)) * Fix globals shadowing contextual template scope ([#3674](https://github.com/sveltejs/svelte/issues/3674)) * Fix `` bindings to stores ([#3832](https://github.com/sveltejs/svelte/issues/3832)) +* Deconflict generated var names with builtins ([#3724](https://github.com/sveltejs/svelte/issues/3724)) +* Allow spring/tweened values to be initially undefined ([#3761](https://github.com/sveltejs/svelte/issues/3761)) +* Warn if using `` without `customElement: true` option ([#3782](https://github.com/sveltejs/svelte/pull/3782)) +* Add `Event` to list of known globals ([#3810](https://github.com/sveltejs/svelte/pull/3810)) +* Throw helpful error on empty CSS declaration ([#3801](https://github.com/sveltejs/svelte/issues/3801)) +* Support `easing` param on `fade` transition ([#3823](https://github.com/sveltejs/svelte/pull/3823)) +* Generate valid names from filenames with unicode characters ([#3845](https://github.com/sveltejs/svelte/issues/3845)) +* Don't generate any code for markup-less components ([#2200](https://github.com/sveltejs/svelte/issues/2200)) +* Deconflict with internal name `block` ([#3854](https://github.com/sveltejs/svelte/issues/3854)) +* Set attributes before bindings, to prevent erroneous assignments to `input.files` ([#3828](https://github.com/sveltejs/svelte/issues/3828)) +* Smarter unused CSS detection ([#3825](https://github.com/sveltejs/svelte/pull/3825)) +* Allow dynamic event handlers ([#3040](https://github.com/sveltejs/svelte/issues/3040)) +* Prevent erroneous `"undefined"` class name ([#3876](https://github.com/sveltejs/svelte/pull/3876)) +* Prevent resetting of `src` attribute unless changed ([#3579](https://github.com/sveltejs/svelte/pull/3579)) +* Prevent hydration of void element 'children' ([#3882](https://github.com/sveltejs/svelte/issues/3882)) +* Hoist globals even if mentioned in ` \ No newline at end of file diff --git a/test/runtime/samples/binding-input-range-change-with-max/_config.js b/test/runtime/samples/binding-input-range-change-with-max/_config.js new file mode 100644 index 0000000000..1fda90d83c --- /dev/null +++ b/test/runtime/samples/binding-input-range-change-with-max/_config.js @@ -0,0 +1,33 @@ +export default { + html: ` + + +

10 of 10

+ `, + + ssrHtml: ` + + +

10 of 10

+ `, + + async test({ assert, target, window }) { + const input = target.querySelector('input'); + assert.equal(input.value, '10'); + + // should not change because max is 10, input range behaviour + // seems there is bug in jsdom (HTMLInputElement-impl) which behaviour is different from real browsers + // input.value = '20'; + // assert.equal(input.value, '10'); + + const button = target.querySelector('button'); + await button.dispatchEvent(new window.Event('click')); + + assert.equal(input.value, '20'); + assert.htmlEqual(target.innerHTML, ` + + +

20 of 20

+ `); + }, +}; diff --git a/test/runtime/samples/binding-input-range-change-with-max/main.svelte b/test/runtime/samples/binding-input-range-change-with-max/main.svelte new file mode 100644 index 0000000000..b6c856976e --- /dev/null +++ b/test/runtime/samples/binding-input-range-change-with-max/main.svelte @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/test/runtime/samples/component-binding-reactive-statement/_config.js b/test/runtime/samples/component-binding-reactive-statement/_config.js new file mode 100644 index 0000000000..49342d0645 --- /dev/null +++ b/test/runtime/samples/component-binding-reactive-statement/_config.js @@ -0,0 +1,38 @@ +export default { + html: ` + + + `, + + async test({ assert, component, target, window }) { + const event = new window.MouseEvent('click'); + + const buttons = target.querySelectorAll('button'); + + await buttons[0].dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + + + `); + + await buttons[1].dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + + + `); + + // reactive update, reset to 2 + await buttons[0].dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + + + `); + + // bound to main, reset to 2 + await buttons[1].dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` + + + `); + } +}; diff --git a/test/runtime/samples/component-binding-reactive-statement/main.svelte b/test/runtime/samples/component-binding-reactive-statement/main.svelte new file mode 100644 index 0000000000..4253c6127e --- /dev/null +++ b/test/runtime/samples/component-binding-reactive-statement/main.svelte @@ -0,0 +1,19 @@ + + + + +