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

9322 Commits

Author SHA1 Message Date
Rich Harris
56621a2b36
docs: add legacy callouts (#13428) 2024-09-28 21:54:22 -04:00
Rich Harris
d87bf178c5
chore: remove links from docs (#13425)
* chore: remove links from docs

* regenerate
2024-09-28 15:34:12 -04:00
github-actions[bot]
35ebbe61ad
Version Packages (next) (#13394)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-27 10:07:52 -04:00
Dominic Gannaway
2531658046
fix: ensure use directives execute in the correct sequence (#13384)
Fixes #13382. This PR ensures that action directives are now executed in the same sequence as Svelte 4, so child element before parent element.
2024-09-27 12:57:34 +02:00
Paolo Ricciuti
d4230049da
fix: avoid migrating slots in custom elements (#13406)
They'll be preserved as-is in some future Svelte version
2024-09-27 12:49:28 +02:00
Paolo Ricciuti
30c438c279
fix: don't consider children of rules when checking whether they are used or not (#13410)
Fixes #13390

There's pruning logic in a different place where all unused selectors are commented out. If all selectors are unused, the whole prelude is commented out, resulting in invalid syntax. This is a case that shouldn't happen, therefore simplify the whole "is used" logic to only look at the prelude.
2024-09-27 12:45:09 +02:00
Rich Harris
e3e8f22a6f
fix: treat <img> alt attribute as content for a11y labelling purposes (#13411)
fixes #13365
2024-09-27 11:48:17 +02:00
Rich Harris
276443fe5e
preload on hover (#13408) 2024-09-26 16:36:06 -04:00
Simon H
505e8caa23
fix: blank CSS contents while migrating (#13403)
Blank CSS, could contain SCSS or similar that needs a preprocessor. Since we don't care about CSS in this migration, we'll just ignore it.
2024-09-26 21:40:41 +02:00
adiGuba
9627426f7f
fix: ensure single script and scripts in loops execute properly (#13386)
- add a comment to lone script tags to ensure there's always a parent so we can synchronously call the replace function
- always call the replace function, not just on the first call

fixes #13378

---------

Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
2024-09-26 16:56:47 +02:00
Paolo Ricciuti
b73052f590
fix: make ownership widening more robust to userland proxies (#13377)
Fixes #13376
2024-09-26 15:12:30 +02:00
Dominic Gannaway
3ee8e0b14c
fix: validation should not fail on anonymous declarations (#13393)
* fix: validation should not fail on anonymous declarations

* feedback
2024-09-25 12:24:40 +01:00
Yoon Han
3d8f987569
chore: add newline to multiline comment for proper syntax highlighting (#13375)
Co-authored-by: yoonhan <yoon.han@lawfully.com>
2024-09-24 13:58:04 -04:00
github-actions[bot]
eaa55766c9
Version Packages (next) (#13383)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-24 13:54:25 -04:00
Dominic Gannaway
d309023cb2
fix: improve reconciliation of inert each block rows (#13379)
* fix: improve reconcilation of inert each block rows

* fix: improve reconcilation of inert each block rows

* add test
2024-09-24 12:17:29 -04:00
Dominic Gannaway
0b3fd4e42d
fix: properly remove root anchor node on unmount (#13381) 2024-09-24 12:16:07 -04:00
Paolo Ricciuti
0f6cc2b1ed
fix: migrate events to be more inline with svelte 4 (#13362)
* fix: migrate events to be more inline with svelte 4

* fix: use function instead of action

* chore: generate types

* re-export event modifier substitutes

* chore: replace map with object

* fix: handle nullish values

* fix: use bubbler for delegated events

* chore: generate types

* chore: deprecate legacy stuff

* chore: damn type generations

* fix: implement bubble on props strategy

* chore: revert bubble as prop init but keep fix for restProps

* fix: use `passive` and `nonpassive` actions for `passive` and `nonpassive` modifiers

* chore: i swear i will setup a commit hook for generating types

* chore: update output

* tweak passive/nonpassive types to make them more compact and show up as deprecated

* make terminology more consistent with other places

* eat local, shop local, declare local

* unify name replacement stuff

* remove errant newline

* ensure modifier order is stable and matches svelte 4

* fix

* compute indent once

* joining without newlines seems to work better in common cases

* replace passive/nonpassive handlers in situ

* unused

* simplify

* simplify, remove errant spaces

* only import handlers when necessary

* changeset

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-09-24 12:15:15 -04:00
github-actions[bot]
4b7cb9aeae
Version Packages (next) (#13348)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-23 14:34:04 -04:00
Ben McCann
ccec59f89b
chore: upgrade rollup plugins (#13369) 2024-09-23 14:33:40 -04:00
Rich Harris
2c98768b84
fix: only use getComputedStyle with elements (#13366) 2024-09-23 10:04:05 -04:00
sacrosanctic
c5028a27c5
docs: Update 7guis-timer example to support SSR context (#13356)
* Update 7guis-timer

* remove window reference on variable init

* better still

* prettier

---------

Co-authored-by: Rich Harris <hello@rich-harris.dev>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-09-23 08:32:11 -04:00
Paolo Ricciuti
c5fa0b46e1
fix: missing space when importing run as in migration (#13361)
* fix: missing space when importing run as in migration

* chore: add test
2024-09-21 19:11:37 +02:00
Rich Harris
bc2d30c558
chore: refactor set_attributes code generation (#13353)
* chore: refactor `set_attributes` code generation

* simplify

* simplify
2024-09-20 13:59:20 -04:00
Rich Harris
13cb3855da
chore: refactor RegularElement visitor (#13350)
* WIP

* tidy

* simplify

* simplify

* more

* more

* use a switch

* alphabetize

* simplify

* group stuff

* rename

* simplify

* shuffle

* shuffle

* doh
2024-09-20 12:09:18 -04:00
Rich Harris
9e511b141c
fix: make each items reassignable (#12257)
* chore: make each items reassignable

* add failing test

* update test

* transform reassigned getters inside each block

* Update .changeset/thirty-guests-flow.md

* comment

* add note

* tidy up

* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js
2024-09-20 08:46:47 -04:00
Rich Harris
f81f4feab8
chore: simplify attributes (#13337)
* chore: simplify attributes

* fix/optimise

* unused
2024-09-20 07:24:08 -04:00
Conduitry
1a5cf6fef4
perf: improve get_setters cache (#13343) 2024-09-19 21:02:26 -04:00
github-actions[bot]
de157ee1dc
Version Packages (next) (#13342)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 20:23:06 -04:00
Rich Harris
3aa2ec0813
fix: only set attribute as property if element has setter (#13341) 2024-09-19 20:17:37 -04:00
github-actions[bot]
78b134dec1
Version Packages (next) (#13336)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 17:26:45 -04:00
Rich Harris
b3f3915180
fix: set strings as attributes, non-strings as properties if property exists (#13327)
* fix: set strings as attributes, non-strings as properties if property exists

* simplify

* remove draggable from list, no longer needed

* in fact we dont need the lookup at all

* lint

* beef up test

* correctly SSR translate attribute
2024-09-19 17:06:37 -04:00
Rich Harris
2553932c2c
fix: only warn on context="module" in runes mode (#13332)
* fix: only warn on context="module" in runes mode

* wow
2024-09-19 21:31:31 +02:00
Rich Harris
d6ab12ae76
feat: deprecate <svelte:self> in runes mode (#13333)
* feat: deprecate `<svelte:self>` in runes mode

* fix
2024-09-19 21:27:28 +02:00
github-actions[bot]
313bcea6cc
Version Packages (next) (#13330)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 15:18:53 -04:00
Simon H
c636fc67bc
fix: silence snapshot warnings inside $inspect (#13334)
It's not really actionable and also confusing because the user doesn't see `$state.snapshot` anywhere in their code
2024-09-19 20:56:27 +02:00
Simon H
e4926d7507
docs: note html structure breaking change (#12991) 2024-09-19 13:38:40 -04:00
Dominic Gannaway
db6545d173
fix: keep bound inputs in sync in runes mode (#13328)
* fix: keep bound inputs in sync in runes mode

* small tweak, add more detailed explanatory comment

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
2024-09-19 12:06:16 -04:00
github-actions[bot]
00cc3640b1
Version Packages (next) (#13329)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 10:55:20 -04:00
Rich Harris
321e3eafa7
feat: better flip animations (#13317)
* fix: flip not accounting for scaled lengths

* zoom is uniform, one calculation will do

* stash width/height multipliers

* use var

* scale-first appears to work better?

* more robust zoom calculation

* changeset

---------

Co-authored-by: Etai Nadler <75544136+etainad008@users.noreply.github.com>
2024-09-19 10:00:29 -04:00
github-actions[bot]
d65304007d
Version Packages (next) (#13319)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-19 08:58:08 -04:00
Simon H
5dbe763792
fix: don't make wheel events passive by default (#13322)
This was done previously to align with browser behavior, but the browser behavior actually only makes them passive on window/document/body. Since wheel events are not delegated, we can revert their passive-by-default setting. Closes #13318

For touchstart/touchmove we're not changing it because these events are delegated, which means they happen a lot more often on a target higher up the tree, which may cause jank.
2024-09-19 08:45:28 -04:00
Rich Harris
0ef14b5128
chore: more process_effect tweaks (#13315)
* consolidate more stuff

* simpler

* simplify

* comment is unnecessary, this is the first time we read current_effect.first
2024-09-19 09:36:15 +01:00
Rich Harris
5d56c592ff
fix: delete transformers shadowed by unreassigned state (#13316)
fixes #13314
2024-09-19 08:35:48 +02:00
github-actions[bot]
b3842d7982
Version Packages (next) (#13311)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-18 17:46:32 -04:00
Rich Harris
19179822c3
create effect root for custom element (#13312) 2024-09-18 15:39:34 -04:00
Rich Harris
1d1e4aeeb1
fix: attach effects-inside-deriveds to the parent of the derived (#13309)
* WIP

* fix types

* ensure effects with deriveds are added to the tree

* test

* changeset

* oops
2024-09-18 15:13:55 -04:00
Dominic Gannaway
c4d8d405c9
fix: ensure component effects have the correct reaction owner (#13308)
* fix: ensure component effects have the correct reaction owner

* fix: ensure component effects have the correct reaction owner

* lint
2024-09-18 14:12:09 -04:00
Simon H
b23516121b
fix: handle $$Props interface during migration (#13305)
fixes #13178
2024-09-18 14:12:01 -04:00
Simon H
d338e8083f
fix: simplify and robustify appending styles (#13303)
#13225 did not fully fix the described issue: As soon as you have a child component, that child component's anchor will not be in the right ownerDocument yet, and so the logic falls down.

To fix that, we would need to move the ownerDocument check into the microtask - and that map check was mainly done to avoid just that. So instead I opted to simplify the code and just remove the map checks. According to my benchmarking (https://jsbench.me/3hm17l0bxl/1) this has no impact on performance assuming that you'll have cache hits roughly half the time - and even if you'd have much more cache hits, the performance loss is microscopic. Given that the default mode is to not inject styles, this will not be common anyway, so I favor removing that map.
2024-09-18 14:11:52 -04:00
github-actions[bot]
f852a6890b
Version Packages (next) (#13304)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-09-18 13:31:36 +01:00