status
stringclasses
1 value
repo_name
stringlengths
9
24
repo_url
stringlengths
28
43
issue_id
int64
1
104k
updated_files
stringlengths
8
1.76k
title
stringlengths
4
369
body
stringlengths
0
254k
βŒ€
issue_url
stringlengths
37
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[ns, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,447
["src/compiler/compile/render_dom/wrappers/IfBlock.ts", "test/js/samples/if-block-complex/expected.js", "test/js/samples/if-block-complex/input.svelte", "test/js/samples/transition-local/expected.js", "test/js/samples/transition-repeated-outro/expected.js", "test/runtime/samples/if-block-static-with-dynamic-contents/_config.js", "test/runtime/samples/if-block-static-with-dynamic-contents/main.svelte"]
Can not compile complex {#if}
While using a complex {#if} statement, svelte is compiling to invalid javascript. ```js <script> let item = { divider: [1], sub: { first: '/first', second: '/2', third: '/3' } } </script> {#each Object.entries(item.sub) as [subName, path], i} {#if (item.divider && item.divider.includes(i))} <div class="divider"></div> {/if} <a href="{path}">{subName}</a> {/each} ``` ``` Module parse failed: Unexpected token (285:7) File was processed with these loaders: * ./node_modules/svelte-loader/index.js You may need an additional loader to handle the result of these loaders. | | p(changed, ctx) { > if () show_if = (ctx.item.divider && ctx.item.divider.includes(ctx.i)) | | if (show_if) { ``` **To Reproduce** Look at the code produced in this REPL: https://svelte.dev/repl/8a129823894a48cb944245fb7bc1d6fe?version=3.9.1 you can see the error in the JS-output in line 71. **Expected behavior** Code compiles. **Severity** It was working in old versions, so now I have to downgrade.
https://github.com/sveltejs/svelte/issues/3447
https://github.com/sveltejs/svelte/pull/3478
85cfa52f53c1e0a8db50bf50d8fa8dcbffdac77a
d75b6388f3cfc261bdf09b5eb6e2e05224e296f0
2019-08-22T14:36:37Z
javascript
2019-09-04T01:30:16Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,433
["src/compiler/compile/render_dom/wrappers/Element/StyleAttribute.ts", "test/js/samples/inline-style-without-updates/expected.js", "test/js/samples/inline-style-without-updates/input.svelte"]
Style properties update unnecessarily
**Describe the bug** Svelte generates code that updates style properties when nothing could change. **To Reproduce** https://svelte.dev/repl/fa82902dbf5e442a92217e6d6fa6c078?version=3.8.1 **Expected behavior** Given this code... ```svelte <script> let color = 'red'; </script> <h1 class={color} style="color: {color}">color: {color}</h1> ``` ...no update could should be generated, since `color` could not change. This works correctly for regular attributes: ```diff return { c() { h1 = element("h1"); t0 = text("color: "); t1 = text(color); attr(h1, "class", "" + null_to_empty(color) + " svelte-1fyrt1w"); set_style(h1, "color", color); }, m(target, anchor) { insert(target, h1, anchor); append(h1, t0); append(h1, t1); }, - p(changed, ctx) { - if (changed.color) { - set_style(h1, "color", color); - } - }, - + p: noop, i: noop, o: noop, d(detaching) { if (detaching) { detach(h1); } } }; ``` **Severity** Minor
https://github.com/sveltejs/svelte/issues/3433
https://github.com/sveltejs/svelte/pull/3439
d42a8627cd8da102f67176a5549d5d8248dc2f3c
860040a7fad9cff8297cb2a72dbba0be9a100279
2019-08-20T03:18:00Z
javascript
2019-08-21T02:04:18Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,421
["CHANGELOG.md", "src/compiler/compile/render_dom/wrappers/Element/index.ts", "test/runtime/samples/spread-element-class/_config.js", "test/runtime/samples/spread-element-class/main.svelte"]
class:name={ true } in combination with spread arguments is deleted on update
**Describe the bug** `class:name={ true }` in combination with spread arguments is deleted on spread arguments update **To Reproduce** REPL https://svelte.dev/repl/ff608fce63184816a57bbb5ae0ea7bd3?version=3.8.1 **Additional context** ```html <h1 class="cls" class:red={ true } { ...{ style } }> ``` update function is ```js p(changed, ctx) { set_attributes(h1, get_spread_update(h1_levels, [ { class: "cls svelte-kwtnbw" }, (changed.style) && { style: ctx.style } ])); }, ``` Because `get_spread_update` change `class` attribute and there is no toggle class call for `red` class, `red` class is deleted. Good solution is to compile truthy values of `class:name={truthy}` like static.
https://github.com/sveltejs/svelte/issues/3421
https://github.com/sveltejs/svelte/pull/3781
8c0c15c3aa12ba73225e83954c7c59d0599913dd
0419039d26cd9556f94c79c1dc3e584e192f3f32
2019-08-17T20:46:57Z
javascript
2019-10-24T12:18:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,391
[".gitignore", "mocha.coverage.opts"]
Fix test coverage
**Describe the bug** Starting from "update deps" commit (https://github.com/sveltejs/svelte/commit/7e01c3c4f82d1327ed2406a47987a1fbcb06059e) travis ci silently fails on "after_success" phase. **Logs** ` βœ– ERROR: --compilers is DEPRECATED and no longer supported. See https://git.io/vdcSr for migration information. ` **To Reproduce** Just run `npm run codecov` **Expected behavior** Script should finish without any errors. **Information about your Svelte project:** - Svelte 3.7.1 **Severity** Minor
https://github.com/sveltejs/svelte/issues/3391
https://github.com/sveltejs/svelte/pull/3392
2ef004e324c31585522c025b4026100960a1c0bc
1580fd0c86dccf28ba310c066bf1608214616075
2019-08-11T09:22:24Z
javascript
2019-08-11T14:19:35Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
4,202
["CHANGELOG.md", "src/compiler/compile/render_dom/wrappers/EachBlock.ts", "test/hydration/samples/each-else/_after.html", "test/hydration/samples/each-else/_before.html", "test/hydration/samples/each-else/main.svelte"]
The content of `else` part in `each` block repeats
You can reproduce it by following these steps: 1. start with `sapper-template#rollup` 2. modify the file `routes/index.svelte` as: ``` <script> let array = [] </script> {#each array as elem} item {:else} weird {/each} ``` Until now everything works fine. You will see one "weird" on the page. 3. remove the file `routes/_layout.svelte` After refreshing the page (manually), you will see **two** "weird"s! 4. if you append something to the file `routes/index.svelte`, make it like ``` <script> let array = [] </script> {#each array as elem} item {:else} weird {/each} blah blah ... ``` then everything just works fine again.
https://github.com/sveltejs/svelte/issues/4202
https://github.com/sveltejs/svelte/pull/4253
a422d2aba5661d9f9ca54db8a1e7b11692d4cde4
7c3e34c00bb585b05104c13a03d3606427cb0457
2019-08-10T03:31:52Z
javascript
2020-01-12T20:42:45Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,382
["src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "test/runtime/samples/component-binding-reactive-statement/Button.svelte", "test/runtime/samples/component-binding-reactive-statement/_config.js", "test/runtime/samples/component-binding-reactive-statement/main.svelte"]
Prop binding goes out of sync when reactively updated
**Describe the bug** If a bound prop is immediately updated as the result of state propagating upward, that update does not propagate downward. **To Reproduce** [REPL](https://svelte.dev/repl/74f3946d44ac43038afb24069bf64af5?version=3.6.1) Clicking the `RefactoredButton` causes the internal state of `RefactoredButton` and `value` to go out of sync. **Expected behavior** The update to `value` should propagate downward to `RefactoredButton`. The behavior of clicking the inline button and the refactored component should be the same. **Severity** The workaround for this is relatively simple (just wrap the update in a `requestAnimationFrame`), but it's still frustrating and unexpected behavior.
https://github.com/sveltejs/svelte/issues/3382
https://github.com/sveltejs/svelte/pull/3886
5c08465cfa3321010e71394fe4fa6aae2722200e
9500282c7a08809133a2517a13c9ca259bddabcf
2019-08-08T20:43:48Z
javascript
2019-11-10T21:27:07Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,375
["CHANGELOG.md", "src/compiler/compile/render_dom/Renderer.ts", "src/compiler/compile/render_dom/invalidate.ts", "src/compiler/compile/render_ssr/index.ts", "test/runtime/samples/reactive-assignment-in-complex-declaration-with-store-2/_config.js", "test/runtime/samples/reactive-assignment-in-complex-declaration-with-store/_config.js", "test/runtime/samples/store-assignment-updates-property/_config.js", "test/runtime/samples/store-auto-resubscribe-immediate/_config.js", "test/runtime/samples/store-auto-resubscribe-immediate/main.svelte"]
get_store_value() called twice in SSR mode
**Describe the bug** I was playing around with trying to repro a bug I'm seeing in SSR mode and happened to notice something weird in the output. Not critical, mind you, but still probably worth fixing? **To Reproduce** [REPL repro](https://svelte.dev/repl/d330749826a643cca26d557d1983a623?version=3.7.1) Open that REPL link, switch to the "JS Output" tab, and switch from DOM to SSR mode to see the issue. ```js const App = create_ssr_component(($$result, $$props, $$bindings, $$slots) => { let $style; let style = readable("foo"); $style = get_store_value(style); $style = get_store_value(style); return `${escape($style)}`; }); ``` **Expected behavior** I don't think `$style = get_store_value(style);` should be output twice. **Information about your Svelte project:** - Svelte 3.7.1 **Severity** Not very
https://github.com/sveltejs/svelte/issues/3375
https://github.com/sveltejs/svelte/pull/5419
2eda5b0bf37c7376f29d141dc7bae5969ea3a3c2
82fcdfc2fa0321cd1014fe9e5c9d79b8454f2f15
2019-08-08T04:42:41Z
javascript
2021-01-04T19:41:11Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,364
["CHANGELOG.md", "src/compiler/compile/render_dom/wrappers/Slot.ts", "test/runtime/samples/props-reactive-slot/Comp.svelte", "test/runtime/samples/props-reactive-slot/_config.js", "test/runtime/samples/props-reactive-slot/main.svelte"]
Slot not reactive when using $$props (regression)
**Describe the bug** changes in $$props no longer causes a slot to re-render even if the slot has properties that derive from $$props. **To Reproduce** Simple reflection of props fails in 3.7.1 https://svelte.dev/repl/43683d712ec940d7adbddb358106b0ee?version=3.7.1 **Expected behavior** when you click the button the text should change from "hi" to "changed" like it does in 3.6.1 https://svelte.dev/repl/43683d712ec940d7adbddb358106b0ee?version=3.6.1 I think this was caused by same refactor as https://github.com/sveltejs/svelte/issues/3354 in that $$props is not seen as dynamic (it is added the dynamic attributes, but skipped when considering the slot redraw) **Severity** I have worked around it by introducing a reactive variable like: `$: p = $$props` and referencing that in the slot e.g. https://svelte.dev/repl/83a137e2188c430884d19ccfb311b14d?version=3.7.1
https://github.com/sveltejs/svelte/issues/3364
https://github.com/sveltejs/svelte/pull/5125
8a8177b89739dc97aa7e1e5377c3ba2dbc72ddb0
fc7e99e9f0239075279aceea2409310a72526543
2019-08-07T03:04:55Z
javascript
2020-07-13T16:03:12Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,352
["site/content/docs/01-component-format.md"]
Document `-global-` prefix for global CSS Animations
Hi, When working with Google Maps, you create custom Markers with a `createMarker` function which takes in the marker's HTML as a string. That means if you want to apply styles or transitions to it, you need to use the `:global` tag in Svelte. I'd like to apply small animations to the markers on certain conditions, but it appears that I can't apply a CSS animation (e.g. `@keyframes animation_name {...}` in the Svelte component using the `:global` tag. When I tried, Svelte yelled at me with an `Expected Identifier` error. I'd like this functionality to be enabled if possible. It's not super-critical since I can just put the css animation in my `global.css` file, and it's a very uncommon use case, but it would be nice πŸ˜„ .
https://github.com/sveltejs/svelte/issues/3352
https://github.com/sveltejs/svelte/pull/4232
b9368d5de487c97c24de82226e054469ecd1b01a
3d9655a2a186d18c366149d218cf67c75b722433
2019-08-04T15:08:24Z
javascript
2020-01-08T22:19:19Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,341
["src/compiler/compile/render_dom/wrappers/Element/Attribute.ts", "test/runtime/samples/innerhtml-interpolated-literal/_config.js", "test/runtime/samples/innerhtml-interpolated-literal/main.svelte"]
Commas in generated HTML
**Describe the bug** When portions of markup are turned into HTML, attributes with interpolated literals (insofar as that's not an oxymoron) contain unwanted commas **To Reproduce** ```svelte <div> <span class="a/{42}"/> </div> ``` This needs to be compiled in production mode, since elements are never converted to static HTML in dev mode. https://svelte.dev/repl/bf37bbf244594248b444a50ad3b95c73?version=3.6.10 **Expected behavior** The chunks of the attribute should be concatenated without commas **Severity** Low, since attributes with interpolated literals are somewhat rare. **Additional context** In a case like this... ```svelte <script> const answer = 42; </script> <div> <span class="a/{answer}"/> </div> ``` ...Svelte should recognise that `answer` cannot change, and so it's ok to use innerHTML: ```diff -span = element("span"); -attr(span, "class", span_class_value = "a/" + answer); +div.innerHTML = `<span class="a/${answer}"></span>`; // ... -append(div0, span); ```
https://github.com/sveltejs/svelte/issues/3341
https://github.com/sveltejs/svelte/pull/3342
fb37b062866d271fcb4652fffcaf20fd72a46c40
bc5aca0ffea04cd1b7d34d3451e75de0ae687f9f
2019-08-03T15:42:57Z
javascript
2019-08-03T17:37:58Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,337
["src/compiler/compile/render_dom/wrappers/Element/Attribute.ts", "test/js/samples/bind-open/expected.js", "test/js/samples/do-use-dataset/expected.js"]
`dataset` optimization does not respect null indicating to remove the attribute
**Describe the bug** `data-foo={bar}` should, like other attribute settings, remove the attribute when setting it to a value of `null` or `undefined`. The optimization (used unless `legacy` is enabled) of instead assigning to the `dataset` object prevents this. **To Reproduce** ```svelte <script> let name = 'world'; let toggle = false; </script> <input type='checkbox' bind:checked={toggle}> <h1 data-foo={toggle ? name : null}>Hello {name}!</h1> ``` **Expected behavior** The `data-foo` attribute should be not present when the checkbox is unchecked, not the string `'null'`. **Severity** Not personally affecting me. **Additional context** Came up in regard to [this question](https://github.com/sveltejs/svelte/issues/966#issuecomment-517905884). I believe this should be the way to handle that, but it doesn't work.
https://github.com/sveltejs/svelte/issues/3337
https://github.com/sveltejs/svelte/pull/3346
d6ca507240c5ae3be258ed92a2afcff4f6a5731c
64094f631fafb752418db85a5d4bbabc03e54642
2019-08-03T10:17:16Z
javascript
2019-08-03T17:55:43Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,331
["src/compiler/compile/nodes/Element.ts", "test/validator/samples/a11y-alt-text/input.svelte"]
Not accepting PayPal input image statement with an alt message.
**Describe the bug** I have a component that uses an input type image and it has an alt message also. But the svelte compiler is constantly warning that it needs an alt message. **Logs** ``` (!) Plugin svelte: A11y: <input type="image"> element should have an alt, aria-label or aria-labelledby attribute src/components/Donate.svelte <input type="image" alt="PayPal: A safe way to make donations." src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit"> ``` **To Reproduce** Have a component with the the html for a PayPal donate button. It will always generate the error when you compile. But, since it's a warning, I still get the processed files okay. * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. **Expected behavior** It should compile without errors since the input image element has an alt message. **Information about your Svelte project:** - Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10) NW.js version 40 - Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc) Macos Mogave - Svelte version (Please check you can reproduce the issue with the latest release!) 3.6.8 - Whether your project uses Webpack or Rollup Rollup 1.17 **Severity** How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Svelte entirely? It's just very annoying. I hate to have error messages/warnings. Note: the more honest and specific you are here the more we will take you seriously. **Additional context** Add any other context about the problem here.
https://github.com/sveltejs/svelte/issues/3331
https://github.com/sveltejs/svelte/pull/3332
6cbdd9b04cf1ce204d249c2061c1c50ba81b560d
9e1554610bbdca5ba1f76fc10e5cbb47a43005fb
2019-08-02T14:47:33Z
javascript
2019-08-03T16:15:07Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,324
["src/runtime/internal/environment.ts"]
Regression: requestAnimationFrame called in server environment
**Describe the bug** `requestAnimationFrame` is called by `spring` and `tweened` (via `loop`) when components are rendered server-side. This makes it impossible to do this sort of thing... ```svelte <script> import { spring } from 'svelte/motion'; export let on; const x = spring(on ? 100 : 0); $: x.set(on ? 100 : 0); </script> ``` ...because it errors during rendering (since `requestAnimationFrame` is immediately called). This was fixed in #2856 but apparently undone in #2994 β€” @mrkishi, @Conduitry, just want to check this wasn't intentional before I update [this](https://github.com/sveltejs/svelte/blob/b0604b52a3bf38e13f32a13f151956db10599176/src/runtime/internal/environment.ts#L7)? **Severity** Inconvenient
https://github.com/sveltejs/svelte/issues/3324
https://github.com/sveltejs/svelte/pull/3334
9e1554610bbdca5ba1f76fc10e5cbb47a43005fb
76d04dce9b376064d6e7bab05fecea20d87ec5b7
2019-07-31T16:32:19Z
javascript
2019-08-03T16:15:51Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,322
["src/compiler/compile/render_ssr/handlers/Slot.ts", "test/runtime/samples/component-slot-let-missing-prop/Bar.svelte", "test/runtime/samples/component-slot-let-missing-prop/Foo.svelte", "test/runtime/samples/component-slot-let-missing-prop/_config.js", "test/runtime/samples/component-slot-let-missing-prop/main.svelte"]
Confusing SSR error when `let:foo` has no corresponding `<slot foo={...}>`
**Describe the bug** A component with slotted contents will fail to render if it has a `let:` directive but the corresponding `<slot>` has no properties. **To Reproduce** [This REPL demo](https://svelte.dev/repl/49963e1550274855a2ad2f45ca786a59?version=3.6.10) contains the bug, though it's not directly visible since it's SSR-only. The offending code is this: ```js return `${$$slots.default ? $$slots.default() : ``}`; ``` `$$slots.default` corresponds to this: ```js return `${validate_component(Foo, 'Foo').$$render($$result, {}, {}, { default: ({ id }) => ` ${validate_component(Bar, 'Bar').$$render($$result, { thing: things[id] }, {}, {})} ` })}` ``` This fails with > TypeError: Cannot destructure property `id` of 'undefined' or 'null'. **Expected behavior** It might be nice if a warning was printed about the missing property. But the easy immediate fix is to always pass an object, i.e. `$$slots.default({})`. This way there's no disparity between `<slot>` and `<slot someOtherProperty="whatever">`. **Severity** Minor annoyance
https://github.com/sveltejs/svelte/issues/3322
https://github.com/sveltejs/svelte/pull/3428
51498421bb2803b5126e1286ef5cf061074bf031
ee1fa87c7568c447e0a3bde0c91cc2e0b8240593
2019-07-31T15:12:08Z
javascript
2019-08-20T12:23:28Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,321
["src/compiler/compile/nodes/Element.ts", "test/runtime/samples/svg-slot-namespace/Widget.svelte", "test/runtime/samples/svg-slot-namespace/_config.js", "test/runtime/samples/svg-slot-namespace/main.svelte"]
SVG elements in <slot> not rendered as SVG elements
**Describe the bug** I have a component that is basically an `<svg>` with a `<slot>` the idea being that it's easy to pass some svg tags to the component and have them all rendered the same. This works fine as long as the SVG is passed as an HTML string. `{@html '<rect x=0 y=0 width=20 height=20/>'}` but if it's passed as an element, it no longer works. This doesn't work: ```html <Icon> <rect x=0 y=0 width=20 height=20/> </Icon> ``` This does work: ```html <Icon> {@html '<rect x=0 y=0 width=20 height=20/>'} </Icon> ``` **To Reproduce** Icon component ```html <svg {width} {height} viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" stroke-linecap="round" stroke-linejoin="round" stroke-width={strokeWidth} {stroke} {fill}> <slot></slot> </svg> ``` **Expected behavior** SVG elements should be rendered as SVG. **Information about your Svelte project:** - Tested on Chrome 76 - MacOS Mojave - Svelte version 3.6.10 - Rollup **Severity** Annoying, results in less readable code. Also, I wonder if this impacts the binary size in any way. I suspect this issue is related, but was closed. https://github.com/sveltejs/svelte/issues/2557
https://github.com/sveltejs/svelte/issues/3321
https://github.com/sveltejs/svelte/pull/3403
4f26363fe0af69b85b84d3c2d9e5d4fe5dc249d6
626b8335c2d8b028c120558643cb6e9b0da922cd
2019-07-31T15:06:07Z
javascript
2019-08-15T01:04:34Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,312
["src/compiler/compile/render_ssr/handlers/InlineComponent.ts", "test/runtime/samples/prop-quoted/Nested.svelte", "test/runtime/samples/prop-quoted/_config.js", "test/runtime/samples/prop-quoted/main.svelte"]
Illegal property names aren't quoted for SSR
**Describe the bug** A component can have a property like `<Foo x-y-z={42}/>`, and it will ordinarily be quoted by the compiler: ```js var foo = new Foo({ props: { "x-y-z": 42 } }); ``` In SSR mode, we get this instead: ```js return `${validate_component(Foo, 'Foo').$$render($$result, { x-y-z: 42 }, {}, {})}`; ``` This is somewhat contrived (you can only access that property via `$$props['x-y-z']`), but it's a situation I've managed to encounter, and it's easily fixed. **To Reproduce** [Voila](https://svelte.dev/repl/07c5045a1d8044ccbba9989ea8198b05?version=3.6.9) **Severity** I mean... probably not the highest. But like I say, easy fix
https://github.com/sveltejs/svelte/issues/3312
https://github.com/sveltejs/svelte/pull/3314
dbf503b9e1ed2f4cdebb134b8f2125f67d3d8b86
0d3b7c35c3a182322aa20d1f5d42b40f6a48f1e2
2019-07-30T16:15:05Z
javascript
2019-07-30T18:49:12Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,304
["src/compiler/compile/render_dom/index.ts", "src/runtime/internal/ssr.ts", "src/runtime/internal/utils.ts", "src/runtime/store/index.ts", "test/runtime/samples/store-resubscribe-observable/_config.js", "test/runtime/samples/store-resubscribe-observable/main.svelte"]
Observable-as-store error on reassignment
**Describe the bug** Reassigning an observable-as-store variable results in an error `$$unsubscribe_NAMEHERE is not a function`. It appears that currently observables can be used only in certain undocumented restricted ways, perhaps only as long as such variables are never reassigned? **To Reproduce** https://svelte.dev/repl/c73aa3a571844702baa8538c80376603?version=3.6.9 ``` <script> import { of } from 'rxjs'; let myObs = of([1, 2, 3, 4, 5]); myObs = of([6, 7, 8, 9, 10]); </script> {$myObs} ``` **Expected behavior** Runs without error. **Severity** It's not severe at all if you never use RxJS, but it's a pretty significant restriction if you do (!). Fixing this seems necessary to declare reasonably observable-as-store support.
https://github.com/sveltejs/svelte/issues/3304
https://github.com/sveltejs/svelte/pull/3315
313f56c13f31b5b69269693520601bf60272363c
6cbdd9b04cf1ce204d249c2061c1c50ba81b560d
2019-07-28T17:15:09Z
javascript
2019-08-03T16:13:23Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,289
["src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "test/runtime/samples/spread-reuse-levels/Nested.svelte", "test/runtime/samples/spread-reuse-levels/_config.js", "test/runtime/samples/spread-reuse-levels/main.svelte"]
Spread props cause unnecessary changes
**Describe the bug** Inline expressions are re-evaluated when setting spread props on a component. **To Reproduce** https://svelte.dev/repl/38ab6eb9233a4d8c97e67d576e063109?version=3.6.8 **Expected behavior** Waggling the slider should only cause `a` to show up as having changed. With the spread version, `c` also appears to have changed. **Severity** Mildly annoying. Could result in incorrect behaviour (as opposed to mere redundant work) **Additional context** This could be fixed like so: ```diff var nested1_changes = (changed.x || changed.a || changed.b) ? get_spread_update(nested1_spread_levels, [ (changed.x) && ctx.x, (changed.a) && { a: ctx.a }, (changed.b) && { b: ctx.b }, - { c: [1] }, - { d: "string" } + nested1_spread_levels[3], + nested1_spread_levels[4] ]) : {}; nested1.$set(nested1_changes); ```
https://github.com/sveltejs/svelte/issues/3289
https://github.com/sveltejs/svelte/pull/3294
ea7f61542be8565296df3f07a66f6d5c37d8314f
df33187115918ed26d3ffde0e35c3a5e7ccbf21d
2019-07-25T19:54:14Z
javascript
2019-07-30T18:27:48Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,286
["src/compiler/compile/render_dom/index.ts", "test/runtime/samples/props-reactive-b/_config.js", "test/runtime/samples/props-reactive-b/main.svelte"]
Reactive declarations with $$props don't refire if they reference other values
**Describe the bug** Reactive declarations that refer to `$$props` should fire whenever any prop changes. Currently, this only holds true if the declaration doesn't reference anything else **To Reproduce** https://svelte.dev/repl/b51ee924d6ca407ebed0da276a8cc946?version=3.6.8 **Expected behavior** Waggling either slider should cause things to be logged to the console. **Severity** It's blocking progress on Svelte GL
https://github.com/sveltejs/svelte/issues/3286
https://github.com/sveltejs/svelte/pull/3295
df33187115918ed26d3ffde0e35c3a5e7ccbf21d
620d26cad3ea33271e3ff0d998b26d2016be3fe0
2019-07-24T20:35:42Z
javascript
2019-07-30T18:28:05Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,281
["src/compiler/compile/css/Selector.ts", "test/css/samples/attribute-selector-bind/expected.css", "test/css/samples/attribute-selector-bind/input.svelte"]
`details bind:open` should count as `[open]` for styling
```svelte <script> let open = false; </script> <details bind:open>Hello</details> <style> details[open] { color: red; } </style> ``` `details[open]` is getting removed because the compiler doesn't think that `<details bind:open>` indicates an `open` attribute that might be present.
https://github.com/sveltejs/svelte/issues/3281
https://github.com/sveltejs/svelte/pull/3335
21e3db1b72637f77a09cb041bef89e83754eb9b1
aa1b38ad34bfd5c3a877c1be28784af6543d6c40
2019-07-23T13:56:05Z
javascript
2019-08-03T16:27:51Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,274
["src/compiler/compile/nodes/EachBlock.ts", "test/validator/samples/undefined-value/input.svelte", "test/validator/samples/undefined-value/warnings.json"]
References to each index in keying expression seen as undeclared
From https://github.com/sveltejs/eslint-plugin-svelte3/issues/37 Something like ```svelte {#each foo as bar, i (i)}hey{/each} ``` produces an erroneous warning that `i` is not defined. The key seems to be created correctly from the each block's `ctx.i` - there's just an incorrect warning from the compiler about it.
https://github.com/sveltejs/svelte/issues/3274
https://github.com/sveltejs/svelte/pull/3336
aa1b38ad34bfd5c3a877c1be28784af6543d6c40
cf24dbd6a953e8dd09f7d3ba632e33a206a76858
2019-07-21T11:40:55Z
javascript
2019-08-03T16:30:21Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,272
["src/compiler/compile/Component.ts", "test/validator/samples/dollar-dollar-global-in-markup/errors.json", "test/validator/samples/dollar-dollar-global-in-markup/input.svelte", "test/validator/samples/dollar-dollar-global-in-script/errors.json", "test/validator/samples/dollar-dollar-global-in-script/input.svelte", "test/validator/samples/dollar-global-in-markup/errors.json", "test/validator/samples/dollar-global-in-markup/input.svelte", "test/validator/samples/dollar-global-in-script/errors.json", "test/validator/samples/dollar-global-in-script/input.svelte"]
Variable called `$` allowed by compiler and produces invalid output
```svelte <script> $; </script> ``` Variables called simply `$` are currently allowed and are assumed to be subscriptions to a variable with the empty string as the name, which results in syntactically incorrect output. The simplest solution would probably be to disallow this at parse time.
https://github.com/sveltejs/svelte/issues/3272
https://github.com/sveltejs/svelte/pull/3348
57aa46a7fe1a6feca5d5e84b41d05f362a0ca98e
e41a4846c3b3de4f997f6bc55e71a1925faaadd3
2019-07-20T19:19:40Z
javascript
2019-08-04T21:51:37Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,271
["site/content/docs/03-run-time.md", "site/content/tutorial/15-context/01-context-api/text.md"]
Docs: Explain that context values can be stores
The API docs and/or the tutorial should mention that, because of the way you need to set and get contexts only at the top level of a component, they're inherently not reactive - but that you can make them store instances if you need reactivity. cc @arggh
https://github.com/sveltejs/svelte/issues/3271
https://github.com/sveltejs/svelte/pull/3296
e82d5d44c163ec24bb1f555be8196704de29a588
fcfad5ae6bc0d715ac2e5938351bc792442fc238
2019-07-20T12:31:40Z
javascript
2019-07-27T01:01:45Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,228
["src/compiler/compile/css/Stylesheet.ts", "test/css/samples/global-keyframes-with-no-elements/expected.css", "test/css/samples/global-keyframes-with-no-elements/input.svelte"]
Global keyframes with no elements not rendered properly
**Reproduce**: https://svelte.dev/repl/fa0c4efb2ae043d78a8d9ed97d1badc1?version=3.6.7 **Issue**: keyframe selectors are eaten
https://github.com/sveltejs/svelte/issues/3228
https://github.com/sveltejs/svelte/pull/3229
6cba41d3e8515f4b7d16cceeef54bae73d49e77f
be30a4c66c145cdaffb2ab55dcc510ca28c071e3
2019-07-12T10:33:41Z
javascript
2019-07-23T11:27:42Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,226
["src/compiler/compile/render_dom/wrappers/Element/index.ts", "test/js/samples/input-files/expected.js"]
bind:files doesn't work on safari. But works in chrome
<!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> --> Here's the repl. https://svelte.dev/repl/61c6df2593cf4667ac36fb4c75c56012?version=3.6.7 ``` <script> let name = 'world'; let files = [] $: { console.log(files) } </script> <input type="file" accept="image/*" class="w-full h-full cursor-pointer" bind:files /> ``` Tried to open console. And then input a file. On chrome it should log something. But on safari it's not working
https://github.com/sveltejs/svelte/issues/3226
https://github.com/sveltejs/svelte/pull/3305
620d26cad3ea33271e3ff0d998b26d2016be3fe0
dbf503b9e1ed2f4cdebb134b8f2125f67d3d8b86
2019-07-12T00:50:32Z
javascript
2019-07-30T18:28:32Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,215
["CHANGELOG.md", "src/compiler/compile/Component.ts", "test/vars/samples/modules-vars/_config.js", "test/vars/samples/modules-vars/input.svelte"]
Reassigned/mutated module variable not marked as such
```svelte <script context='module'> let foo = {}; let bar = {}; foo = 1; bar.x = 1; </script> <script> foo = 2; bar.x = 2; </script> ``` results in a `vars` value of ```js [ { name: 'foo', export_name: null, injected: false, module: true, mutated: false, reassigned: false, referenced: false, writable: true }, { name: 'bar', export_name: null, injected: false, module: true, mutated: false, reassigned: false, referenced: false, writable: true } ] ```
https://github.com/sveltejs/svelte/issues/3215
https://github.com/sveltejs/svelte/pull/4469
f244b80f7a80df54aa07f85c35720fa6ca880318
cf660bdab1367aa9207df27338498a063223e959
2019-07-10T18:19:21Z
javascript
2020-02-29T14:17:06Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,206
["src/runtime/internal/dom.ts"]
Focus (document.activeElement) gets lost when using bind:clientWidth
When tabbing through UI, the focus gets lost inside the `<object>` created to track the size of the element. Example: https://svelte.dev/repl/f8b72fe0b5464edda16b0ef7a60ef88d?version=3.6.5 ![Screen Shot 2019-07-09 at 10 27 53](https://user-images.githubusercontent.com/10400154/60877243-5e441f80-a235-11e9-828b-d6738d0ff291.png)
https://github.com/sveltejs/svelte/issues/3206
https://github.com/sveltejs/svelte/pull/3210
f2d25828d544d61d4f094db2571f4cf6690c432e
0be4e281300b5ada761441f5765a5b45da9ff405
2019-07-09T09:38:49Z
javascript
2019-07-10T12:27:49Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,191
["src/runtime/store/index.ts", "test/js/samples/bind-open/expected.js", "test/store/index.ts"]
Derived stores with multiple dependencies don't always update.
When a store has multiple dependencies it won't always update when those dependencies update. This is only present when one of the dependencies is derived from the other dependency (I think). [REPL](https://svelte.dev/repl/d5be7933a44b455babd4c06943707c66?version=3.6.4) Thanks to @Conduitry's detective work, it seems like this bug was possibly introduced by #2955.
https://github.com/sveltejs/svelte/issues/3191
https://github.com/sveltejs/svelte/pull/3219
729fc4e891160e1398874efb16baed4e66b70d6b
7dee7fa117f51b9c73b84c9f4c8ffa81f1eacb81
2019-07-06T17:04:11Z
javascript
2019-07-26T13:08:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,185
["src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "test/runtime/samples/spread-component-literal/Widget.svelte", "test/runtime/samples/spread-component-literal/_config.js", "test/runtime/samples/spread-component-literal/main.svelte"]
Using literal when spreading props generates invalid code
```svelte <Foo {...{ bar: 42 }}/> ``` generates ```js var foo_changes = () ? get_spread_update(foo_spread_levels, [ { bar: 42 } ]) : {}; ``` because `{ bar: 42 }` has no dependencies.
https://github.com/sveltejs/svelte/issues/3185
https://github.com/sveltejs/svelte/pull/3380
804db10404a54bfb7a768bb8b3e954acc6d8d600
f26a15fd98c15c7b8210311e67215ef1d214b385
2019-07-05T23:11:02Z
javascript
2019-08-11T14:30:31Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,182
["src/compiler/compile/nodes/Element.ts", "src/compiler/compile/render_dom/wrappers/Element/index.ts", "src/runtime/internal/dom.ts", "test/custom-elements/samples/extended-builtin/_config.js", "test/custom-elements/samples/extended-builtin/fancy-button.js", "test/custom-elements/samples/extended-builtin/main.svelte", "test/custom-elements/samples/extended-builtin/test.js"]
Custom Element Overrides are not working correctly.
# Svelte and Custom Element Overrides I've created [a simple repository](https://github.com/taylorhadden/svelte_custom_element_overrides) to illustrate a bug in Svelte with custom element overrides using the `is="element-name"` property. At the moment, the way Svelte is creating elements breaks the usage of this property and the custom element overrides are never actually invoked. My naive suspicion is that elements are being created with [document.CreateElement()](https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement#Parameters) without including the second `is: 'element-name'` parameter. You can see this behavior in action by installing linked project with `node i` and running it with `node run dev`. An express server will start up at localhost:4001 and show a quick example of how an element overriding `<a>` does not work when written directly in Svelte, but does work when placed on the page as a raw string. Here is an example: ### The custom element: ``` class ElementOverride extends HTMLAnchorElement { connectedCallback() { this.innerHtml = 'It worked!' } } customElements.define('element-override', ElementOverride, { extends: 'a' }) ``` ### The Svelte component: ```(html) <h1>Does Not Work (Svelte Native)</h1> <a is=''element-override">The custom component will not run and will not replace this text</a> <h1>Does Work (Raw String)</h1> {@html "<a is='element-override'>The custom component will run and will replace this text</a>"} ``` While the raw string is a simi-usable workaround, it is not ideal as it means one does not get the benefits of svelte's property-setting functionality with standard custom elements. Thank you for taking the time to read this.
https://github.com/sveltejs/svelte/issues/3182
https://github.com/sveltejs/svelte/pull/3418
f9a31b19d279c4c0317f59db3e423fc7165a8199
3e450eeee8c0417e7ac92844f533564004567746
2019-07-05T17:32:07Z
javascript
2019-08-18T23:35:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,179
["src/compiler/compile/nodes/shared/Expression.ts", "test/runtime/samples/event-handler-async/_config.js", "test/runtime/samples/event-handler-async/main.svelte"]
Support async arrow function for inline event handlers
It would be nice to have `async` inline event handlers without writing the full function in the `<script>` tag like: ``` <button on:click={async () => {await services.saveData()}}> Save </button> ``` Currently, the compiler raises the following compile error ``` ReferenceError: async is not defined. ``` [REPL Demo](https://svelte.dev/repl/6715cdf1e8324c10bc5d4c6e9489bcbf?version=3.6.4) [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/async_function)
https://github.com/sveltejs/svelte/issues/3179
https://github.com/sveltejs/svelte/pull/3333
76d04dce9b376064d6e7bab05fecea20d87ec5b7
21e3db1b72637f77a09cb041bef89e83754eb9b1
2019-07-05T06:18:08Z
javascript
2019-08-03T16:25:05Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,173
["src/compiler/compile/render_dom/Block.ts"]
compiler error: this shouldn't happen! generated code is trying to use inexistent internal
This occurs with an `A` component that takes a `href` property that contains `"mailto:"`. https://svelte.dev/repl/90d5d66d0ad64c0397129a035cd906a5?version=3.6.4
https://github.com/sveltejs/svelte/issues/3173
https://github.com/sveltejs/svelte/pull/3186
943c04834a4af29a51aa861bc71c3a4383f15e41
6adf7b3d5fe69dd474af734f4ce3854b06b6cf29
2019-07-04T04:32:24Z
javascript
2019-07-06T18:40:57Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,163
["site/content/docs/02-template-syntax.md", "src/compiler/compile/nodes/Body.ts", "src/compiler/compile/render_dom/wrappers/Body.ts", "src/compiler/compile/render_dom/wrappers/shared/add_actions.ts", "src/compiler/interfaces.ts", "test/runtime/samples/action-body/_config.js", "test/runtime/samples/action-body/main.svelte"]
Actions are not acceptable for <svelte:body />
Seems, we not able to assign actions to `<svelte:body />` element: [REPL](https://svelte.dev/repl/28c1ccc76d8040b18cce57d938823365?version=3.6.3)
https://github.com/sveltejs/svelte/issues/3163
https://github.com/sveltejs/svelte/pull/6608
74a1f29c267e3f1d8e60295038fb78764b330c5b
ce550adef65a7e04c381b11c24f07a2ae1c25783
2019-07-03T03:23:59Z
javascript
2021-08-04T16:19:13Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,153
["src/runtime/internal/ssr.ts", "src/runtime/store/index.ts", "test/store/index.ts"]
`get_store_value` doesn't account for RxJS observables
Somewhat adjacent to https://github.com/sveltejs/sapper/issues/781 but I think there's other stuff going on there too. The support we added for RxJS observables (i.e., allowing for the `.subscribe()` method to also return an _object_ with an `.unsubscribe()` method) does not look like it extended to `get_store_value`.
https://github.com/sveltejs/svelte/issues/3153
https://github.com/sveltejs/svelte/pull/3170
8203c22f6357b23f2e90ae68e852f9f134c9d13d
1056951dcba440dcf28126a23a66708f51e9e74b
2019-07-02T04:52:06Z
javascript
2019-07-06T18:43:27Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,140
["src/compiler/compile/nodes/shared/Expression.ts", "test/runtime/samples/component-slot-let-in-binding/Nested.svelte", "test/runtime/samples/component-slot-let-in-binding/_config.js", "test/runtime/samples/component-slot-let-in-binding/main.svelte"]
Bindings don't receive context from let variables
Via [this Stack Overflow question](https://stackoverflow.com/questions/56817063/how-to-bind-variable-declared-with-svelte-let-directive). Using a `let` variable in a binding doesn't work β€” the binding function isn't passed the relevant context, it seems: https://svelte.dev/repl/278fe8b586f443889632803dcff8bcca?version=3.6.1
https://github.com/sveltejs/svelte/issues/3140
https://github.com/sveltejs/svelte/pull/3171
e0874d15b2e11054d55f21e164ed28ae3a75d52e
8203c22f6357b23f2e90ae68e852f9f134c9d13d
2019-06-30T17:08:15Z
javascript
2019-07-06T18:43:05Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,138
["site/content/docs/02-template-syntax.md"]
Docs: duplicate slug
The element `on:` directive anchor (link next to [Element_directives](https://svelte.dev/docs#Element_directives)) points to the [component `on:` directive anchor](https://svelte.dev/docs#on_component_event).
https://github.com/sveltejs/svelte/issues/3138
https://github.com/sveltejs/svelte/pull/3139
80ef6f190de79abba60152e6176c78caf076d087
0eb86d2a135acb031c5cb3b6c923e275fb131e2e
2019-06-30T14:50:47Z
javascript
2019-06-30T16:53:13Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,135
["src/compiler/compile/css/Stylesheet.ts", "test/css/samples/unknown-at-rule-with-following-rules/expected.css", "test/css/samples/unknown-at-rule-with-following-rules/input.svelte"]
Custom at-rules don't work if not in the last declaration block of a <style> tag
[REPL](https://svelte.dev/repl/6dd5a9e4a7d14a949bfb0850339d8a4b?version=3.6.1) Custom at-rules, such as `@apply`, aren't parsed properly (and cause a compile-time error!) unless they are in the last declaration block of the component's styles.
https://github.com/sveltejs/svelte/issues/3135
https://github.com/sveltejs/svelte/pull/3137
ca8365ef06def887139a72f58454460ffcce3627
f654dd0ae4e2c764b5a24baab47928d5a47b2496
2019-06-29T21:27:48Z
javascript
2019-06-29T22:22:31Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,113
["src/compiler/compile/render_dom/wrappers/EachBlock.ts", "src/compiler/compile/render_dom/wrappers/IfBlock.ts", "src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "src/runtime/internal/await_block.ts", "src/runtime/internal/keyed_each.ts", "src/runtime/internal/transitions.ts", "test/js/samples/transition-repeated-outro/expected.js", "test/runtime/samples/await-in-dynamic-component/Widget.svelte", "test/runtime/samples/await-in-dynamic-component/_config.js", "test/runtime/samples/await-in-dynamic-component/main.svelte"]
From 3.6.0: "TypeError: Cannot read property 'block' of null"
I'm using it with `svelte-apollo` but I cannot create now reproduction on codesandbox. ```log Uncaught (in promise) TypeError: Cannot read property 'block' of null at Object.destroy [as d] (PlayersPage.svelte:14) at destroy_component (index.mjs:1185) at App.svelte:31 at index.mjs:633 at run (index.mjs:18) at Array.forEach (<anonymous>) at run_all (index.mjs:24) at check_outros (index.mjs:615) at Object.update [as p] (App.svelte:31) at update (index.mjs:586) ``` Maybe something related to `Object.destroy` from 3.6.0 (https://github.com/sveltejs/svelte/issues/3058)?
https://github.com/sveltejs/svelte/issues/3113
https://github.com/sveltejs/svelte/pull/3172
7e01c3c4f82d1327ed2406a47987a1fbcb06059e
2536bd2142960773ae2bc485038dd6f2405a8a0e
2019-06-25T18:00:53Z
javascript
2019-07-09T15:09:18Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,092
["src/compiler/compile/utils/scope.ts", "test/runtime/samples/destructuring-assignment-array/_config.js", "test/runtime/samples/destructuring-assignment-array/main.svelte"]
TypeError: extractors[element.type] is not a function
The error happens when doing a simple destructuring assignement: `[[array[a], array[b]] = [array[b], array[a]]` Replicate: https://svelte.dev/repl/127da85d65ca4593b90a7369ef1ae064?version=3.5.4
https://github.com/sveltejs/svelte/issues/3092
https://github.com/sveltejs/svelte/pull/3093
b2da2ebcc746b37a988779a3dacc3fd8d869e81a
2de0f1cbb19623f88573ae177a54e87bc9caece2
2019-06-24T15:22:20Z
javascript
2019-06-24T18:21:44Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,091
[".changeset/green-cats-matter.md", "documentation/docs/04-compiler-and-api/04-custom-elements-api.md", "packages/svelte/elements.d.ts", "packages/svelte/src/compiler/compile/Component.js", "packages/svelte/src/compiler/compile/render_dom/index.js", "packages/svelte/src/runtime/internal/Component.js", "packages/svelte/test/runtime-browser/custom-elements-samples/custom-class/main.svelte", "packages/svelte/test/runtime-browser/custom-elements-samples/custom-class/test.js"]
$$host (or some way to access custom element instance)
From [this Stack Overflow question](https://stackoverflow.com/questions/56389375/accessing-generated-custom-element-in-svelte-3) β€” it might be nice if there was a way to get a reference to the host element, when compiling to custom elements (i.e. the `<my-thing>` for `tag="my-thing"`). Following the precedent set by `$$props`, we could add a `$$host` value. The main question is what should happen when *not* compiling as a custom element β€” error? or reference to the instance (which we've resisted thus far, because 99% of the time when someone wants that reference it's to do something inadvisable)?
https://github.com/sveltejs/svelte/issues/3091
https://github.com/sveltejs/svelte/pull/8991
4bbb5454e2a189a72e734cc33d98bce9a4b6f5a1
657f11376cf2ef0cc2f855559a02526a2d8412d6
2019-06-24T12:58:29Z
javascript
2023-07-18T16:21:19Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,075
["src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "test/runtime/samples/component-binding-reactive-property-no-extra-call/Component.svelte", "test/runtime/samples/component-binding-reactive-property-no-extra-call/_config.js", "test/runtime/samples/component-binding-reactive-property-no-extra-call/main.svelte"]
Two-way binding for a component makes two updates in a reactive block if `bind:value=<object>`
Primitive types and bindings in native `<input>` work fine. See [REPL](https://svelte.dev/repl/d4df9f70eb34430abde39f7e8d0cd1d1?version=3.5.3). I added `<svelte:options immutable={true}/>` and the problem has gone. However I see inconsistent behaviour for `<Custom bind:value={object.prop}/>` and `<input bind:value={object.prop}/>` when `immutable` is false. Is this a bug?
https://github.com/sveltejs/svelte/issues/3075
https://github.com/sveltejs/svelte/pull/5890
8867bc31c2a8e8d64a09e3ad626a39a4b107914c
a9c1dc9b59f97f55e9460815afa2fea925906997
2019-06-22T23:04:22Z
javascript
2021-02-08T19:22:25Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,067
["src/compiler/compile/render_dom/wrappers/Element/Attribute.ts", "src/compiler/compile/render_dom/wrappers/Element/index.ts", "test/css/samples/undefined-with-scope/expected.css", "test/css/samples/undefined-with-scope/expected.html", "test/css/samples/undefined-with-scope/input.svelte"]
Undefined attributes in spread
When some attributes are undefined and set through spread, svelte sets the dom attribute to "undefined". This is caused by [src/runtime/internal/dom.ts#L103-L104](https://github.com/sveltejs/svelte/blob/7de5d6c07aa6fb582860b57ca40626cff2741d0c/src/runtime/internal/dom.ts#L103-L104). The only way I can think to solve this is to include the list of boolean attributes in the runtime. See [repel](https://svelte.dev/repl/3b2010a52fad4750a80cf17e1f2e85fc?version=3.5.3).
https://github.com/sveltejs/svelte/issues/3067
https://github.com/sveltejs/svelte/pull/3876
4ffa6fc0314b8ab1c9dce69d5694ca11a39a1965
03afc7afb1e8a742f855c136c062d96ef2e5d4de
2019-06-21T16:43:43Z
javascript
2019-11-09T19:53:21Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,064
["src/compiler/compile/utils/scope.ts", "src/compiler/utils/names.ts", "test/validator/samples/catch-declares-error-variable/input.svelte", "test/validator/samples/catch-declares-error-variable/warnings.json"]
"'error' is not defined" when using try/catch in event handler
The compiler does not appear to understand that in `try {...} catch (error) {...}`, `error` declares a new variable. Instead, it complains that `'error' is not defined`. https://svelte.dev/repl/b630939cfcc243ce8d46bfe1218dcfb4?version=3.5.3 In creating the above reproduction, I noticed it also doesn't recognise the global `Error` in this context.
https://github.com/sveltejs/svelte/issues/3064
https://github.com/sveltejs/svelte/pull/3098
a0e0f0125aa554b3f79b0980922744ee11857069
fc32147ea5b031be35809d01b5d97d7ec41b7036
2019-06-20T21:31:48Z
javascript
2019-06-25T01:06:22Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,061
["site/content/docs/02-template-syntax.md"]
Docs: svelte:options open block
At https://svelte.dev/docs#svelte_options the tag signature is: `<svelte:options option={value}>` but using it like that gives a `Block was left open` error.
https://github.com/sveltejs/svelte/issues/3061
https://github.com/sveltejs/svelte/pull/3074
a7dd227336bee09f2aa365ad2fe00e4b5c405c6a
0b836872cf50f25eb643cf24e57a85cf6db31cbe
2019-06-20T15:26:59Z
javascript
2019-06-22T16:43:57Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,058
["src/runtime/internal/Component.ts", "test/runtime/samples/ondestroy-deep/A.svelte", "test/runtime/samples/ondestroy-deep/B.svelte", "test/runtime/samples/ondestroy-deep/C.svelte", "test/runtime/samples/ondestroy-deep/_config.js", "test/runtime/samples/ondestroy-deep/destroyed.js", "test/runtime/samples/ondestroy-deep/main.svelte"]
Inconsistent onDestroy
Repl: https://svelte.dev/repl/baabdbdeeac843fe9662903809f61ddb?version=3.5.3 Step to reproduce: - Open console - Click `Toggle` The logs from the two components should be the same, but they are not. Edit: This happened since 3.5.2
https://github.com/sveltejs/svelte/issues/3058
https://github.com/sveltejs/svelte/pull/3097
bb6cd30ff20d1f09ae333b1a72582ccf1817d000
8431aff34f6cb35f634d99d08d0b8ae03ed1e222
2019-06-20T03:16:30Z
javascript
2019-06-24T22:14:48Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,055
["src/runtime/internal/keyed-each.ts", "test/runtime/samples/each-block-keyed-shift/Nested.svelte", "test/runtime/samples/each-block-keyed-shift/_config.js", "test/runtime/samples/each-block-keyed-shift/main.svelte"]
3.5.2 breaks unmounting components in keyed each blocks
[REPL 3.5.2 (breaks)](https://svelte.dev/repl/ca8ceb49f8ac4c56b601b5ef398ca429?version=3.5.2) [REPL 3.5.1 (working)](https://svelte.dev/repl/ca8ceb49f8ac4c56b601b5ef398ca429?version=3.5.1) The code seems to break when components are unmounted inside a keyed each block. The bug does not occur if you replace `<Thing value={thing}/>` with `[{thing}]` inside the keyed each block, or if you remove the keyed each block entirely. Curiously, the keyed each block also seems to break the behavior of preceding each blocks. Notice that the incorrect component is removed in the first unkeyed each block.
https://github.com/sveltejs/svelte/issues/3055
https://github.com/sveltejs/svelte/pull/3056
f9054bc4396b4d1cb13e10cfe52abf5b22f0f96d
7b5f17676445555f4e7bea40e704681b9cfb5846
2019-06-19T19:53:46Z
javascript
2019-06-19T23:42:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,054
["src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts", "test/runtime/samples/dynamic-component-nulled-out-intro/_config.js", "test/runtime/samples/dynamic-component-nulled-out-intro/main.svelte"]
Svelte update (3.5.1 > 3.5.2) and BOOOM! (problems, not joys)
Taking https://codesandbox.io/s/reverent-tesla-c0kq0 from https://github.com/lukeed/navaid/issues/13. ### **FIRST PROBLEM** I cannot navigate anymore. Until **3.5.1** you can navigate like this: 1. Being in Home ("/") 1. click on "Go to Teams Page" ("/teams") 1. click on "Go to Team 1 Page" ("team/1") With **3.5.2** you can't. You can do 1 and 2 but at the step 3 you see nothing. If you are on the page "team/1" and reload using codesandbox's preview icon it works. ### **SECOND PROBLEM** In one of my projects the error is even more frightening: ```log TypeError: Cannot read property '$$' of undefined ```
https://github.com/sveltejs/svelte/issues/3054
https://github.com/sveltejs/svelte/pull/3110
33b756c9daad6fb283d193414bc8c8a42235867b
1685d875cbc1dd9c551d243eae9756c63f616bf8
2019-06-19T19:42:09Z
javascript
2019-06-25T16:51:26Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,048
["site/package-lock.json", "site/package.json"]
Error: Cannot find module 'svelte/store.mjs'
I am trying to work with [svelma](https://github.com/c0bra/svelma) I followed the development instructions and ended up with ... ``` Error: Cannot find module 'svelte/store.mjs' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15) at Function.Module._load (internal/modules/cjs/loader.js:520:25) at Module.require (internal/modules/cjs/loader.js:650:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/skc/svelma/docs/__sapper__/dev/server/server.js:11:17) at Module._compile (internal/modules/cjs/loader.js:702:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10) at Module.load (internal/modules/cjs/loader.js:612:32) at tryModuleLoad (internal/modules/cjs/loader.js:551:12) at Function.Module._load (internal/modules/cjs/loader.js:543:3) ```
https://github.com/sveltejs/svelte/issues/3048
https://github.com/sveltejs/svelte/pull/6749
58c13db4b035c064e1668a721febe4dbbe634ca9
cfc880bb31b09df50ea6619e71afa7f969d2c4d0
2019-06-19T12:20:03Z
javascript
2021-09-22T20:00:38Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,047
["src/compiler/preprocess/index.ts", "test/preprocess/samples/comments/_config.js", "test/preprocess/samples/comments/input.svelte", "test/preprocess/samples/comments/output.svelte"]
Bug: "<!-- -->"does not work inside script tag
## Version 3.5.1 ## Reproduction Link https://svelte.dev/repl/f1472198f68b43329eaf373047c9a9f6?version=3.5.1 ## Steps to reproduce 1. Use `<!-- -->` inside script tag ````html <script> <!-- This is a comment :) alert("Hello"); //--> </script> ```` ## What is expected? No error https://jsfiddle.net/c3205wua/ ## What is actually happening? `` Unexpected token (2:0) `` ## Note you can check validation of this code. * https://html5.validator.nu/ * http://esprima.org/demo/validate.html See also https://www.w3.org/TR/REC-html40/interact/scripts.html#h-18.3.2
https://github.com/sveltejs/svelte/issues/3047
https://github.com/sveltejs/svelte/pull/3894
97f68620fd927866405c8e1d9d51d3a7e65fd493
d67b44861ae32b3147a86686b6792c05ad388162
2019-06-19T03:15:08Z
javascript
2019-11-14T20:40:32Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,044
["src/compiler/compile/Component.ts", "test/runtime/samples/reactive-value-function-hoist-b/_config.js", "test/runtime/samples/reactive-value-function-hoist-b/main.svelte"]
Reactive statement not found when used inside regular function
I've run into a situation, where a reactive statement, combined with `.map()`, is not found when used inside a regular function, but is found when used inside an arrow function: ```js const someOtherStuff = [1,2,3]; $: stuff = someOtherStuff; function willFail() { stuff.map(i => i); } const willWork = () => { stuff.map(i => i); } ``` When looking at the compiled output, it seems that the compiler hoists the regular function `willFail` outside of the `instance` function's scope - that's where the variable for the reactive statement `$: stuff` resides, and thus it becomes unreachable from the function `willFail`. If the reactive statement is assigned on it's own line without chaining a `.map`, like so: ``` function willNOTFail() { const s = stuff; s.map(i => i); } ``` ...it works as expected and in the compiled output the `willNOTFail` function is now included inside the scope of `instance`. Here is a reproduction in REPL: https://svelte.dev/repl/dde38fd1a7a24d5b84392f24fa933dc8?version=3.5.1 <details> <summary>Stack trace</summary> Uncaught ReferenceError: filteredHeros is not defined at HTMLButtonElement.useFunctionAlert (eval at handle_message (about:srcdoc:13), <anonymous>:499:26) useFunctionAlert @ VM741:499 </details>
https://github.com/sveltejs/svelte/issues/3044
https://github.com/sveltejs/svelte/pull/3101
fc32147ea5b031be35809d01b5d97d7ec41b7036
5975eb5a08997ea9964b28ab346fe2efa4bb83d8
2019-06-18T10:30:14Z
javascript
2019-06-25T11:14:49Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,043
["site/package-lock.json", "site/package.json"]
dom ref
<!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> --> has any way to get the dom like svelte2.x use ref ?
https://github.com/sveltejs/svelte/issues/3043
https://github.com/sveltejs/svelte/pull/6749
58c13db4b035c064e1668a721febe4dbbe634ca9
cfc880bb31b09df50ea6619e71afa7f969d2c4d0
2019-06-18T08:03:17Z
javascript
2021-09-22T20:00:38Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,038
["src/compiler/compile/nodes/shared/Expression.ts", "test/runtime/samples/function-expression-inline/_config.js", "test/runtime/samples/function-expression-inline/main.svelte"]
"Unexpected token" when expression with function involving return statement is assigned to non-local variable
I got `"Unexpected token (Note that you need plugins to import files that are not JavaScript)"` when I did something like this: ```html <button on:click={event => { list = list.map(item => { const newItem = bunchaCodeGoesHere(); return newItem; }); }}> ... </button> ``` After some experimentation to reduce it, the error seems to happen when an event handler has: 1) an assignment to a non-local variable, and 2) the assigned expression includes a function, and 3) the function includes a "return" statement Example: https://svelte.dev/repl/a10f29765022492085e8c2805fd095ef?version=3.5.1 Some variations that work: ```js on:click={() => { // No return statement f = function(item) { // return item + 1; }; }} ``` ```js on:click={() => { // No return statement f = item => item + 1; }} ``` ```js on:click={() => { // Function is not part of assigned expression function x(item) { return item + 1; }; f = x; }} ``` ```js on:click={() => { // Assignment to local variable let f; f = function(item) { return item + 1; }; }} ``` ```html <script> // Hoisted out of template let f = function noop() {} const click = () => { f = function(item) { return item + 1; }; } </script> <button on:click={click}> Assign function </button> ```
https://github.com/sveltejs/svelte/issues/3038
https://github.com/sveltejs/svelte/pull/3158
71e0d276550aed29b3ef979c95c316c5225476d0
7efbe7b8b91f2046c1d140abc072643cfbbd1ad9
2019-06-17T23:12:35Z
javascript
2019-07-03T15:09:12Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,035
["src/compiler/compile/render_dom/wrappers/EachBlock.ts", "test/runtime/samples/each-block-component-no-props/Child.svelte", "test/runtime/samples/each-block-component-no-props/_config.js", "test/runtime/samples/each-block-component-no-props/main.svelte"]
Component doesn't get removed in #each with no props/children
Repro: https://svelte.dev/repl/8d5bc96db7634fe0b898b6755b0e7b90?version=3.5.1 Hit the add button, works. Hit the remove button, it fails! If you add any property to `MyComp` or give it children, then the remove button begins to work.
https://github.com/sveltejs/svelte/issues/3035
https://github.com/sveltejs/svelte/pull/3106
423428f4882f559ee39bac51927bc6ed736ff528
ed7fdffd6e35a8c12cd4a01ae4851a26a363aa3e
2019-06-17T12:44:38Z
javascript
2019-06-25T15:50:15Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,029
["site/content/docs/01-component-format.md"]
Site: Document that module-level variables are not reactive
I forget whether the reason for their not being reactive was ideological or technological, but this has come up two days in a row in Discord. We can tell people to use a module-level store if they need something like this.
https://github.com/sveltejs/svelte/issues/3029
https://github.com/sveltejs/svelte/pull/3127
cfee4ea08f4bf106ad69ad6440b054f168e0699a
80ef6f190de79abba60152e6176c78caf076d087
2019-06-16T10:27:58Z
javascript
2019-06-29T20:14:53Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,027
["src/compiler/compile/nodes/Text.ts", "src/compiler/compile/render_dom/wrappers/Element/index.ts", "src/compiler/compile/render_dom/wrappers/Fragment.ts", "src/compiler/compile/render_dom/wrappers/Text.ts", "test/runtime/samples/isolated-text/_config.js", "test/runtime/samples/isolated-text/main.svelte"]
Untagged text is absent from rendered output
The first line of the HTML (`Hello there`) is not contained in any tags, so it does not show up in the rendered output. The bug is reproducible on repl. https://svelte.dev/repl/ac3e6448a4a04ed9a12e0ceed1d9dfae?version=3.5.1 ```html Hello there. <script> let name = 'world'; </script> <h1>Hello {name}!</h1> ```
https://github.com/sveltejs/svelte/issues/3027
https://github.com/sveltejs/svelte/pull/3102
5975eb5a08997ea9964b28ab346fe2efa4bb83d8
35001b36ccc0fc908b57c9e69b1c6af3ee6c4a59
2019-06-14T19:40:59Z
javascript
2019-06-25T11:15:10Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,026
["src/compiler/parse/state/tag.ts", "test/parser/samples/attribute-with-whitespace/input.svelte", "test/parser/samples/attribute-with-whitespace/output.json"]
No error if space after =
The following example does not work. It's reproducible on repl. https://svelte.dev/repl/80e0bfba5c364c9e9c5cfe6d792b8c50?version=3.5.1 ```html <script> let count = 0; function handleClick() { count += 1; } </script> <button on:click= {handleClick}> Clicked {count} {count === 1 ? 'time' : 'times'} </button> ```
https://github.com/sveltejs/svelte/issues/3026
https://github.com/sveltejs/svelte/pull/3028
acdcaa41bfde4fc1b74dca33e48a6e4d3895667d
ea74bfec554a9fba50d5d5ab803f96bd63fe83ba
2019-06-14T19:35:11Z
javascript
2019-06-16T10:37:28Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,022
["src/runtime/store/index.ts", "test/store/index.ts"]
Store with start callback may double-call its first subscriber
Steps to reproduce: 1. Create a `writable`/`readable` store with a `start` callback that synchronously calls its `set` callback. (Note: `derived` creates such a store when its own callback is synchronous.) 2. Subscribe with any number of subscribers, then unsubscribe them all. 3. Subscribe with a "new first subscriber". Expected results: Each subscriber gets called exactly once upon subscribing, no matter what. Actual results: The "new first subscriber" is called twice. [REPL](https://svelte.dev/repl/3af94ae57b3945a4baf5b95c59c896f6?version=3.5.1) Looking at [the source code](https://github.com/sveltejs/svelte/blob/7b4af88ec6587aab0e27cce0da01015532165484/src/runtime/store/index.ts#L57), I see `set` tries to guard against this, but it doesn't always work because `stop` isn't always falsy when needed. That could be fixed, but maybe we don't need the guard at all - why does `subscribe` add the subscriber *before* calling `start`? Can we safely reverse that?
https://github.com/sveltejs/svelte/issues/3022
https://github.com/sveltejs/svelte/pull/3107
35001b36ccc0fc908b57c9e69b1c6af3ee6c4a59
423428f4882f559ee39bac51927bc6ed736ff528
2019-06-14T04:31:45Z
javascript
2019-06-25T14:42:51Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,014
["src/compiler/compile/nodes/Text.ts", "test/runtime/samples/nbsp-div/_config.js", "test/runtime/samples/nbsp-div/main.svelte"]
&nbsp; is stripped if siblings are dynamic
The `&nbsp;` is treated like a normal space if it is next to dynamic content. Good: `<div>&nbsp;</div>` Good: `<div>Static content&nbsp;</div>` Bad: `<div>{name}&nbsp;</div>` https://svelte.dev/repl/30b9b4d5610f47459ed2dc06cecfd185?version=3.5.1 shows the various cases. Notice the height of the divs when empty - an `&nbsp;` holds the last two open, but the first two just have a normal space. The second div uses a variable which evaluates to just `''` (I was checking in case the first render was somehow different/exempt, but it's not). I could reproduce this in Firefox and Chrome both. Interesting note - I have a Sapper app where the first instance of this problem is fine, but the rest hit the problem. E.g. if `Case` is `{case}<div>{name}&nbsp;</div>`, then in my app case one is fine, and only case two and three are borked. ``` <Case case="one" name="" /> <Case case="two" name="" /> <Case case="three" name="" /> ``` I'm not sure what makes it work in that one spot....
https://github.com/sveltejs/svelte/issues/3014
https://github.com/sveltejs/svelte/pull/3024
ac185052a5d33dbdfcda89903685e929535a2754
be783c5c67a0c8c5b8a02cecca5589ff508fabfb
2019-06-12T06:36:23Z
javascript
2019-06-15T22:13:06Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,008
["site/content/docs/03-run-time.md"]
Site: Update/Fix SSR API docs
The SSR example [here](https://svelte.dev/docs#Server-side_component_API) is at the very least highly misleading, as it doesn't show you doing `require('svelte/register')` and because it doesn't show that the component itself will be available as `.default` in the module if you do that. We could align this better with the [`svelte/register` docs](https://svelte.dev/docs#svelte_register). We could also have links between the two sections.
https://github.com/sveltejs/svelte/issues/3008
https://github.com/sveltejs/svelte/pull/3771
614393edcba4806300d0601919e8b70d5b81be68
d91e9afab6fbaf85d0263111ce4b64932b7e5e09
2019-06-11T12:16:31Z
javascript
2019-10-23T00:49:03Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
3,002
["site/package-lock.json", "site/package.json"]
curious whitespace bug
[REPL](https://svelte.dev/repl/b6c71bf8825f46028793d804facf5e08?version=3.5.1). I think it's behaving incorrectly when it inserts whitespace between each `<span>` element ```svelte <script> let message = 'the quick brown fox jumps over the lazy dog'; </script> <div class="data"> {#each message as char, i} <span> {char} </span> {/each} </div> <!-- uncomment next line to see something weird --> <!-- wtf --> <style> div { position: relative; font-family: monospace; font-size: 16px; max-width: 100px; } </style> ```
https://github.com/sveltejs/svelte/issues/3002
https://github.com/sveltejs/svelte/pull/6749
58c13db4b035c064e1668a721febe4dbbe634ca9
cfc880bb31b09df50ea6619e71afa7f969d2c4d0
2019-06-10T18:31:04Z
javascript
2021-09-22T20:00:38Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,977
["src/compiler/compile/nodes/InlineComponent.ts", "src/compiler/compile/render-dom/wrappers/InlineComponent/index.ts", "src/runtime/internal/utils.ts", "test/runtime/samples/component-event-handler-modifier-once/Button.svelte", "test/runtime/samples/component-event-handler-modifier-once/_config.js", "test/runtime/samples/component-event-handler-modifier-once/main.svelte", "test/validator/samples/component-event-modifiers-invalid/errors.json", "test/validator/samples/component-event-modifiers-invalid/input.svelte"]
Event modifiers not affecting dispatched events
[REPL](https://svelte.dev/repl/b1d3fbf7976348b98e0901fd4ee9bd5a?version=3.4.4) showing that `|once` is ineffective.
https://github.com/sveltejs/svelte/issues/2977
https://github.com/sveltejs/svelte/pull/2987
9754f2a817b7708623251b05282bf6442e7e5f18
1102ff642685c1f21aaf690075199e87018463ec
2019-06-08T13:59:52Z
javascript
2019-06-09T21:34:02Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,952
["site/package-lock.json", "site/package.json"]
Suggestion about repository folders
Hi, can i do a suggestion here? Your repository have this statistics right now: TypeScript 35.8% JavaScript 34.4% HTML 28.8% Other 1.0% Can you move the site to other repository? Seems like a very nice framework! Congratulations!
https://github.com/sveltejs/svelte/issues/2952
https://github.com/sveltejs/svelte/pull/6467
98ece151b326e39ea22198c416510ee6161284f3
487190fd93fa3fbd68e85effe149c013e446a812
2019-06-04T14:10:37Z
javascript
2021-06-28T22:10:07Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,943
[".changeset/cyan-geese-film.md", "packages/svelte/src/compiler/compile/internal_exports.js", "packages/svelte/src/compiler/compile/render_dom/wrappers/Element/Attribute.js", "packages/svelte/test/runtime/samples/binding-select-from-let-2/Parent.svelte", "packages/svelte/test/runtime/samples/binding-select-from-let-2/_config.js", "packages/svelte/test/runtime/samples/binding-select-from-let-2/main.svelte", "packages/svelte/test/runtime/samples/binding-select-from-let/Parent.svelte", "packages/svelte/test/runtime/samples/binding-select-from-let/_config.js", "packages/svelte/test/runtime/samples/binding-select-from-let/main.svelte"]
ReferenceError: data is not defined
Using `let:data` from a custom component, and then using `data` inside a loop along with `<select bind:value={anything}>` tries to wipe-out `data` too! See the example on the REPL: https://svelte.dev/repl/a05cc3a759f341479b56a944d60d4b20?version=3.4.4 Invalidation calls are: ```js $$invalidate('selected', selected); $$invalidate('data', data); // `data` is not defined ```
https://github.com/sveltejs/svelte/issues/2943
https://github.com/sveltejs/svelte/pull/8969
cb1358cc417effeb2e747f811260936c11b8923d
f8283fbc775d94d2ea081d06153cc1f9d89eea72
2019-06-03T16:16:11Z
javascript
2023-07-19T11:55:27Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,933
["src/runtime/internal/utils.ts"]
TypeError: Illegal invocation on transition
Hi! After bumping Svelte from 3.4.2 a part of my code broke. It's broken for me on both 3.4.3 and 3.4.4. I made a [REPL](https://svelte.dev/repl/15127647126e4dd7a18584fffcc8fea7?version=3.4.4) which unfortunately fails to replicate the bug. I do hope, however, that providing my code might help identify the bug. The bug happens when I click on "Expand". The same thing happens if I flip `showForm` to `true` in `Form.svelte` and click "Add" or "Cancel". What happens when I do that in my app, is that the slide out transition works fine, but the slide in of the other part of the if-block in `Form.svelte` doesn't work. Not only does it not slide in, it doesn't appear at all. <details> <summary>Stack trace</summary> Uncaught (in promise) TypeError: Illegal invocation at loop (internal.js:107) at go (internal.js:772) at Object.run (internal.js:819) at Object.o (Form.svelte:158) at Object.p (Form.svelte:221) at update (internal.js:577) at flush (internal.js:552) </details> <details> <summary>Form.svelte line 158</summary> o(local) { if (default_slot && default_slot.o) default_slot.o(local); if (!div1_transition) div1_transition = create_bidirectional_transition(div1, slide, {}, false); div1_transition.run(0); // line 158 current = false; }, </details> <details> <summary>Form.svelte line 221</summary> p(changed, ctx) { var previous_block_index = current_block_type_index; current_block_type_index = select_block_type(ctx); if (current_block_type_index === previous_block_index) { if_blocks[current_block_type_index].p(changed, ctx); } else { group_outros(); on_outro(() => { if_blocks[previous_block_index].d(1); if_blocks[previous_block_index] = null; }); if_block.o(1); // line 221 check_outros(); if_block = if_blocks[current_block_type_index]; if (!if_block) { if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); if_block.c(); } if_block.i(1); if_block.m(div, null); } }, </details> Code formatting didn't work too well in details, but I hope it helps. Svelte 3.4.3/3.4.4 parcel-bundler 1.12.3 parcel-plugin-svelte 3.0.1 Chrome 74.0.3729.169
https://github.com/sveltejs/svelte/issues/2933
https://github.com/sveltejs/svelte/pull/3016
be783c5c67a0c8c5b8a02cecca5589ff508fabfb
acdcaa41bfde4fc1b74dca33e48a6e4d3895667d
2019-06-02T15:09:33Z
javascript
2019-06-16T09:14:39Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,980
["src/compiler/compile/render-dom/wrappers/Title.ts", "test/runtime/samples/head-title-empty/_config.js", "test/runtime/samples/head-title-empty/main.svelte"]
<svelte:head> empty <title> error handling
When using an empty `<title>` tag in `<svelte:head>` a client error will be thrown. To reproduce add this in routes/index.svelte: ```svelte <svelte:head> <title></title> </svelte:head> ``` The error is: `Cannot read property 'data' of undefined`. When trying to build the full stack trace is visible (hidden in dev mode): ``` TypeError: Cannot read property 'data' of undefined at TitleWrapper.render (project/node_modules/svelte/compiler.js:17301:60) at FragmentWrapper.render (project/node_modules/svelte/compiler.js:17540:28) at HeadWrapper.render (project/node_modules/svelte/compiler.js:16270:24) at FragmentWrapper.render (project/node_modules/svelte/compiler.js:17540:28) at new Renderer (project/node_modules/svelte/compiler.js:17571:24) at dom (project/node_modules/svelte/compiler.js:17762:23) at compile (project/node_modules/svelte/compiler.js:23767:16) at preprocessPromise.then.code (project/node_modules/rollup-plugin-svelte/index.js:236:22) ``` This is confusing when an empty title tag is used (when starting a new project and leaving it empty as a placeholder), as the error is not helpful. Adding content inside the tag will work just fine.
https://github.com/sveltejs/svelte/issues/2980
https://github.com/sveltejs/svelte/pull/2988
056b4a52de4d578f2d0c4541253cd36c8672380a
658290546a546c751cf4cb3b282647c75b57c13a
2019-06-02T12:32:55Z
javascript
2019-06-09T21:35:36Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,929
["src/compiler/compile/css/Selector.ts"]
Special characters, the class directive and scoped css
[REPL](https://svelte.dev/repl/21437b30c4fc4d4e9193cfaba678d28b?version=3.4.4) Currently, we can already use special characters in class names: ```html <element class="some:name" class:another:name={enabled}>Hello world</element> ``` Both of these will be added to the element correctly. However, the ones added with the `class:` directive won't get properly scoped. Given: ```html <style> .some\:name { ... } .another\:name { ... } </style> ``` The first selector will be scoped and included, while the second will be dropped with an `Unused CSS selector` warning.
https://github.com/sveltejs/svelte/issues/2929
https://github.com/sveltejs/svelte/pull/2946
ddd4a33f3b719de59ba4902e5b6f1696eb79bb34
bef6f153dba30439215ffe80cc1db4b3baefda47
2019-06-02T00:39:11Z
javascript
2019-06-03T20:29:21Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,923
["src/compiler/compile/nodes/EventHandler.ts", "test/runtime/samples/event-handler-shorthand-sanitized/_config.js", "test/runtime/samples/event-handler-shorthand-sanitized/main.svelte"]
error when referencing an event with dashes ("-") and no event handler
When referencing an event with dashes in it's name and no event handler it gives the following error: [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) Repl with the error: https://svelte.dev/repl/ec066729fa684c90a2fa16e6eb730ed0?version=3.4.4 Example: ```html <script> let name = 'world'; </script> <h1 on:click-now={() => alert('hi')}>Hello {name}!</h1> <h1 on:click-now>Hello {name}!</h1> ``` The first h1 works ok, the seconds raises the error <details> <summary>Stack trace</summary> [2019-06-01 07:11:25] waiting for changes... rollup v1.13.0 bundles src/main.js β†’ public/bundle.js... (!) Error when using sourcemap for reporting an error: Can't resolve original location of error. src/App.svelte: (83:15) [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) src/App.svelte (83:15) Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) at error (/media/data/sas/devel/apps/svelte/udemy/section_6_custom_events/custom_events/node_modules/.registry.npmjs.org/rollup/1.13.0/node_modules/rollup/dist/rollup.js:9241:30) at Module.error (/media/data/sas/devel/apps/svelte/udemy/section_6_custom_events/custom_events/node_modules/.registry.npmjs.org/rollup/1.13.0/node_modules/rollup/dist/rollup.js:13085:9) at tryParse (/media/data/sas/devel/apps/svelte/udemy/section_6_custom_events/custom_events/node_modules/.registry.npmjs.org/rollup/1.13.0/node_modules/rollup/dist/rollup.js:13001:16) at Module.setSource (/media/data/sas/devel/apps/svelte/udemy/section_6_custom_events/custom_events/node_modules/.registry.npmjs.org/rollup/1.13.0/node_modules/rollup/dist/rollup.js:13304:33) at Promise.resolve.catch.then.then.then (/media/data/sas/devel/apps/svelte/udemy/section_6_custom_events/custom_events/node_modules/.registry.npmjs.org/rollup/1.13.0/node_modules/rollup/dist/rollup.js:16027:20) </details>
https://github.com/sveltejs/svelte/issues/2923
https://github.com/sveltejs/svelte/pull/3111
e924f4d5a016524ba21dcd487df02e81653d92de
33b756c9daad6fb283d193414bc8c8a42235867b
2019-06-01T10:12:30Z
javascript
2019-06-25T15:51:23Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,917
["src/compiler/compile/render_dom/wrappers/EachBlock.ts", "test/runtime/samples/each-block-else-in-if/_config.js", "test/runtime/samples/each-block-else-in-if/main.svelte"]
Component with top level each-else appears in wrong place when wrapped in if
This bug appears when a child component has a top level `{#each}...{:else}...{/each}` loop: ```html {#each list as item, index} <p>Item {index} is "{item}"</p> {:else} <p>No items!</p> {/each} ``` and it's rendered inside an `{#if}{/if}` in the parent: ```html {#if showList} <Child list={[]}/> {/if} This should come after the list ``` Whenever the `:else` section of the child is triggered, the child will be incorrectly inserted *after* any supposed next siblings. See REPL for repro: https://svelte.dev/repl/90911dadba184df481f7d44d7e0c0058?version=3.4.4 Click the button twice to see how the pink text in the second example ends up in the wrong place.
https://github.com/sveltejs/svelte/issues/2917
https://github.com/sveltejs/svelte/pull/3112
f06f718638930875c55d13ed9f5751222ab78609
46b2e77a7e2f6b04d0dcca5936ce6d4ddae49e40
2019-05-31T11:44:37Z
javascript
2019-06-27T23:58:30Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,916
["CHANGELOG.md", "src/compiler/compile/render_ssr/handlers/Element.ts", "src/compiler/compile/render_ssr/handlers/shared/boolean_attributes.ts", "src/runtime/internal/ssr.ts", "test/server-side-rendering/samples/attribute-boolean/_expected.html", "test/server-side-rendering/samples/attribute-boolean/main.svelte", "test/server-side-rendering/samples/spread-attributes-boolean/_expected.html", "test/server-side-rendering/samples/spread-attributes-boolean/main.svelte"]
Inconsistency in SSR boolean and null attributes when using spread syntax
```html <input type="text" disabled={true}/> <input type="text" {...{disabled:true}}/> <input type="text" disabled={1}/> <input type="text" {...{disabled:1}}/> <input type="text" value={null}/> <input type="text" {...{value:null}}/> ``` will render ```html <input type="text" disabled> <input type="text" disabled disabled="true"> <input type="text" disabled> <input type="text" disabled="1"> <input type="text"> <input type="text" value="null"> ``` The duplication on line two could also be seen in REPL with: ```html <script> import { spread } from "svelte/internal" </script> {spread([{disabled:true}])} ```
https://github.com/sveltejs/svelte/issues/2916
https://github.com/sveltejs/svelte/pull/3797
9f7565cf198803acb4bd5a0c1b901b8137a94ab7
9f48d1a5fd9ec50d5eb630ad97fb11e84f39855a
2019-05-31T11:21:29Z
javascript
2019-10-27T12:53:01Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,915
["src/compiler/compile/render-ssr/handlers/Element.ts", "test/runtime/samples/binding-textarea/_config.js", "test/server-side-rendering/samples/text-area-bind/_expected.html", "test/server-side-rendering/samples/text-area-bind/main.svelte"]
SSR of textarea value shouldn't be an attribute
The server side render of ```html <script> let value = 'hello'; </script> <textarea bind:value></textarea> ``` should be ```html <textarea>hello</textarea> ``` but right now is ```html <textarea value="hello"></textarea> ``` which don't render if JavaScript is disabled.
https://github.com/sveltejs/svelte/issues/2915
https://github.com/sveltejs/svelte/pull/2975
99de44318199f282b1df418d566bf53c1330c888
17c4a25016892ea542a2c3412e9b2c40d0e1a850
2019-05-31T10:49:40Z
javascript
2019-06-09T15:00:44Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,908
["src/compiler/compile/render-dom/wrappers/EachBlock.ts", "src/runtime/internal/keyed-each.ts", "test/js/samples/each-block-keyed-animated/expected.js"]
Animation without Transition: TypeError: Cannot read property 'callbacks' of undefined
Unfortunately, I found another bug. Steps to reproduce: * Take 11.a "The animate directive" from the tutorial (https://svelte.dev/tutorial/animate) * Remove the transitions and just leave the animation * Tick or remove a todo from the list * See the exception on the console: ```javascript Uncaught (in promise) TypeError: Cannot read property 'callbacks' of undefined at on_outro (eval at handle_message (about:srcdoc:13), <anonymous>:288:16) at outro_and_destroy_block (eval at handle_message (about:srcdoc:13), <anonymous>:296:9) at fix_and_outro_and_destroy_block (eval at handle_message (about:srcdoc:13), <anonymous>:303:9) at update_keyed_each (eval at handle_message (about:srcdoc:13), <anonymous>:354:17) at Object.update [as p] (eval at handle_message (about:srcdoc:13), <anonymous>:869:24) at update (eval at handle_message (about:srcdoc:13), <anonymous>:281:25) at flush (eval at handle_message (about:srcdoc:13), <anonymous>:256:17) ``` Here is the REPL: https://svelte.dev/repl/405d24c6f8414e528c67596fc8f382f1 I'll provide a fix (pull request) shortly. :wink: <!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> -->
https://github.com/sveltejs/svelte/issues/2908
https://github.com/sveltejs/svelte/pull/2909
7b6cd52d14fb3b216bf5ad3df69d387294883e5a
f7e6b328858b59063b5a4c5c35478ec050630319
2019-05-30T15:40:43Z
javascript
2019-06-02T22:59:04Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,906
["src/compiler/compile/nodes/shared/Expression.ts", "test/runtime/samples/shorthand-method-in-template/Foo.svelte", "test/runtime/samples/shorthand-method-in-template/_config.js", "test/runtime/samples/shorthand-method-in-template/main.svelte"]
Shorthand methods in object literals disappear
This works fine: ```html <script> import Greeter from './Greeter.svelte'; const object = { getName() { return 'foo'; } }; </script> <Greeter thing={object} /> ``` This breaks: ```html <script> import Greeter from './Greeter.svelte'; </script> <Greeter thing={{ getName() { return 'foo'; } }} /> ``` ``` Can't find variable: getNamefunc_1 ``` Looks like there's some too greedy function hoisting going on. REPL: https://svelte.dev/repl/d1fcf63ccfea462f948fcc4cc16c3028?version=3.4.4 --- EDIT: Another example of shorthand methods breaking in a different way: ```html <script> import Greeter from './Greeter.svelte'; let name = 'foo'; </script> <Greeter thing={{ getName() { return name; } }} /> ``` Compiler refuses to compile and says: `Unexpected token (Note that you need plugins to import files that are not JavaScript)` https://svelte.dev/repl/6e2cf0c00f85488195f4a47eee22c1e0?version=3.4.4
https://github.com/sveltejs/svelte/issues/2906
https://github.com/sveltejs/svelte/pull/3151
b49882955ef29723d8b50b9a51e1cff887fe7377
71e0d276550aed29b3ef979c95c316c5225476d0
2019-05-30T13:39:03Z
javascript
2019-07-03T15:08:57Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,874
["package.json"]
TypeScript definition reference `dist` dir not bundled in the npm
Errors during compilation: ``` node_modules/svelte/store.d.ts:1:15 - error TS2307: Cannot find module './dist/store'. 1 export * from './dist/store'; ~~~~~~~~~~~~~~ ```
https://github.com/sveltejs/svelte/issues/2874
https://github.com/sveltejs/svelte/pull/2876
c918f60d9a48a26c8b859efe75126cec5f6809b9
338f5d18351111351971b6a08b03a7df082c5f6e
2019-05-26T13:46:53Z
javascript
2019-05-27T09:47:21Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,871
["src/compiler/compile/render-dom/wrappers/Element/index.ts", "src/runtime/internal/animations.ts"]
Animation with delay can lead to outdated css rules
I played around with the todo list from the animation tutorial (https://svelte.dev/tutorial/animate) and adapted it like so: * Distinguish between adding and removing/checking todos. * For removing/checking todos, add a delay of 200ms to the animation, so it starts only after the transition has finished. * For adding todos, start the animation directly (delay of 0ms) The result seems to work fine: https://svelte.dev/repl/fbcd977718ea4d70abde8adee151515d?version=3.4.2 Then I continued playing around and replaced the **delay with an unreasonable huge number** (3s). The behaviour seems very odd when you interact with the todo list before the animation actually starts, **leaving the todo items on akward positions somewhere in between**, where they should not be: https://svelte.dev/repl/31c4535d1e2c4a548ec55f6fc739facc?version=3.4.2 To reproduce, check and remove todos before the 3s delay. After debugging the code I found out what the problem is: 1) When a delay is specified for a CSS animation, the css rule is created and applied with node.style.cssText.https://github.com/sveltejs/svelte/blob/089149564799fd4f22799128315bc91208dda84f/src/internal/animations.js#L65 2) Normally, when the animation would start after the delay a "named" rule would be created... https://github.com/sveltejs/svelte/blob/089149564799fd4f22799128315bc91208dda84f/src/internal/animations.js#L30 ...which could be deleted later. https://github.com/sveltejs/svelte/blob/089149564799fd4f22799128315bc91208dda84f/src/internal/animations.js#L37 3) Since the user interacts with the items before the delay expires the rule created at 1) stays at the element and deleting it fails, because of the missing name. I also found out, that there is a TODO here, which points out the solution: https://github.com/sveltejs/svelte/blob/089149564799fd4f22799128315bc91208dda84f/src/internal/animations.js#L29 I adapted animation.js accordingly - using animation-delay instead and will create a pull request to solve this issue shortly. Still the items are on akward positions, but only until the delay expires. Then the items are repositioned automatically. Note, that according to MDN, this will work only for IE10 or later: https://developer.mozilla.org/en-US/docs/Web/CSS/animation-delay Thank you for the great work, Svelte is a cool thing! πŸ‘πŸ˜€ <!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> -->
https://github.com/sveltejs/svelte/issues/2871
https://github.com/sveltejs/svelte/pull/2910
becb0546fe13a66acde2ac49e0ad9037ac2edb6e
7251850503d7efb319a5aca728e659c79f7f7bef
2019-05-26T12:48:17Z
javascript
2019-06-06T11:53:35Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,867
["src/store.ts"]
writable jsdoc @param not optional
In Webstorm, there is a warning `Invalid number of arguments, expected 1..2` for the following. ```js const store = writable() ``` The jsdoc definition for writable, ```js /** * Create a `Writable` store that allows both updating and reading by subscription. * @param value initial value * @param start start and stop notifications for subscriptions */ ``` should be ```js /** * Create a `Writable` store that allows both updating and reading by subscription. * @param [value] initial value * @param [start] start and stop notifications for subscriptions */ ``` to indicate that value & start are optional arguments.
https://github.com/sveltejs/svelte/issues/2867
https://github.com/sveltejs/svelte/pull/2868
04af24916a41e408f9407f79535428645bc071bc
c918f60d9a48a26c8b859efe75126cec5f6809b9
2019-05-26T06:03:06Z
javascript
2019-05-27T09:46:09Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,843
["src/compiler/compile/index.ts"]
get_name crashes on file named [...parts].svelte
If there's a file named `[...parts].svelte` (syntax used by Sapper), it wouldn't compile because `get_name(filename)` would crash: https://github.com/sveltejs/svelte/blob/d548a5a5f40451331610c51c0bd9319b69bb3c61/src/compile/index.ts#L58-L74 The sequence of `.replace(...)` leads to the empty string, and then `base[0].toUpperCase()` crashes with `Cannot read property 'toUpperCase' of undefined`. Related Sapper issue: https://github.com/sveltejs/sapper/issues/709 Of course this particular problem can be fixed by prepending the chain of replacements with something like `.replace(/\.{2,}/g, "")` but perhaps it needs a more generic fix as well? Like if the replacements lead to the empty string, generate the component name with something like `Component_${hash(lastPart))}`?
https://github.com/sveltejs/svelte/issues/2843
https://github.com/sveltejs/svelte/pull/2999
593de0e3f3bcb58ae07d97a65aa533649278900f
181f60d4f80a8b894a150caad0efd4162d10ed0a
2019-05-22T06:22:31Z
javascript
2019-06-10T10:54:41Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,821
["src/compile/Component.ts", "test/custom-elements/samples/no-svelte-options/_config.js", "test/custom-elements/samples/no-svelte-options/main.svelte", "test/custom-elements/samples/no-svelte-options/test.js"]
Svelte 3 with customElement=true - fails without `<svelte:options />`
Hi, With `customElement=true` The following svelte ``` <script> let name = 'world'; </script> <h1>Hello {name}!</h1> ``` fails with ``` pos is undefined ``` adding `<svelte:options />` (I'm good without `tag=` because it's export default πŸ‘) fixes the problem ``` <svelte:options /> <script> let name = 'world'; </script> <h1>Hello {name}!</h1> ```
https://github.com/sveltejs/svelte/issues/2821
https://github.com/sveltejs/svelte/pull/2829
4f324ce1cfda2c980fc6da6652b8b35912e25455
e4c55697a8b06cd8e1b223780c5cc89e2d63efec
2019-05-19T15:20:27Z
javascript
2019-05-21T01:41:06Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,812
["site/scripts/build-svelte-app-json.js", "site/scripts/update_template.js"]
Site: favicon corrupted in downloaded REPL zips
It looks like the relatively new favicon.png in the svelte template gets owned by character encoding stuff when it goes through https://svelte.dev/svelte-app.json and then through the .zip generation library. I'm not sure which step is the most to blame, but I _think_ if this were represented as an array of 0-255 in the json instead of as a string, do-not-zip would be able to correctly generate the binary file in the zip.
https://github.com/sveltejs/svelte/issues/2812
https://github.com/sveltejs/svelte/pull/2814
2255aadf369a36fa64fdf4be44d003b06b852a07
7265fd4e834d57ad266aae2953b83116861c8a2e
2019-05-18T13:12:36Z
javascript
2019-05-18T13:54:58Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,807
["src/compiler/parse/state/mustache.ts", "src/compiler/parse/state/tag.ts", "src/compiler/parse/utils/html.ts", "test/parser/samples/implicitly-closed-li-block/input.svelte", "test/parser/samples/implicitly-closed-li-block/output.json"]
Implicitly closing tags aren't allowed before closing block
Svelte supports implicitly closing tags like `<li>first <li>second`, but it won't allow them to be closed by a mustache closing block: https://svelte.dev/repl/733548506a2b44819e39157bd6a055d3. I don't think this is intuitive and would expect svelte to either disallow it everywhere (even though it's valid html) or relax the mustache closing block rules (what I'd personally prefer).
https://github.com/sveltejs/svelte/issues/2807
https://github.com/sveltejs/svelte/pull/2809
24410083c70be76e27a298189fdd4652ad937402
961021a73b0d13973d019429903e24cb4b4f34f5
2019-05-17T20:36:51Z
javascript
2019-09-08T21:23:51Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,803
["src/compile/render-dom/wrappers/Element/Attribute.ts", "test/runtime/samples/attribute-dataset-without-value/_config.js", "test/runtime/samples/attribute-dataset-without-value/main.svelte"]
Data attribute without value is assigned the string `"true"`
If you use a data attribute without a value, the generated code tries to assign `true` to the corresponding key in the `dataset`, which is coerced to `"true"`. Normal HTML behavior is to use the empty string. Example in REPL: https://svelte.dev/repl/66aad97e4c734ebfbb4e7ef898e07bcd?version=3.4.1 Kinda related to #1852
https://github.com/sveltejs/svelte/issues/2803
https://github.com/sveltejs/svelte/pull/2804
394a166a4198ab27c4a2f3b51b042e1830c6bb09
931c080517948dd76044fb0be8eb49bb5c723305
2019-05-17T18:14:19Z
javascript
2019-05-21T01:11:46Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,799
["site/content/blog/2017-08-07-the-easiest-way-to-get-started.md"]
Getting started / Use degit example has '&' instead of '&&'
<!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> --> This is a documentation error and probably also an error in the `npm run dev` code when it finds port 5000 is already in use. ### 1) Documentation error In the Getting started page [here](https://svelte.dev/blog/the-easiest-way-to-get-started), under the heading "Use degit" the example features a single apersand, which spins off `npm run dev` in the background. This will cause problems if the process isn't killed manually. So: ``` npm run dev & open http://localhost:5000 ``` should be: ``` npm run dev && open http://localhost:5000 ``` ### 2) Possible error in `npm run dev` code. If you do `npm run dev` when port 5000 is already in use (e.g. because you copied and pasted the getting started command (`npm run dev & open http://localhost:5000`) the result is confusing and will take time to figure out. To replicate this, do: ``` $ npm run dev & ``` And then: ``` $ npm run dev > [email protected] dev /home/mrh/src/svelte/svapp > run-p start:dev autobuild > [email protected] start:dev /home/mrh/src/svelte/svapp > sirv public --dev > [email protected] autobuild /home/mrh/src/svelte/svapp > rollup -c -w Your application is ready~! πŸš€ - Local: http://localhost:5000 - Network: http://192.168.43.137:5000 ────────────────── LOGS ────────────────── { Error: listen EADDRINUSE :::35729 at Object._errnoException (util.js:992:11) at _exceptionWithHostPort (util.js:1014:20) at Server.setupListenHandle [as _listen2] (net.js:1355:14) at listenInCluster (net.js:1396:12) at Server.listen (net.js:1480:7) at Server.listen (/home/mrh/src/svelte/svapp/node_modules/livereload/lib/livereload.js:80:28) at Object.exports.createServer (/home/mrh/src/svelte/svapp/node_modules/livereload/lib/livereload.js:246:14) at livereload$1 (/home/mrh/src/svelte/svapp/node_modules/rollup-plugin-livereload/dist/index.cjs.js:19:27) at Object.<anonymous> (/home/mrh/src/svelte/svapp/rollup.config.js:44:18) at Module._compile (module.js:652:30) code: 'EADDRINUSE', errno: 'EADDRINUSE', syscall: 'listen', address: '::', port: 35729 } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] autobuild: `rollup -c -w` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] autobuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/mrh/.npm/_logs/2019-05-17T16_22_47_694Z-debug.log ERROR: "autobuild" exited with 1. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev: `run-p start:dev autobuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/mrh/.npm/_logs/2019-05-17T16_22_47_722Z-debug.log ```
https://github.com/sveltejs/svelte/issues/2799
https://github.com/sveltejs/svelte/pull/2800
298ae8ec236ee778710b0c1bf0858541b9191667
481ac14e7e504f8ff5c0d487262e436b426e4505
2019-05-17T16:26:01Z
javascript
2019-05-17T18:25:43Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,780
["src/store.ts", "test/store/index.ts", "test/test.js"]
cleanup is not a function
If a deriver returns a non-falsy value, Svelte assumes it is a function, even if it isn't. This causes problems with e.g. async derivers: ```js const foo = writable(1); // the deriver returns a promise const bar = derived(foo, async ($foo, set) => { set($foo * 2); }); ``` [Demo](https://svelte.dev/repl/b6887f08baaa4c9f96371fc0818e5d7d?version=3.4.0)
https://github.com/sveltejs/svelte/issues/2780
https://github.com/sveltejs/svelte/pull/2781
5d690f83e3ad6e625e61281cab4dab5639437248
9a564eddaa211f7b5f5ea72686289c8912a16775
2019-05-16T12:14:24Z
javascript
2019-05-16T14:40:02Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,774
["site/package-lock.json", "site/package.json"]
Array of refs still not working for components
Seems, this issue may be similar to https://github.com/sveltejs/svelte/issues/1916 Right now this works only for elements, not for components: https://svelte.dev/repl/6e952314892a491e860ca04fad9ed392?version=3.3.0
https://github.com/sveltejs/svelte/issues/2774
https://github.com/sveltejs/svelte/pull/6467
98ece151b326e39ea22198c416510ee6161284f3
487190fd93fa3fbd68e85effe149c013e446a812
2019-05-15T20:11:37Z
javascript
2021-06-28T22:10:07Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,773
["src/internal/animations.js", "src/internal/loop.js", "src/internal/transitions.js", "src/internal/utils.js", "src/motion/spring.js", "src/motion/tweened.js", "test/runtime/index.js", "test/runtime/samples/spring/_config.js", "test/runtime/samples/spring/main.svelte", "test/server-side-rendering/index.js"]
Spring prevents SSR
Reference to `window` breaks SSR: https://github.com/sveltejs/svelte/blob/0275aab800fc7c68c46408b3a38c677cce224e50/src/motion/spring.js#L54
https://github.com/sveltejs/svelte/issues/2773
https://github.com/sveltejs/svelte/pull/2782
5121a3cba8d21d8b430590971aa495f9cdbd101b
5d690f83e3ad6e625e61281cab4dab5639437248
2019-05-15T20:03:05Z
javascript
2019-05-16T14:39:47Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,764
["src/compile/render-dom/wrappers/DebugTag.ts", "test/js/samples/debug-hoisted/_config.js", "test/js/samples/debug-hoisted/expected.js", "test/js/samples/debug-hoisted/input.svelte"]
{@debug} displaying primitive values as undefined
### Minimal example https://svelte.dev/repl/b2e23e4311244f6694ced9e116c249ca?version=3.3.0 ### Description It seems that the `{@debug ...}` tag can't properly pull the primitive values into watcher's scope and as such, they end up being undefined, the same behavior is reflected in the `console.log` as part of debug where the variable is `undefined` as well. However, standalone `{console.log(...)}` displays them correctly. ### Screenshots <img width="676" alt="Screenshot 2019-05-14 at 20 44 07" src="https://user-images.githubusercontent.com/19926448/57747161-23849780-7689-11e9-9df9-4ae4fc899ee5.png"> ### Environment Chrome v74, Svelte v3.3.0
https://github.com/sveltejs/svelte/issues/2764
https://github.com/sveltejs/svelte/pull/2766
1dc0eb02f2c4d184bf76ce62d79d6dff25bd1d30
254dc94d47059dd233c9762098be62ed72f16d79
2019-05-15T03:55:09Z
javascript
2019-05-15T21:51:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,751
["src/compiler/compile/render_dom/wrappers/shared/get_slot_definition.ts", "test/runtime/samples/component-slot-let-destructured-2/Nested.svelte", "test/runtime/samples/component-slot-let-destructured-2/_config.js", "test/runtime/samples/component-slot-let-destructured-2/main.svelte"]
Error in destructuring let on non-let content update
See [repl example](https://svelte.dev/repl/128baed2cfb24cdea24ddfc14503e086?version=3.3.0) When externally updating the content of a component with a let binding (e.g. *not* due to a change of the let binding), and the binding has a destructuring expression, the destructuring expression is evaluated with undefined, which will cause an error. In the example, note that the first `<Await/>` block does not destructure, and works correctly when the `Increment` button is pressed, while the second third, otherwise identical except for the destructuring, causes the error when the `Increment` button is pressed: ``` VM516:738 Uncaught (in promise) TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)) at Array.Await.props.$$slots.default (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:738:36) at get_slot_changes (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:63:64) at Object.update [as p] (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:470:21) at Object.update [as p] (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:558:17) at update (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:173:16) at flush (eval at handle_message (VM365 about:srcdoc:68), <anonymous>:143:5) ```
https://github.com/sveltejs/svelte/issues/2751
https://github.com/sveltejs/svelte/pull/4149
5486d67adf2d48820e94a1812028dba9392975b7
75b8d3fb21f91b61e5937e8eb46a13b70cc945cc
2019-05-14T00:10:24Z
javascript
2019-12-23T19:15:21Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,745
["src/compiler/compile/render-dom/wrappers/Element/index.ts", "test/runtime/samples/script-style-non-top-level/_config.js", "test/runtime/samples/script-style-non-top-level/main.svelte"]
Spaces between html tags (like \n\t\t\t)
First of all thanks a lot for your work: **Svelte is amazing**! Now I have a problem with spaces. If you just use the below code in a REPL: ```html <li> <span>Test</span> <span>username</span> </li> ``` The compiler on my machine create a js with this code: ```js .innerHTML="<span>Test</span>\n\t\t\t <span>username</span>" ``` Maybe I'm wrong, but I would like to understand how to get everything compiled without `\n\t\t\t `. So from this: ```js .innerHTML="<span>Test</span>\n\t\t\t <span>username</span>" ``` to this: ```js .innerHTML="<span>Test</span><span>username</span>" ``` Am I wrong?
https://github.com/sveltejs/svelte/issues/2745
https://github.com/sveltejs/svelte/pull/3030
5e81280faa09cc9e26e764d16e4321270fdd57f4
9bce3fc586557d51ededbf82a6d99b36fbb8fc74
2019-05-13T00:07:06Z
javascript
2019-06-18T18:31:00Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,731
["src/compiler/compile/Component.ts", "test/runtime/samples/reactive-value-function/_config.js", "test/runtime/samples/reactive-value-function/main.svelte"]
Function identifiers declared in function statements don't participate in reactive blocks.
Function declaration statements don't declare `const` identifiers in Javascript. Svelte should treat these as variables and watch for reassignments so that `$:` reactive labels work as expected. https://svelte.dev/repl/70efd2f3add2453290e8940b0f4d17ed?version=3.2.2 ```javascript let blah =''; function doSomething() { blah = 'foo'; } setTimeout( () => { doSomething = () => { blah = 'bar'; } }, 1000); $: doSomething() // This won't run when `doSomething` is reassigned ```
https://github.com/sveltejs/svelte/issues/2731
https://github.com/sveltejs/svelte/pull/3451
8977da840a673fe196bae399c78823cc093fe662
3c7ebbd5b3bb4c0526a5981ade30a58d4e86a735
2019-05-10T04:40:57Z
javascript
2019-08-30T17:52:58Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,728
["src/compile/Component.ts", "src/compile/render-dom/index.ts", "test/runtime/samples/reactive-value-mutate-const/_config.js", "test/runtime/samples/reactive-value-mutate-const/main.svelte"]
Reactive declarations don't fire when a const is mutated
[REPL](https://svelte.dev/repl/fcc3c922c72b42b8bf51f7b7dd5cc723?version=3.2.2). These are treated differently: ```js const a = {}; let b = {}; // log when either is mutated $: console.log(a); // never happens $: console.log(b); ```
https://github.com/sveltejs/svelte/issues/2728
https://github.com/sveltejs/svelte/pull/2755
bf03847d885a9aabb00ab6c958de432db750c11a
c67f5348ea3a596ce408d85c09b15fad50f16679
2019-05-09T18:35:54Z
javascript
2019-05-15T21:53:34Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,725
["src/compiler/compile/render-dom/index.ts", "test/runtime/samples/binding-using-props/TextInput.svelte", "test/runtime/samples/binding-using-props/_config.js", "test/runtime/samples/binding-using-props/main.svelte"]
$$props usage in component will freeze bind values
Using `$$props` inside a component will freeze any bind values. This can be resolved by not referencing `$$props` or by updating both the value and the nested `$$props` value. This repl tries to illustrate the problem: https://svelte.dev/repl/aacb7e0b8066497490d3204f8a57491c?version=3.2.2
https://github.com/sveltejs/svelte/issues/2725
https://github.com/sveltejs/svelte/pull/3069
01676aac4698b4fb590aa37ea8bbb952f5282d93
60914b86fdffedd2f87434a0a3f280851fbfe2d6
2019-05-09T12:17:43Z
javascript
2019-06-23T12:34:36Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,724
["site/content/docs/02-template-syntax.md"]
Cannot set initial data to the scrollY property of <svelte:window> element
Trying to set some initial data to the `scrollY` property of `<svelte:window>` element doesn't seem to be working. If I bind the `scrollY` property to a variable and log that variable, it starts with the correct value, then immediately updates to zero. Is this a bug or am I missing something? https://svelte.dev/repl/7324999bbbb74353a7a930c763647994?version=3.2.1 Tested with Chrome 74, Safari 12.1 and Firefox 66.
https://github.com/sveltejs/svelte/issues/2724
https://github.com/sveltejs/svelte/pull/7065
54f277cd8e86ed02aa65fbb9f52e8cf2415241c6
cc445839e3172552dacdef10d09de651c3c1c0f2
2019-05-09T02:17:07Z
javascript
2022-01-14T05:10:33Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,721
["CHANGELOG.md", "src/compiler/compile/nodes/Element.ts", "src/compiler/compile/render_dom/wrappers/Element/index.ts", "src/compiler/compile/render_ssr/handlers/Element.ts", "src/runtime/internal/ssr.ts", "test/runtime/samples/spread-element-class/main.svelte", "test/runtime/samples/spread-element-scope/_config.js", "test/runtime/samples/spread-element-scope/main.svelte"]
Style scoping breaks spread with "class" attribute
<!-- Thanks for raising an issue! (For *questions*, we recommend instead using https://stackoverflow.com and adding the 'svelte' tag.) To help us help you, if you've found a bug please consider the following: * If you can demonstrate the bug using https://svelte.dev/repl, please do. * If that's not possible, we recommend creating a small repo that illustrates the problem. * Make sure you include information about the browser, and which version of Svelte you're using Reproductions should be small, self-contained, correct examples – http://sscce.org. Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster. If you have a stack trace to include, we recommend putting inside a `<details>` block for the sake of the thread's readability: <details> <summary>Stack trace</summary> Stack trace goes here... </details> --> There seems to be a bug related to the combination of spreads with "class" attributes, and scoped selectors in `<style>` tags. Example: ```html <script> const spread = { class: 'cursive' }; </script> <style> :global(.cursive) { font-family: cursive; } .this-class-breaks-the-spread {} </style> <p class={spread.class}>This should be cursive</p> <p {...spread}>This should be cursive too</p> ``` https://svelte.dev/repl/a27af26f3c184b799a02eab5732e3c59?version=3.2.1 It seems that various non-`:global` selectors produce the behavior, but not all. Try changing the selector from `.this-class-breaks-the-spread` to `p` and it breaks too. Possibly related to #2707
https://github.com/sveltejs/svelte/issues/2721
https://github.com/sveltejs/svelte/pull/3792
33c8cd33292405af00a500c2b860ce4b6e29e535
85692cbd5ac9f24f02c37f641feb54cdac54ca8c
2019-05-08T18:47:40Z
javascript
2019-10-25T17:03:09Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,715
["src/compile/render-dom/wrappers/Element/StyleAttribute.ts", "test/runtime/samples/attribute-url/_config.js", "test/runtime/samples/attribute-url/main.svelte"]
Inline styles with inner quotes have parsing issues
Svelte 3.2.1 Here's the [REPL link](https://svelte.dev/repl/5fab983a191d459da149ef55e7962cf8?version=3.2.1) to demonstrate. Basically, I need to use inline styles for background-image since the image URL is dynamic. And, because of habit, I add the quotes surround the image URL in `url()` function like so: ```html <div style="background-image: url('{bgImage}')">This work!</div> ``` But as soon as I added the trailing semi (so that I can append another style rule), the inline style broke and nothing render for the style attributes. ```html <div style="background-image: url('{bgImage}');">This does NOT work!</div> ``` My current workaround is to omit the inner quotes (it is completely optional in CSS `url()` but may be `content` and other properties might need them).
https://github.com/sveltejs/svelte/issues/2715
https://github.com/sveltejs/svelte/pull/2754
c67f5348ea3a596ce408d85c09b15fad50f16679
75a77fea22f0a0b30047d9ba0bf654ba416ddae6
2019-05-08T08:10:34Z
javascript
2019-05-15T21:54:38Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,711
["src/compiler/compile/render_dom/wrappers/RawMustacheTag.ts", "src/runtime/internal/dom.ts", "test/js/samples/each-block-changed-check/expected.js", "test/runtime/samples/each-block-keyed-html-b/_config.js", "test/runtime/samples/each-block-keyed-html-b/main.svelte"]
unexpected behavior using unwrapped html expression as component output
https://svelte.dev/repl/98745830909e4c88979965fe00a8ba3a?version=3.2.1 ### Repro Steps: 1. change the text in any field to modify the alphabetical order 2. change the focus Repros in Chrome, FF, Safari. Svelte 3.2.1 Doesn't repro if the html expression is wrapped in an html tag by itself
https://github.com/sveltejs/svelte/issues/2711
https://github.com/sveltejs/svelte/pull/3350
873a561e83f1910c1947786b1c770a5a73a3b7f8
8e62bd0b276c3d7e7bc6d61da96d82f187e3861e
2019-05-07T22:42:23Z
javascript
2019-08-04T14:01:32Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,710
["src/runtime/store/index.ts"]
Use Set instead of array for subscribers, etc
I [just realised](https://mobile.twitter.com/Rich_Harris/status/1125858572078845952) how much faster it is to remove an item from a list if you use a `Set`. Since Svelte now assumes a modern JS environment (albeit only the parts that can be decently polyfilled/transpiled if necessary) it makes sense to use `Set` for lists of subscribers and callbacks and what-have-you
https://github.com/sveltejs/svelte/issues/2710
https://github.com/sveltejs/svelte/pull/6295
48934c8cd02d14ec3b3a4d4ff90eb3a00e00bccb
b2260bc2e3dbfe4bf5b9c6c1705aa4e3daf6120f
2019-05-07T20:26:55Z
javascript
2021-07-22T04:27:31Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,697
["src/compile/render-dom/wrappers/Slot.ts"]
`get_slot_changes` not initialized to null
This results in a trailing comma in the function call, which is normally fine for modern envs but, ha, of course not in ancient ones. Current output when the node has no values: ```js default_slot.p(get_slot_changes(default_slot_1, ctx, changed,), get_slot_context(default_slot_1, ctx, null)); ^ ```
https://github.com/sveltejs/svelte/issues/2697
https://github.com/sveltejs/svelte/pull/2698
c4e05f20861601002acd7903b8aed5f73d6e1198
53c66654b755d02a5e191fdac3e6d9b1604999f8
2019-05-06T14:24:41Z
javascript
2019-05-09T03:17:31Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,693
["src/compiler/compile/nodes/Animation.ts", "src/compiler/compile/nodes/EventHandler.ts", "src/compiler/compile/nodes/Transition.ts", "src/compiler/compile/nodes/shared/Expression.ts", "test/js/samples/action-custom-event-handler/expected.js", "test/runtime/samples/reactive-function-inline/_config.js", "test/runtime/samples/reactive-function-inline/main.svelte", "test/runtime/samples/reactive-function/_config.js"]
filtering with store value doesn't trigger re-render
When filtering a list using a store value, it doesn't trigger a re-render if the filtering is done inline in an expression. It does trigger a re-render if you create a reactive variable first. This does not trigger a re-render of the code inside the `each` block if `$selectedItem` is updated: `{#each $list.filter(d => d === $selectedItem) as item}` But first declaring this... `$: filteredList = $list.filter(d => d === $selectedItem) as item}` ... and then ... `{#each filteredList as item}` ... does re-render the `each` block when the `$selectedItem` is updated. I would expect in the latter case that a re-render would be triggered as well, since `$selectedItem` is updated See the example in the REPL for the mentioned behavior: [https://svelte.dev/repl/57a0f818a94642ea8413a6372b6ecc38?version=3.2.0](https://svelte.dev/repl/57a0f818a94642ea8413a6372b6ecc38?version=3.2.0) Using Svelte v3.2.0
https://github.com/sveltejs/svelte/issues/2693
https://github.com/sveltejs/svelte/pull/3147
1427206f85c8ac4bb2f873f43ac289c75c8b86bc
73a745b8d10da9c80d1c7b8d1771e37c058f25dc
2019-05-06T09:34:48Z
javascript
2019-07-01T15:28:51Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,689
["src/compiler/compile/render-dom/wrappers/EachBlock.ts", "src/compiler/compile/render-dom/wrappers/Element/index.ts"]
Outro transition not playing if inside #if #each
I would expect all items to have the same intro en outro effect, see the bug in action in this [REPL demo](https://svelte.dev/repl/23b09660f24542d3b3f67a463dce3371?version=3.2.0) in version `3.2.0`. The code: ```html <script> import { fade } from 'svelte/transition'; let checked = true; </script> <label> <input type=checkbox bind:checked> Trigger </label> {#if checked} {#each [1] as x } <p in:fade out:fade>if each in out</p> <p transition:fade>if each transition</p> {/each} <p in:fade out:fade>if in out</p> <p transition:fade>if transition</p> {/if} ```
https://github.com/sveltejs/svelte/issues/2689
https://github.com/sveltejs/svelte/pull/2690
86c08c6e2e59e53f9bfb64192e9ee38cc3aaef07
a5cdc13b508483ce5a7145ac00d9be77dc1bccec
2019-05-05T19:34:14Z
javascript
2019-06-04T13:24:57Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,687
["src/compile/Component.ts", "test/runtime/samples/reactive-value-function-hoist/_config.js", "test/runtime/samples/reactive-value-function-hoist/main.svelte"]
Functions using reactive variables are hoisted outside of the instance
The following piece of code throws `VM47:312 Uncaught ReferenceError: square is not defined` when clicking the button ([REPL](https://svelte.dev/repl/6fd3e4bfa1ae43ffbff6eaaab6149477?version=3.2.0)). ```html <script> let num = 2; $: square = num * num; function onClick() { console.log(square); } </script> <button on:click={onClick}>Click me</button> ``` It looks like the `onClick` function is being hoisted outside the `instance` function even though it uses `square`. ```javascript function onClick() { console.log(square); } function instance($$self, $$props, $$invalidate) { let square; $$self.$$.update = ($$dirty = { num: 1 }) => { if ($$dirty.num) { $$invalidate("square", (square = num * num)); } }; return {}; } ``` If I write `let square;` before the reactive statement it works as expected.
https://github.com/sveltejs/svelte/issues/2687
https://github.com/sveltejs/svelte/pull/2703
aa5b52239f3acc68b50da795aca80fbb0ccc0b47
c4e05f20861601002acd7903b8aed5f73d6e1198
2019-05-05T14:20:00Z
javascript
2019-05-09T03:14:22Z
closed
sveltejs/svelte
https://github.com/sveltejs/svelte
2,681
["src/compile/render-dom/index.ts", "test/runtime/samples/instrumentation-auto-subscription-self-assignment/_config.js", "test/runtime/samples/instrumentation-auto-subscription-self-assignment/main.svelte"]
$foo = $foo gets completely compiled away
If you've mutated and autosubscription value without an assignment being involved, it will now be out of date with the actual store. Presumably, this is how we want this to behave, and something like `$foo.push(whatever);` shouldn't get instrumented. Also presumably, the way to deal with this is to then do `$foo = $foo;` which will compile to `foo.set($foo);`, but currently that is getting compiled away into nothing.
https://github.com/sveltejs/svelte/issues/2681
https://github.com/sveltejs/svelte/pull/2683
4bc93a3b1fbbd9c96f209cff6456f8c685c3ece0
117afe9a712d89765891318a14c454189a780068
2019-05-05T01:39:14Z
javascript
2019-05-06T10:53:23Z