0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
Commit Graph

7069 Commits

Author SHA1 Message Date
Nguyen Tran
ed575cc927
fix: make svelte-ignore work above components (#8338)
Fixes #8082, where svelte-ignore somehow does not pick up the reactive-component warning.

The issue on this problem is that the map_children function suppresses warnings and errors while traversing AST nodes as src/compiler/compile/nodes classes. However, the reactive-component warning is called in src/compiler/compile/render_dom/wrappers/InlineComponent/index.ts, and its warnings are not suppressed in map_children. Thus, we need to extract ignores and suppress here separately.
2023-03-01 11:06:15 +01:00
Simon H
dc36d0c9af
fix: typings for naturalWidth/Height bindings
follow-up to #7857
2023-02-28 22:42:59 +01:00
Simon H
b5b0d1f2d4
chore: update changelog 2023-02-28 22:39:23 +01:00
Simon H
6ec5a0ed24
chore: update changelog 2023-02-28 18:40:23 +01:00
xxkl1
f34abc5689
fix: decode html entities correctly (#8047)
fixes #8026

1. replace the big entities list with entities that have a ; at the end where valid (there are some exceptions)
2. construct two regexes from that entities list: one for HTML where it's strictly matched, one for attributes where it tries to match browser behavior by also allowing = / digit / character afterwards
3. decode character references with one of these regexes depending on this is an attribute value or not

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-28 18:21:39 +01:00
lidlanca
aa15a64cbe
fix: account for <template> tag in {@html} (#7364)
Ensure innerHTML for template is done on template element
fixes #7315
fixes #7319

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-28 18:16:55 +01:00
Tan Li Hau
dc7fd76e53
Update CHANGELOG.md 2023-03-01 00:03:06 +08:00
Simon H
60db05da86
fix: hide some a11y warnings for <svelte:element> tags (#8335)
Some a11y warnings only work on specific tags, which results in potential false positives for `<svelte:element>` tags - silence those
closes #7939
2023-03-01 00:01:40 +08:00
Tan Li Hau
f1c9168aef
Update CHANGELOG.md 2023-02-28 23:59:11 +08:00
Tan Li Hau
f6dc86f02c
feat: optimise svelte-element output code for static tag and static attribute (#8161)
* feat: optimise svelte-element output code for static tag and static attribute

* Update src/compiler/compile/render_dom/wrappers/Element/index.ts

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* Update src/runtime/internal/dom.ts

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* Update src/compiler/compile/render_dom/wrappers/Element/index.ts

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>

* fix logic

* fix pipeline errors

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-28 23:57:45 +08:00
Invader Zim
d4363510fc
docs: add console output instruction to tutorial (#8336) 2023-02-28 09:44:39 +01:00
Theodor Steiner
c7bbe55b9f
feat: introduce axis parameter to allow for horizontal slide transition (#6183)
---------

Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2023-02-27 17:58:23 +01:00
Simon H
b5ec863a0e
chore: update changelog 2023-02-27 17:13:50 +01:00
Cory Virok
32a94fcfc5
chore: implemented a small runtime optimization for SSR (#7539)
Prior to this change, the compiler would generate a template literal that had many purely static
string variables nested within it. This change collapses these static strings into the surrounding
template literal which should result in (minor) size and performance improvements for the SSR
generated code.

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-27 16:32:45 +01:00
Tan Li Hau
fc5f629812
Update CHANGELOG.md 2023-02-27 22:04:20 +08:00
David Hunt
4e8efd3c1e
fix: fixes sveltejs/svelte#8214 bind:group to undefined (#8215)
* fixes sveltejs/svelte#8214 bind:group to undefined

* fix code and add test

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-27 22:02:34 +08:00
Vaibhav Rai
26104eaaba
fix: no error assigning to a const property (#7966)
Fixes #7964
currently for a case where the parent type is ArrayPattern code needs to check if the elements are of direct type MemberExpression or Identifier, in the case of MemberExpression there will be an Identifier check for the Object of the MemberExpression.

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-27 13:45:14 +01:00
4eb0da
9edd2df0d3
fix: check each_blocks is empty on mount (#7505)
fixes #8282
2023-02-27 13:36:57 +01:00
Nico Beierle
474a13ad90
fix: prevent undefined value when remount keyed input element with spread props (#7699)
Fixes: #7578

When remounting a keyed input element (e.g. because the element order has changed) with spread properties, the input value gets undefined. This has happened because data_value is updated before remounting and it won't contain a value for input-value (because the value hasn't changed). When calling mount() an undefined value was assigned because of a missing check.
2023-02-27 13:25:24 +01:00
Theodore Brown
8cf037c904
fix: select first enabled option by default when initial value is undefined (#8331)
Fixes an unintended regression introduced in #6170.

Fixes #7041
2023-02-27 13:11:06 +01:00
adiGuba
69c199feac
fix: race condition in svelte:element with transition #7948 (#7949)
fixes #7948
- The assignment of the variable "previous_tag" was incorrectly positioned and could cause race condition when used with transitions.
- We need another variable to detect when we are in a transition to remove a node

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-27 13:10:22 +01:00
Yuichiro Yamashita
60a205edb8
fix: don't set selected option(s) if value is unbound or not passed (#8329)
fix: #5644

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-27 13:00:35 +01:00
Nguyen Tran
b56dfe51a8
feat: add a11y role-supports-aria-props (#8195)
#820

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-27 12:28:59 +01:00
Yuichiro Yamashita
5f99ae76ce
chore: Reduce number of lines of expected files (#8325)
- removes character and pos from the expected output to reduce noise
- adds a test that pos/character are correct
2023-02-27 11:40:24 +01:00
Simon H
636290af95
fix: remove indeterminate from boolean attributes (#8334)
It's only existing as a boolean property
cleanup of #7944
2023-02-27 11:33:45 +01:00
Yuichiro Yamashita
3423bf6b30
add docs (#8326) 2023-02-26 22:40:36 +08:00
Tan Li Hau
79c64df41b
Update CHANGELOG.md 2023-02-26 22:37:15 +08:00
Yuichiro Yamashita
1f3d2f7646
fix: better handling of inert attribute (add tests) (#7944)
* add inert to attribute_lookup

* typed for preventing a repeat of the tragedy

* add tests

* revert unnecessary change

* add more test

---------

Co-authored-by: fcrozatier <frederic.crozatier@protonmail.com>
2023-02-26 22:35:00 +08:00
Ben McCann
ca531519a8
chore: switch to @jridgewell/sourcemap-codec (#8321) 2023-02-24 15:50:22 -08:00
Tan Li Hau
d16dd5d7ca
feat: add naturalWidth and naturalHeight bindings (#7857)
Closes #7771
---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-24 14:20:44 +01:00
Simon H
ba8f979f03
chore: update changelog 2023-02-23 18:49:49 +01:00
Mike Randazzo
487fedce6c
docs: describe that bind:value creates a two-way binding (#8311)
---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-23 13:46:08 +01:00
Hong-Kuan Wu
835362af88
fix: check url and search input field values before updating (#7111)
Fixes #7027
2023-02-23 12:36:27 +01:00
Alvin Ramskogler
9f89a92d31
feat: add readonly method to convert writable store to readonly (#6518) 2023-02-23 12:17:34 +01:00
Simon H
0bdb59c2e2
fix: compute rect directly before crossfading (#8314)
closes #4344
fixes #4111
2023-02-23 12:03:29 +01:00
Jos de Jong
e5b0b6235d
fix: ensure bind:offsetHeight updates (#8096)
fixes #4233 by calling the callback after the iframe loads, which may be asynchronous

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-23 12:03:12 +01:00
Simon H
709264a94c
chore: update changelog 2023-02-22 20:08:46 +01:00
Tan Li Hau
53de73d08c
feat: simpler output for reactive vars if dependencies are all static (#7942) 2023-02-22 20:02:42 +01:00
Vaibhav
c9a269c149
fix: silence no content a11y warning if the tag has an aria-label (#8299)
fixes #8296

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-22 17:19:33 +01:00
ngtr6788
3559997223
feat: implement a11y aria-activedescendant-has-tabindex (#8172)
#820
2023-02-22 17:14:21 +01:00
Simon H
a71b8b9958
chore: improve parser performance (#8303)
- fast path for attribute quote marks common case
- all regexes exclusively passed into read or match_regex which are only successful if matched at the beginning are altered so that the regex has this condition built in, preventing it from searching past the start index

---------

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-22 16:18:36 +01:00
brunnerh
e3e912ab58
Fix accessibility of options tutorial. (#8308)
Use button instead of non-interactive element (div).
(Removes a Svelte a11y warning.)
2023-02-22 09:51:26 +01:00
Yuichiro Yamashita
a0cedf8d82
fix: flush remaining afterUpdate before destroy (#7516)
fixes #7476
2023-02-22 09:46:49 +01:00
Rémi Marche
57d869d028
[docs] move @html tutorial to end (partly fixing #7253) (#7254)
* Move @html tutorial to end

* move debug and html tag into one section

* rename

---------

Co-authored-by: Rémi Marche <35939574+Marr11317@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-02-21 20:00:15 +01:00
Simon H
87424b3137
chore: update changelog 2023-02-21 18:14:15 +01:00
Carlos Ivanchuk
aa9b2dd5f3
fix: omit a11y warning on <video> when aria-hidden="true" (#7880)
Related to #5967. Closes #7874

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 17:27:49 +01:00
Valter Kraemer
2a5b488386
fix: empty value attribute selector doesn't produce "Unused CSS selector" warning (#8122)
Fixes: #8042

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 15:21:48 +01:00
Ben Bucksch
f6ef6a9349
fix: don't throw when calling writable() unsubscribe twice (#8186)
Fixes one case of #4765

---------

Co-authored-by: Ben Bucksch <bbucksch@jw.org>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-02-21 13:52:39 +01:00
Jhorman Ruswel ㅠㅠ
85f882f23d
docs: update Keyed Each Blocks tutorial (#8188)
log which element is removed

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-02-21 13:13:50 +01:00
Simon H
324b791d81
docs: note #if to wrap text only
taken from #7070
2023-02-21 13:04:12 +01:00