diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eeaf4acab..2c61470847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Svelte changelog +## 3.6.3 + +* Fix await block mounting inside removed if block ([#1496](https://github.com/sveltejs/svelte/issues/1496)) +* Update when element references are removed ([#2034](https://github.com/sveltejs/svelte/issues/2034)) +* Don't attempt to serialize non-string values in server-rendered bindings ([#2135](https://github.com/sveltejs/svelte/issues/2135)) +* Recognise dependencies in function expressions ([#2693](https://github.com/sveltejs/svelte/issues/2693)) +* Scope pseudo-class selectors without class/type ([#1705](https://github.com/sveltejs/svelte/issues/1705)) +* Allow nested at-rules ([#3135](https://github.com/sveltejs/svelte/issues/3135)) +* Allow attributes to contain `=` characters ([#3149](https://github.com/sveltejs/svelte/pull/3149)) + ## 3.6.2 * Fix placement of each-else block ([#2917](https://github.com/sveltejs/svelte/issues/2917)) diff --git a/package.json b/package.json index d2fd593515..1e278df9ba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "svelte", - "version": "3.6.2", + "version": "3.6.3", "description": "Cybernetically enhanced web apps", "module": "index.mjs", "main": "index", diff --git a/src/compiler/compile/css/Stylesheet.ts b/src/compiler/compile/css/Stylesheet.ts index 54427b183f..49f11bc1f2 100644 --- a/src/compiler/compile/css/Stylesheet.ts +++ b/src/compiler/compile/css/Stylesheet.ts @@ -269,7 +269,7 @@ export default class Stylesheet { this.has_styles = true; - const stack: Array = []; + const stack: Atrule[] = []; let depth = 0; let current_atrule: Atrule = null; diff --git a/src/compiler/compile/render_dom/wrappers/shared/bind_this.ts b/src/compiler/compile/render_dom/wrappers/shared/bind_this.ts index b321d6b022..571331fd4e 100644 --- a/src/compiler/compile/render_dom/wrappers/shared/bind_this.ts +++ b/src/compiler/compile/render_dom/wrappers/shared/bind_this.ts @@ -36,7 +36,7 @@ export default function bind_this(component: Component, block: Block, binding: B : deindent` ${lhs} = $$value; ${component.invalidate(object)}; - ` + `; } const contextual_dependencies = Array.from(binding.expression.contextual_dependencies); diff --git a/src/compiler/preprocess/index.ts b/src/compiler/preprocess/index.ts index 8543a56d18..6c069525ef 100644 --- a/src/compiler/preprocess/index.ts +++ b/src/compiler/preprocess/index.ts @@ -21,17 +21,17 @@ interface Processed { dependencies?: string[]; } -function parse_attribute_value(value: string) { - return /^['"]/.test(value) ? - value.slice(1, -1) : - value; -} - function parse_attributes(str: string) { const attrs = {}; str.split(/\s+/).filter(Boolean).forEach(attr => { - const [name, value] = attr.split('='); - attrs[name] = value ? parse_attribute_value(value) : true; + const p = attr.indexOf('='); + if (p === -1) { + attrs[attr] = true; + } else { + attrs[attr.slice(0, p)] = `'"`.includes(attr[p + 1]) ? + attr.slice(p + 2, -1) : + attr.slice(p + 1); + } }); return attrs; } diff --git a/test/preprocess/samples/attributes-with-equals/_config.js b/test/preprocess/samples/attributes-with-equals/_config.js new file mode 100644 index 0000000000..bee4928b1f --- /dev/null +++ b/test/preprocess/samples/attributes-with-equals/_config.js @@ -0,0 +1,5 @@ +export default { + preprocess: { + style: ({ attributes }) => attributes.foo && attributes.foo.includes('=') ? { code: '' } : null + } +}; diff --git a/test/preprocess/samples/attributes-with-equals/input.svelte b/test/preprocess/samples/attributes-with-equals/input.svelte new file mode 100644 index 0000000000..4e88284a29 --- /dev/null +++ b/test/preprocess/samples/attributes-with-equals/input.svelte @@ -0,0 +1,3 @@ + diff --git a/test/preprocess/samples/attributes-with-equals/output.svelte b/test/preprocess/samples/attributes-with-equals/output.svelte new file mode 100644 index 0000000000..c194ab682d --- /dev/null +++ b/test/preprocess/samples/attributes-with-equals/output.svelte @@ -0,0 +1 @@ +