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

2543 Commits

Author SHA1 Message Date
Tan Li Hau
6a582af839
[fix] script style end parsing (#6511)
* update script end tag parsing to allow whitespace after tagname

* update style end tag parsing to allow for whitespace after tag name

* handle no closing match for script and style for eof and non-eof failures

* cleaning up script and style end tag parsing

Co-authored-by: pngwn <hello@pngwn.io>
2021-07-12 22:57:27 +08:00
Tan Li Hau
ebaa891e69
[chore] update code-red@0.2.0 (#6425)
Co-authored-by: Conduitry <git@chor.date>
2021-07-10 06:15:44 -07:00
Tan Li Hau
2cec6a94bc
[feat] sourcemap markup (#6427)
* sourcemap markup

* sourcemap textnode

* update test
2021-07-10 12:12:44 +08:00
Jonnie
7bcbe67939
add ssr for group bindings (#4621)
* add ssr for group bindings

* remove unnecessary chunk length check

* check if checkbox or radio

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2021-07-10 12:07:37 +08:00
Tan Li Hau
f60cb22a9d
standalone :global() with multiple selectors shouldn't be treated as error (#6508) 2021-07-08 11:24:22 -04:00
Daybrush (Younkue Choi)
201a71d8b7
fix insert function (#6445) 2021-07-08 05:39:53 -07:00
Geoff Rich
391258aa10
Remove caption warning on <audio> (#6054) 2021-07-02 12:02:02 -07:00
Geoff Rich
e73f641ca5
Remove deprecated a11y-no-onchange warning (#6457) 2021-06-29 10:46:03 -04:00
Tan Li Hau
fca6a6d38a
:global() with pseudo element should be considered as global (#6470) 2021-06-29 10:45:29 -04:00
Tan Li Hau
98ddf8b588
update periscopic (#6471) 2021-06-29 10:44:54 -04:00
Ignatius Bagus
8c3fb922d8
only check selector that are direct children of :global (#6435)
* failing test for i6434

* use string match to simplify regexp

* more tests

* separate test suite

* test for commas inside attributes

* stricter regex pattern

* test escaped brackets and parentheses

* change latest test selector to lists

* correct failing test for escaped parentheses

* update with proposed pattern
2021-06-29 15:08:58 +08:00
Maxime LUCE
aedf69c1cf
Add compilation variables report option to allow getting all variables (even undeclared or internal) (#6192)
* feat: add compilation variables report option

* test: add full var report test

* docs: document varsReport compile option
2021-06-29 09:43:52 +08:00
Luis Confraria
554d5dd391
Fix preserveComments on ssr (#4736)
Fixes #4730

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2021-06-28 12:56:12 +02:00
Anthony Le Goas
58790a9281
a11y: check if mouse events are accompanied by key events (#5938) 2021-06-28 12:50:52 +02:00
Mohammed Al-Qurafi
1b33248ead
#6299 - Throw a compile error when passing an empty directive name (#6300)
* Compile error when passing empty directive names

* Revert "Compile error when passing empty directive names"

This reverts commit ac8718b3a4.

* Compile error when passing empty directive names

* Adjust empty-directive-name error offset
2021-06-28 18:13:02 +08:00
zerdox
0df9233fb1
Fix wrong "slot" property warning (runtime) (#6065)
* updated: condition for warning about unknown prop

* test are updated
2021-06-28 14:45:22 +08:00
Dennis Kaspar
b464320607
Add trusted modifier (#6149)
Fixes #6137

Adding a trusted modifier to make events not be dispatchable by console/sourcecode.
Useful to prevent injected code to automatically dispatch event for preventing botting
2021-06-27 18:48:42 +02:00
Roy Choo
228832c9a3
fix: :global(...):some-pseudoclass should be considered global (#6317) 2021-06-22 11:03:08 -04:00
Hasan Altan Birler
04bc37de31
Improve hydration by reordering optimally (#6395)
* Implement new hydration optimization

During hydration, greedily pick nodes that exist in the original HTML that should not be detached.
Detach the rest.

* Implement optimal reordering during hydration

During hydration we track the order in which children are claimed.
Afterwards, rather than reordering them greedily one-by-one, we reorder all claimed children during the first append optimally.
The optimal reordering first finds the longest subsequence of children that have been claimed in order.
These children will not be moved.
The rest of the children are reordered to where they have to go.
This algorithm is guaranteed to be optimal in the number of reorderings.

The hydration/head-meta-hydrate-duplicate test sample has been modified slightly.
The order in which the <title> tag is being generated changed, which does not affect correctness.

* Fix issue potentially causing extra reorders

Not sorting children before executing the `insertBefore` calls in `init_hydrate` potentially caused extra `insertBefore` calls in `append`

* Simplify`init_hydrate` sorting logic
2021-06-22 10:34:48 -04:00
Tan Li Hau
a6055b34d9
fix slot props not updated when transition aborted (#6414) 2021-06-22 10:26:47 -04:00
Tan Li Hau
7d39e676c5
bind this in bubbled events (#6417) 2021-06-22 10:12:25 -04:00
Tan Li Hau
bbcc1e7479
disallow multiple selectors inside :global() (#6428) 2021-06-22 10:03:56 -04:00
Tan Li Hau
bce3641e92
fix escaping attributes in spread in SSR (#6429) 2021-06-22 09:50:43 -04:00
Tan Li Hau
3acaa03f6f
fix textarea end tag parsing (#6424) 2021-06-22 09:43:51 -04:00
Bjørn
de6d0c66d3
Add a more descriptive message for the error generated by an empty shorthand attribute (#6217)
Added error message "empty-attribute-shorthand" for when the shorthand attribute is empty,
giving a more explicit error for #6086
2021-06-22 15:33:50 +02:00
Tan Li Hau
3f990a96ba
Use SSR rendered as initial html for runtime hydration test (#4444) 2021-06-18 19:06:01 -07:00
Ignatius Bagus
b295d68ec6
fix types: allow writable/readable empty initialization (#6293)
Fixes #6291
Fixes #6345

Both writable and readable initialized without any arguments are already valid, but TS complains about it. This makes both allowed to be emptily initialized. It's also possible to invoke readable with one argument only.
2021-05-20 15:31:51 +02:00
Conduitry
6d16e92606
Revert hydration optimisation (#6290)
Co-authored-by: haveyaseen <haveyaread@gmail.com>
2021-05-03 16:37:19 -04:00
Tan Li Hau
94bfeae5d5
fix claim_text (#6275) 2021-05-01 11:08:30 -04:00
Tan Li Hau
ebd21ae6d3
fix updating of slot contents when aborting transition (#6042) 2021-04-30 12:05:43 -04:00
Térence Hollander
842b8412b6
fix(a11y): do not warn if href value is dynamic (#6110) 2021-04-30 11:55:38 -04:00
Geoff Rich
7042755e7a
fix setting boolean attributes on custom elements (#6073) 2021-04-30 11:48:27 -04:00
Tan Li Hau
02b49a1bb4
implement passing CSS custom properties to components (#6237) 2021-04-30 11:36:36 -04:00
Tan Li Hau
3d1af7fb68
support :global() in compound selector (#6223) 2021-04-30 10:35:40 -04:00
Lyu, Wei-Da
00e58e7bc8
Fix {#await} block scope when updating (#6219) 2021-04-30 10:18:07 -04:00
halfnelson
4633697214
Don't auto change to svg namespace when in foreign namespace (#6261) 2021-04-30 10:10:49 -04:00
Tan Li Hau
6c5257beb2
allow passing in context in constructor (#6032)
Co-authored-by: Conduitry <git@chor.date>
2021-03-31 11:07:32 -04:00
Conduitry
286c60da4d
fix missing slotted elements in AST (#6148) 2021-03-29 22:55:52 -04:00
Tan Li Hau
1d6e20f2a9
implement <svelte:fragment> (#4556)
add validation and test

replace svelte:slot -> svelte:fragment

slot as a sugar syntax

fix eslint
2021-02-27 12:43:53 -05:00
Rich Harris
2925a00eff
add cssHash option (#6026)
* Allow to customize the css scope class

* Pass component name to scope class generator

* Move Stylesheet arguments into an object

* Refactor to cssHash

* Please the almighty linter

* pass hash function to cssHash

* update test

* document cssHash option

Co-authored-by: Christian Kaisermann <christian@kaisermann.me>
2021-02-25 18:06:38 -05:00
Tan Li Hau
d17a90cc44
allow destructured defaults to refer to variables (#5986)
Co-authored-by: M. Habib Rosyad <habib@volantis.io>
Co-authored-by: Conduitry <git@chor.date>
2021-02-25 11:36:44 -05:00
Tan Li Hau
b764374b62
no warning on contextual-store if declaring it as a parameter / variable (#6008) 2021-02-25 10:53:23 -05:00
Pontus Lundin
d4f98fb63a
Call onMount when connected & clean up when disconnected for custom element (#4522)
* call onDestroy when disconnected

* lifecycle hooks and custom elements
- Call onMount in connectedCallback for customElements
- register onMount return values as on_disconnect-callbacks for customElements
- run on_disconnect callbacks in disconnectedCallback

* do not reset on_mount so that it can fire again if reinserted

* simpler isCustomElement & skip extra function call
- pass options.customElement down to mount_component
- remove expensive isCustomElement check
- only call add_render_callback if not customElement

Co-authored-by: Pontus Lundin <pontus.lundin@ica.se>
2021-02-15 22:40:17 +00:00
Tan Li Hau
e8094df779
fix remove of lone :host selectors (#5984) 2021-02-10 22:01:50 -05:00
pushkine
a9c1dc9b59
fix extra invalidation with component prop binding to object property (#5890) 2021-02-08 14:22:25 -05:00
Tan Li Hau
8867bc31c2
update css-tree@^1.1.2 (#5958) 2021-02-08 12:05:39 -05:00
Tan Li Hau
44f41c9edd
fix :host and :global css scoping (#5957) 2021-02-08 11:26:46 -05:00
Tan Li Hau
6589aa2548
warn module variables are nonreactive and make them truly nonreactive (#5847) 2021-01-29 15:05:04 -05:00
Saurav Sahu
87417e5a7b
fix: "foreign" namespace elements should still allow binding 'this' (#5942) 2021-01-29 13:31:23 -05:00
J Delaney
4f05cc3e3c
don't create class update functions when dependencies aren't reactive (#5926) 2021-01-29 11:47:22 -05:00