0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
Commit Graph

1221 Commits

Author SHA1 Message Date
Tan Li Hau
c99dd2e045
fix: binding group with if block (#8373)
Fixes #8372

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-03-14 10:17:50 +01:00
Theodore Brown
c7dcfac883
fix: select option with selected attribute when initial state is undefined (#8371)
Resolves a second unintended regression introduced in #6170.

Follow-up to #8331, this time addressing the root issue so the correct select option won't be deselected in the first place when the initial bound value is undefined.

Fixes #8361
2023-03-13 18:21:51 +01:00
Tan Li Hau
0966d1d282
feat: improve bind:group behavior (#7892)
track all `#each` variables that could result in a change to the inputs and also update the `$$binding_groups` variable which holds the references to the inputs of each group accordingly.

Fixes #7633
Fixes #6112
Fixes #7884
2023-03-02 19:57:38 +01:00
Tan Li Hau
fbaf3cfc12
fix: call <svelte:component> update to this only when it's dirty (#4192)
Closes #4129

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2023-03-01 17:28:37 +01:00
Tan Li Hau
c611f318d2
feat: add stopImmediatePropagation event modifier (#8341)
Closes #5085

---------

Co-authored-by: Marcin Wicha <23581770+marcin-wicha@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2023-03-01 11:51:40 +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
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
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
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
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
Yuichiro Yamashita
a0cedf8d82
fix: flush remaining afterUpdate before destroy (#7516)
fixes #7476
2023-02-22 09:46:49 +01:00
Emil Tholin
b06e435684
[fix] Spread component props immutably during SSR (#8176)
By passing an empty object literal as first argument to Object.assign we can avoid having objects spread as props on a component being mutated during SSR.

Fixes #8171
2023-01-10 09:39:50 +01:00
Yuichiro Yamashita
4b84c4df3a
[fix] Improve is_promise handling (#8162)
* correctly handle promises that are of function type

* add License

Co-authored-by: Vilsol <me@vil.so>
2023-01-03 12:48:06 +09:00
Simon H
762d0429b1
[fix] propagate bindings correctly (#8114)
Fixes #8103 introduced through #7981
Keeps the infinite loop from happening but reopens #6298 and #5689
2023-01-02 14:51:01 +09:00
Ramon Snir
f84c00edb9
[fix] static svelte:element not replaced with tag in production mode (#7938)
* [fix] static svelte:element not replaced with tag in production mode

* [fix] static svelte:element not replaced with tag in production mode

* add optimization of static <svelte:element> and fix a bug

Co-authored-by: Yuichiro Yamashita <xydybaseball@gmail.com>
2023-01-01 16:41:00 +08:00
Yuichiro Yamashita
94e51df07b
[fix] escape style attribute for SSR (#8087) 2022-12-06 14:23:23 -05:00
Tan Li Hau
2f61907ec1
[fix] allow invalidating variables from @const declared function (#7858) 2022-12-06 00:01:51 +09:00
Simon H
4c5469b1ee
[fix] don't run binding init unnecessarily (#7981) 2022-12-05 23:43:39 +09:00
Pat Cavit
84d61c61f8
[feat] Add options w/ direction to transitions (#8068) 2022-12-05 22:43:59 +09:00
Josh Soref
b265bc6f0f
[chore] fix spelling and typos (#7974) 2022-10-27 08:09:18 -07:00
Tan Li Hau
158ec43d99
[fix] do not warn about missing props for bindings (#6583) 2022-10-06 23:29:48 +09:00
Tan Li Hau
81d4dbad99
[fix] call on_destroy if unmounted called immediately before on_mount (#7860)
* call on_destroy if unmounted called immediately before on_mount

* feat: review changes
2022-10-06 10:21:36 +09:00
Yuichiro Yamashita
01a91163a9
[fix] Improve error message if this attribute of <svelte:component> is not valid (#7551)
* add test

* improve error message if this attribute of <svelte:component> is not SvelteComponent

* add more tests

* improve validation

* simplify test

Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2022-10-05 23:28:00 +08:00
Tan Li Hau
b20fb114a6
allow nullish values for component event handlers (#7863) 2022-09-21 21:48:01 +08:00
Yuichiro Yamashita
433460ec2d
[feat] skip custom element check if <svelte:element> uses under svg (#7869)
* add test

* skip custom element check if svelte element uses under svg
2022-09-15 22:22:40 +09:00
Yuichiro Yamashita
1e2a55c88e
throw warning instead of error (#7834) 2022-09-12 02:48:13 +08:00
Yuichiro Yamashita
07d6d179ab
[fix] style manager transition regression (#7831) 2022-09-08 16:49:57 -04:00
Yuichiro Yamashita
3570a5361e
[fix] Apply class directive properly after half way transition (#7765) 2022-08-14 17:26:19 +09:00
qinmu
5dd703fe81
[fix] handle arrow function on slot inside svelte:fragment (#7667)
Fixes #7485
2022-07-28 18:02:15 +02:00
Tan Li Hau
26d1455b27
fixed removal of empty stylesheets created from transitions (#7662)
Co-authored-by: Mathias Picker <mattis123@live.no>
2022-07-17 17:25:36 +08:00
Tan Li Hau
2db60a77e1
rename test files from svelte-slot -> svelte-fragment (#7679) 2022-07-12 23:20:44 +08:00
qinmu
02f60fbebf
[fix]destroy empty component (#7492)
* fix: destroy non-fragment element such as empty components

* fix: fragment property of Empty Component is set as true in dev mode, inconsistent with production mode

* chore: revert 'removal' of component.compile_options.dev

* feat: add test for destroying empty component

* chore: update typechecking callback

* chore: revert fragment dev checks

* chore: remove unnecessary comment

* chore: update test for empty-component-destroy

* fix: revert back the patching of console.log

* use before_test and after_test

Co-authored-by: qinmu <magenta2127@mail.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-04 09:45:39 +08:00
Yuichiro Yamashita
6776fe03fd
fix to apply class directive for svelte:element (#7531) 2022-05-18 11:12:10 +08:00
Yuichiro Yamashita
0d017f4820
[fix] rendering void tag for <svelte:element> (#7453) 2022-04-30 14:37:09 -04:00
Tan Li Hau
a2de3894c0
[feat] support const tag for if block (#7451) 2022-04-30 14:34:58 -04:00
Yuichiro Yamashita
1f1750e72e
[fix] always use set_attributes for attribute of <svelte:element> (#7486) 2022-04-30 14:03:59 -04:00
Yuichiro Yamashita
1803290864
[fix] Specify svg namespace if {@html} is used in svg (#7464)
* add test

* create svg element if {@html} tag is inside of svg

* always use claim_html_tag
2022-04-20 00:20:16 +08:00
Yuichiro Yamashita
eb37f4a285
[chore] fix lint (#7466) 2022-04-16 19:16:15 +02:00
lidlanca
fb341cca2c
[fix] textContent should not be set for <template> element. (#7297)
* [fix] textContent should not be set for <template> element.

* tidy - name convetion. minor refactor extract "is template" check to a variable and replace usages.

* test template with text content

* update html in test
2022-04-16 10:24:59 +08:00
Bob Fanger
0b0221de99
[fix] Local transitions from #key blocks (#7286)
* fix: Local transitions from #key blocks

When adding `|local` to a transition inside a {#key} block, only the outro was triggered not the intro.

This PR fixes #5950

* add test case

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-04-16 09:40:53 +08:00
Yosuke Ota
3a238fe057
[fix] strip leading newline after <pre> and <textarea> (#7280)
Fixes #7264
2022-04-14 16:31:03 +02:00
Tan Li Hau
4aff59b080
[fix] correctly track dependencies of let: bindings (#7448)
Fixes #7440
2022-04-13 17:34:40 +02:00
Tan Li Hau
e50be669cc
fix const declared without let: binding get ignored (#7434) 2022-04-12 16:38:08 +08:00