Fix a bug where play/pause events may never be added to the media element. Also simplifies the logic by making it an effect instead of a render effect
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
* feat: migrate `svelte:self`
* chore: regenerate types
* fix: special case `<svelte:self></svelte:self>`
* chore: add special case to tests
* chore: add no filename test
* chore: better migration task message
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* chore: make filename an options object to futureproof it
* chore: simplify open tag `svelte:self`
* chore: simplify migration comment test
* chore: generate types
* chore: apply smart suggestion
* chore: changeset
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* feat: enable snippets to fill slots
This allows people to use snippets to fill slots. It is implemented in the same way the default slot interop is already implemented, by passing a boolean to the hidden `$$slots` object, and using that at runtime to determine the correct outcome. The impact on bundle size is neglible.
By enabling this, we can enhance our migration script to always transform slot usages (including `let:x` etc) to snippets. This wasn't possible before because we couldn't be sure if the other side was transformed to using render tags at the same time. This will be part of #13419. This is important because currently the migration script is transforming `<slot />` creations inside components, but since it's not touching its usage points the migration will make your app end up in a broken state which you have to finish by hand.
This is a reduced alternative to, and closes#11619, which was also enabling the other way around, but that is a) not as necessary and b) more likely to confuse people / break, because it only works if your render function has 0-1 arguments.
* unused
* ditto - annotation is redundant
* couple of drive-by consistency tweaks
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix: allow combinator at start of nested CSS selector
Solved by moving the combinator positioning validation into the analysis phase
Fixes#13433
* highlight the combinator, not the start of the combinator
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* feat: fix accessors and support migration of accessors
* fix: exclude slots
* fix: remove call to proxy for accessors props
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* chore: add test for accessors
* chore: fix lint
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* feat: allow migration of `svelte:component`
* chore: simplify a lot (thanks @dummdidumm)
* chore: update output
* chore: use `next()` and `snip` instead of walking the AST
* fix: migrate nested `svelte:component`
* Update .changeset/good-vans-bake.md
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
the code to compose together the instance was getting a bit messy because we were trying to add stuff all in the same place if there was no script or one by one if there was one. I changed this a bit by using an insertion_point variable that we can set to then insert stuff sequentially.
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.
- 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>
* 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>