0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-25 09:09:35 +01:00
Commit Graph

8434 Commits

Author SHA1 Message Date
github-actions[bot]
272ffc5520
Version Packages (next) (#11440)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-03 12:58:26 +02:00
github-actions[bot]
c0e91a7490
Version Packages (next) (#11433)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-03 10:17:42 +02:00
Simon H
9c1a5063b9
fix: adjust order of derived function definition overloads (#11426)
Turns out the order is crucial for not getting a type error
fixes #11415
2024-05-03 10:16:39 +02:00
Simon H
9c5a9d8e20
fix: mark function properties on runes as deprecated for better intellisense (#11439)
Ensures that IDEs will order the to the bottom so that the rune variants are on top, better visible

closes #11437
2024-05-03 10:08:59 +02:00
Simon H
6e5ab2e678
fix: prevent ownership validation from infering with component context (#11438)
Ownership validation had a false positive when rendering a component as slotted content of another component. To fix this, #11401 did set the current component context to the context the snippet was declared in, not to the context it is rendered in. This was flawed because it means that component context was altered in a way that setContext/getContext failed because the parent chain was incorrect. This fixes that by introducing a separate global (dev time only) which tracks the component function the ownership needs.

fixes #11429
2024-05-03 09:58:17 +02:00
Simon H
dfb30aaddd
fix: only warn about non-reactive state in runes mode (#11434)
Fixes #11269
2024-05-03 07:40:43 +02:00
Dominic Gannaway
1f9ad03287
fix: ensure $inspect untracks inspected object (#11432) 2024-05-02 21:04:43 +01:00
github-actions[bot]
fcdad4c166
Version Packages (next) (#11410)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-02 17:45:42 +02:00
Dominic Gannaway
b4968584df
fix: improve html escaping of element attributes (#11411)
escape `<` because there's an edge case scenario where a script inside an attribute of a noscript is parsed differently
2024-05-02 17:40:22 +02:00
Simon H
a038d49f78
fix: rework bindable types strategy (#11420)
Instead of using types that declare whether or not a type is bindable directly as part of the property, we're introducing a new for-types-only field to `SvelteComponent`: `$$bindings`, which is typed as the keys of the properties that are bindable (string by default, i.e. everything's bindable; for backwards compat). language-tools can then produce code that assigns to this property which results in an error we can display if the binding is invalid
closes #11356
2024-05-02 17:37:02 +02:00
Hunter Johnston
17b2f6215d
fix: event.currentTarget always being equal to event.target (#11419)
fixes #11328
2024-05-02 11:14:07 +02:00
Rich Harris
edefc846c3
fix: set correct component context when rendering snippets (#11401)
fixes #11399
2024-05-02 11:12:10 +02:00
Paolo Ricciuti
f64d16931d
fix: detect style shorthands as stateful variables in legacy mode (#11421)
Fixes #11417
2024-05-02 09:08:07 +02:00
Dominic Gannaway
0f4f3d7df0
fix: improve unowned derived signal behaviour (#11408) 2024-05-01 10:07:04 -04:00
Rich Harris
4d051962f3
chore: tidy up (#11404) 2024-05-01 08:55:11 +01:00
github-actions[bot]
9e1e1b45e8
Version Packages (next) (#11396)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-30 16:21:49 -04:00
Luke Warlow
8be6fdde54
feat: MathML support (#11387)
* feat: MathML support

- Add support for MathML namespace
- Auto-infer MathML namespace

* tweak

* DRY out

* note to self

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-04-30 15:40:37 -04:00
github-actions[bot]
fe56c7fd2e
Version Packages (next) (#11393)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-30 10:41:23 -04:00
Rich Harris
7a66927ca8
fix: bump esrap (#11392) 2024-04-30 10:29:08 -04:00
github-actions[bot]
e7d1e4a8bc
Version Packages (next) (#11384)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-29 22:56:28 +01:00
Dominic Gannaway
e01776401d
fix: ensure no data loss occurs when using reactive Set methods (#11385) 2024-04-29 22:50:59 +01:00
Simon H
2754e4eb39
fix: handle reassignment of $$props and $$restProps (#11348)
* fix: handle reassignment of `$$props` and `$$restProps`

Some libraries assign to properties of `$$props` and `$$restProps`. These were previously resulting in an error but are now handled properly

https://github.com/sveltejs/svelte/issues/10359#issuecomment-2080067464

* $$props is coarse grained on updates, so we can simplify this

* fix

* fix comment
2024-04-29 16:50:30 -04:00
Simon H
5e0845fe3e
fix: disallow sequence expressions in @const tags (#11357)
* fix: disallow sequence expressions in `@const` tags

closes #11349

* allow parenthesized sequence expression
2024-04-29 16:48:40 -04:00
Simon H
0cf10a361e
docs: note jsdoc syntax for declaring props (#11370)
* docs: note jsdoc syntax for declaring props

closes #10541

* oops
2024-04-29 16:46:37 -04:00
github-actions[bot]
b3c2d979c6
Version Packages (next) (#11381)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-29 16:45:54 -04:00
Jeremiasz Major
0397fcb614
fix: require whitespace after @const tag (#11379) 2024-04-29 22:11:42 +02:00
Simon H
eb7e32c168
fix: collect all necessary setters of html elements (#11371)
When spreading attributes, the setters of the element are checked. If they contain the key in question, it's set via that setter. For certain setters on certain elements this didn't work because the element prototype was not HTMLElement, rather a descendant of that (for example HTMLDivElement), which meant that only the setters of the descendant, not the superclass were taken into account. This fixes that by walking up the prototype chain until we find the Element prototype.

fixes #11179
2024-04-29 22:07:42 +02:00
Simon H
cd2506535f
feat: leave view transition pseudo selectors untouched (#11375)
* feat: leave view transition pseudo selectors untouched

view transition pseude selectors are global-like, i.e. they shouldn't be scoped or treated as unused.
In the process of adding support for this, is_root and is_host were consolidated into is_global_like because their usage locations didn't need any differentiation between them (same for the new view transition treatment)

closes #9127

* regenerate types
2024-04-29 20:27:13 +01:00
Simon H
de315d84eb
fix: ensure reactions are kept dirty when marking them again (#11364)
previously a reaction could be marked as DIRTY and subsequently as MAYBE_DIRTY before running, resulting in false negatives. Ensure that DIRTY flag can never be lowered to MAYBE_DIRTY
fixes #11363
2024-04-29 20:26:56 +01:00
github-actions[bot]
7a3ee6d059
Version Packages (next) (#11335)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-29 14:57:15 -04:00
Simon H
4479b8c6f3
fix: allow bind:this on <select> with dynamic multiple attribute (#11378)
fixes #11377
2024-04-29 17:16:52 +01:00
Simon H
500b2065e0
fix: apply modifiers to bubbled events (#11369)
fixes #11365
2024-04-29 17:16:20 +01:00
Simon H
8b1a26904a
chore: add css regression test (#11373)
at rules are now left alone and you can have nested css in them which is scoped correctly. This just adds a test so we don't regress in the future

closes #9267
2024-04-29 13:14:52 +02:00
Paolo Ricciuti
2d2508a2cd
feat: allow for literal property definition with state on classes (#11326)
closes #11316

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2024-04-29 12:56:34 +02:00
Paolo Ricciuti
c7bdef595b
fix: store from props hoist wrong param (#11367)
Fixes #11355

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2024-04-29 09:31:17 +02:00
Caique Torres
68071f7c06
fix: disallow mixing event-handling syntaxes (#11295)
Closes #11262

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2024-04-28 22:43:07 +02:00
Rich Harris
bda32edb1a
docs: on:keydown -> onkeydown (#11343) 2024-04-27 14:27:55 +02:00
Simon H
7d19e5b1a4
fix: disallow mounting a snippet (#11347)
fixes #11264
2024-04-27 12:37:30 +02:00
Paolo Ricciuti
d3949a6e71
fix: hr, script and template as valid select children (#11344)
Closes #11342
---------

Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
2024-04-27 12:37:12 +02:00
Simon H
cd798077b4
feat: provide migration function (#11334)
Provides a migration function, exported as `migrate` from `svelte/compiler`, which tries its best to automatically migrate towards runes, render tags (instead of slots) and event attributes (instead of event handlers)

The preview REPL was updated with a migrate button so people can try it out in the playground.

closes #9239
2024-04-26 20:56:40 +02:00
Rich Harris
f1986da755
feat: only inject push/init/pop when necessary (#11319)
* feat: only inject push/init/pop when necessary - closes #11297

* regenerate

* differentiate between safe/unsafe

* only inject $$props when necessary

* more

* fix

* simplify

* handle store subscriptions
2024-04-25 13:35:09 -04:00
Rich Harris
8e43e9aae0
fix: correctly interpret empty aria- attribute (#11325)
* fix: correctly interpret empty aria- attribute

* changeset

* huh

* only suggest default value for boolean/tristate attributes

* adjust messages, disallow empty strings

* gah
2024-04-25 13:34:51 -04:00
Rich Harris
9a887f8dab
chore: directly export function in non-HMR mode (#11333)
* chore: directly export function in non-HMR mode

* remove some more noise

* update snapshots

* Update sites/svelte-5-preview/src/lib/workers/compiler/index.js

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

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2024-04-25 11:36:40 -04:00
Rich Harris
8e17428316
chore: tidy up messages (#11327)
* start reorganising messages

* tidy up

* more

* more

* more

* alphabetise

* consolidate

* more

* more

* more

* more

* more

* more

* alphabetise

* more

* this is no longer needed

* no longer necessary

* more

* more

* fix

* regenerate messages

* more

* more

* tighten up rune validation

* more

* fix

* more

* tweak a11y messages

* add server errors

* overhaul runtime errors

* regenerate messages

* unused

* lint

* more

* more

* Update packages/svelte/messages/compile-errors/script.md

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

* Update packages/svelte/messages/client-warnings/warnings.md

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

* fix

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
2024-04-25 08:54:05 -04:00
Rich Harris
6ad5cd4461
feat: implement message overloads (#11318) 2024-04-24 15:45:55 -04:00
github-actions[bot]
4be593472d
Version Packages (next) (#11315)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-24 21:19:09 +02:00
Rich Harris
6eb70f88bb
fix: remove bind_prop in runes mode (#11321) 2024-04-24 14:46:49 -04:00
Rich Harris
476f2172b6
fix: mark accessors and immutable as deprecated (#11277)
* fix: mark `accessors` and `immutable` as deprecated

* add warnings for deprecated <svelte:options> attributes

* disable accessors in runes mode

* update tests

* tidy up

* the hell?

* regenerate types

* if I would get a dollar for every windows bug I fix I would be a millionaire by now

* return instance _and_ props in runes mode, move flushSync into shared code, don't set accessors in runes mode

* goddammit

* note breaking change

* fix

* regenerate messages

* Revert "return instance _and_ props in runes mode, move flushSync into shared code, don't set accessors in runes mode"

This reverts commit a47827e57d.

* pass instance to tests

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2024-04-24 10:55:39 -04:00
Rich Harris
22b2c15280
put messages in blockquotes (#11311) 2024-04-24 09:57:49 -04:00
Rich Harris
f906aa207b
chore: fix playground (#11310) 2024-04-24 09:34:53 -04:00