Merge branch 'main' into main

pull/10006/head
Rich Harris 3 years ago committed by GitHub
commit 4ed11127f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: improve nested effect heuristics

@ -0,0 +1,5 @@
---
"svelte": patch
---
chore: improve should_proxy_or_freeze logic internally

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: transform textarea and contenteditable binding expressions

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: skip certain slot validations for custom elements

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: improve transition outro easing

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve ssr template code generation

@ -0,0 +1,5 @@
---
'svelte': patch
---
A transition's parameters are now evaluated when the transition is initialized.

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: make `@types/estree` a dependency

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow transition undefined payload

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: deeply unstate objects passed to inspect

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: handle delegated events of elements moved outside the container

@ -0,0 +1,5 @@
---
'svelte': patch
---
feat: add `$state.frozen` rune

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve text node output

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve style parser whitespace handling

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: infer `svg` namespace correctly

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve template literal expression output generation

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve outro behavior with transitions

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: add compiler error for invalid <p> contents

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: correctly apply event.currentTarget

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: add back `derived` type overload

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: keep intermediate number value representations

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: ensure unstate() only deeply applies to plain objects and arrays

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: more robust url equality check at dev time

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: improve invalid nested interactive element error

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow input elements within button elements

@ -0,0 +1,5 @@
---
"svelte": patch
---
chore: cleanup derived destruction

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve script `lang` attribute detection

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: correct increment/decrement code generation

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: sanitize component event names

@ -0,0 +1,5 @@
---
'svelte': patch
---
feat: allow modifiying derived props

@ -0,0 +1,5 @@
---
'svelte': patch
---
Fix issue with assigning prop values as defaults of other props

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: apply key animations on proxied arrays

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve intro transitions on dynamic mount

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: handle deep assignments to `$state()` class properties correctly

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: support TypeScript's `satisfies` operator

@ -0,0 +1,5 @@
---
'svelte': patch
---
Fix interopability between backticks and templates

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve signal consumer tracking behavior

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: remove internal functions from `svelte/transition` exports

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: don't hoist function when already referenced in module scope

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve pseudo class parsing

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: support async/await in destructuring assignments

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve code generation

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: provide `unstate` in server environment

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve key block reactivity detection

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve internal signal dependency checking logic

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: react to mutated slot props in legacy mode

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: add types for popover attributes and events

@ -10,41 +10,66 @@
},
"changesets": [
"afraid-moose-matter",
"angry-books-jam",
"angry-plums-punch",
"beige-flies-wash",
"beige-rabbits-shave",
"big-cars-serve",
"blue-timers-film",
"brave-shrimps-kiss",
"brave-walls-destroy",
"breezy-carrots-flash",
"bright-peas-juggle",
"bright-snakes-sing",
"brown-spoons-boil",
"chatty-cups-drop",
"chatty-taxis-juggle",
"chilled-pumas-invite",
"chilly-dolphins-lick",
"clean-eels-beg",
"clever-chefs-relate",
"clever-rockets-burn",
"cold-birds-own",
"cool-ants-leave",
"cuddly-pianos-drop",
"curly-lizards-dream",
"curvy-ties-shout",
"dirty-bats-punch",
"dirty-garlics-design",
"dirty-tips-add",
"dry-clocks-grow",
"dry-eggs-play",
"dry-eggs-retire",
"dull-mangos-wave",
"dull-roses-relate",
"early-ads-tie",
"eight-steaks-shout",
"eighty-bikes-camp",
"eighty-days-cheat",
"empty-bulldogs-exercise",
"empty-crabs-think",
"empty-tools-share",
"fair-crabs-check",
"fair-pianos-talk",
"famous-falcons-melt",
"famous-knives-sneeze",
"fast-weeks-clean",
"few-mugs-fail",
"fifty-rice-wait",
"fifty-steaks-float",
"five-tigers-search",
"flat-melons-protect",
"forty-comics-invent",
"forty-peaches-unite",
"four-flies-hammer",
"fresh-weeks-trade",
"friendly-lies-camp",
"funny-wombats-argue",
"gentle-sheep-hug",
"gentle-spies-happen",
"giant-moons-own",
"giant-roses-press",
"good-cars-visit",
"good-pianos-jump",
"great-icons-retire",
"green-eggs-approve",
@ -52,15 +77,23 @@
"happy-suits-film",
"healthy-planes-vanish",
"heavy-ears-rule",
"hip-balloons-begin",
"honest-buses-add",
"honest-icons-change",
"hungry-boxes-relate",
"hungry-dots-fry",
"hungry-tips-unite",
"hungry-trees-travel",
"itchy-beans-melt",
"itchy-kings-deliver",
"itchy-lions-wash",
"itchy-terms-guess",
"khaki-mails-draw",
"khaki-moose-arrive",
"kind-baboons-approve",
"kind-deers-lay",
"kind-eagles-join",
"kind-rings-flash",
"large-clouds-carry",
"large-turkeys-deny",
"late-crabs-lay",
@ -68,85 +101,132 @@
"lazy-months-knock",
"lazy-spiders-think",
"lemon-geese-drum",
"light-humans-hang",
"light-pens-watch",
"long-buckets-lay",
"long-crews-return",
"loud-cheetahs-flow",
"lovely-carpets-lick",
"lovely-items-turn",
"lovely-rules-eat",
"lucky-schools-hang",
"lucky-toes-begin",
"many-trees-fix",
"moody-frogs-exist",
"moody-owls-cry",
"nasty-lions-double",
"nasty-yaks-peel",
"neat-dingos-clap",
"new-boats-wait",
"ninety-dingos-walk",
"odd-buckets-lie",
"odd-needles-joke",
"odd-schools-wait",
"odd-shoes-cheat",
"old-flies-jog",
"old-houses-drum",
"old-mails-sneeze",
"old-oranges-compete",
"olive-kangaroos-brake",
"olive-shirts-complain",
"orange-dingos-poke",
"polite-dolphins-care",
"polite-pumpkins-guess",
"polite-ravens-study",
"poor-eggs-enjoy",
"poor-seahorses-flash",
"popular-mangos-rest",
"pretty-ties-help",
"purple-dragons-peel",
"quiet-camels-mate",
"quiet-crabs-nail",
"rare-pears-whisper",
"real-guests-do",
"red-doors-own",
"rich-cobras-exist",
"rich-sheep-burn",
"rich-tables-sing",
"rich-waves-mix",
"rotten-bags-type",
"rotten-buckets-develop",
"selfish-dragons-knock",
"selfish-tools-hide",
"serious-kids-deliver",
"serious-socks-cover",
"serious-zebras-scream",
"seven-deers-jam",
"seven-jobs-sniff",
"seven-ravens-check",
"sharp-gorillas-impress",
"sharp-kids-happen",
"sharp-tomatoes-learn",
"shiny-baboons-play",
"shiny-shrimps-march",
"short-buses-camp",
"slimy-clouds-talk",
"slimy-walls-draw",
"slow-beds-shave",
"slow-chefs-dream",
"slow-wombats-reply",
"small-papayas-laugh",
"smart-parents-swim",
"smart-zebras-pay",
"soft-clocks-remember",
"soft-geese-learn",
"soft-months-grab",
"soft-tigers-wink",
"sour-forks-stare",
"sour-rules-march",
"sour-weeks-fix",
"spicy-plums-admire",
"spotty-pens-agree",
"spotty-spiders-compare",
"stale-books-perform",
"stale-comics-look",
"strong-gifts-smoke",
"strong-lemons-provide",
"sweet-mangos-beg",
"sweet-pens-sniff",
"swift-donkeys-perform",
"swift-fans-stare",
"swift-ravens-hunt",
"swift-seahorses-deliver",
"tall-books-grin",
"tall-garlics-try",
"tall-mugs-buy",
"tall-shrimps-worry",
"tall-tigers-wait",
"tame-spies-drum",
"tasty-numbers-perform",
"ten-foxes-repeat",
"ten-peaches-sleep",
"ten-ties-repair",
"ten-worms-reflect",
"thick-cycles-rule",
"thin-foxes-lick",
"thirty-flowers-sit",
"thirty-ghosts-fix",
"thirty-impalas-repair",
"thirty-pears-hug",
"thirty-wombats-relax",
"three-camels-sell",
"three-suits-grin",
"tidy-buses-whisper",
"tiny-kings-whisper",
"twelve-dragons-join",
"twelve-onions-juggle",
"two-dragons-yell",
"two-falcons-buy",
"unlucky-boxes-obey",
"unlucky-trees-lick",
"wet-games-fly",
"wicked-clouds-exercise",
"wicked-doors-train",
"wicked-hairs-cheer",
"wild-foxes-wonder",
"wise-dancers-hang",
"wise-donkeys-marry",
"witty-camels-warn"
"witty-camels-warn",
"witty-steaks-dream"
]
}

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: skip generating $.proxy() calls for unary and binary expressions

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: take into account member expressions when determining legacy reactive dependencies

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: make `ComponentType` generic optional

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: simplify event delegation logic, only delegate event attributes

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: try-catch deep read during `$inspect`

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: allow ts casts in bindings

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: allow `:global(..)` in compound selectors

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: correctly parse at-rules containing special characters in strings

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: adjust `$inspect.with` type

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: always treat spread attributes as reactive and separate them if needed

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: silence false positive state warning

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: correctly call exported state

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: further animation transition improvements

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve how transitions are handled on mount

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: support hydrating around `<noscript>`

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: hydrate controlled each blocks correctly

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve animation transition heuristics

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: adjust `parse` return type

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure nested blocks are inert during outro transitions

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: prevent transition action overfiring

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: take into account setters when spreading and binding

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow pseudo classes after `:global(..)`

@ -0,0 +1,5 @@
---
"svelte": patch
---
chore: improve $state static reference warning heuristics

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: bail-out event handler referencing each index

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: prevent false positive store error in module script

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve event handling compatibility with delegation

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: ensure topological order for render effects

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: ensure derived signals properly capture consumers

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: allow type selector in `:global()` when it's at a start of a compound selector

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: correctly cleanup unowned derived dependency memory

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: parse `:nth-of-type(xn+y)` correctly

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: transform `{@render ...}` expression

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure if block is executed in correct order

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improve ssr template literal generation

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: Add missing `miter-clip` and `arcs` values to `stroke-linejoin` attribute

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: ensure proxy is updated before notifying listeners

@ -22,13 +22,6 @@ body:
placeholder: I would like to see...
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: "Please provide a clear and concise description of any alternative solutions or features you've considered."
validations:
required: true
- type: dropdown
id: importance
attributes:

@ -50,4 +50,11 @@ jobs:
with:
node-version: 18
cache: pnpm
- run: 'pnpm i && pnpm check && pnpm lint'
- name: install
run: pnpm install --frozen-lockfile
- name: type check
run: pnpm check
- name: lint
run: pnpm lint
- name: build and check generated types
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally and commit the changes after you have reviewed them"; git diff; exit 1); }

@ -28,7 +28,11 @@ jobs:
node-version: 18.x
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally and commit the changes after you have reviewed them"; git diff; exit 1); }
- name: Create Release Pull Request or Publish to npm
id: changesets

@ -133,6 +133,10 @@ To typecheck the codebase, run `pnpm check` inside `packages/svelte`. To typeche
- `snake_case` for internal variable names and methods.
- `camelCase` for public variable names and methods.
### Generating types
Types are auto-generated from the source, but the result is checked in to ensure no accidental changes slip through. Run `pnpm generate:types` to regenerate the types.
### Sending your pull request
Please make sure the following is done when submitting a pull request:
@ -141,7 +145,7 @@ Please make sure the following is done when submitting a pull request:
1. Make sure your code lints (`pnpm lint`).
1. Make sure your tests pass (`pnpm test`).
All pull requests should be opened against the `main` branch. Make sure the PR does only one thing, otherwise please split it.
All pull requests should be opened against the `main` branch. Make sure the PR does only one thing, otherwise please split it. If this change should contribute to a version bump, run `npx changeset` at the root of the repository after a code change and select the appropriate packages.
#### Breaking changes

@ -0,0 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0x99D414693dD65E4a0664a16D155dB66283A162D1"
}
}
}

@ -1,4 +1,4 @@
Copyright (c) 2016-23 [these people](https://github.com/sveltejs/svelte/graphs/contributors)
Copyright (c) 2016-24 [these people](https://github.com/sveltejs/svelte/graphs/contributors)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@ -16,7 +16,7 @@
? people.filter((person) => {
const name = `${person.last}, ${person.first}`;
return name.toLowerCase().startsWith(prefix.toLowerCase());
})
})
: people;
$: selected = filteredPeople[i];

@ -13,7 +13,7 @@
<!-- the text will flash red whenever
the `todo` object changes -->
<button bind:this={btn}>
<button bind:this={btn} on:click>
{todo.done ? '👍' : ''}
{todo.text}
</button>

@ -18,29 +18,34 @@
"build:sites": "pnpm -r --filter=./sites/* build",
"preview-site": "npm run build --prefix sites/svelte-5-preview",
"check": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r check",
"format": "prettier --write --plugin prettier-plugin-svelte .",
"lint": "prettier --check --plugin prettier-plugin-svelte . && eslint ./",
"format": "prettier --write .",
"lint": "prettier --check . && eslint ./",
"test": "vitest run --coverage",
"test-output": "vitest run --reporter=json --outputFile=sites/svelte-5-preview/src/routes/status/results.json",
"changeset:version": "changeset version && pnpm -r generate:version && git add --all",
"changeset:publish": "changeset publish"
},
"devDependencies": {
"@changesets/cli": "^2.26.1",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@changesets/cli": "^2.27.1",
"@sveltejs/eslint-config": "^6.0.4",
"@types/node": "^18.18.8",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@vitest/coverage-v8": "^0.34.6",
"concurrently": "^8.2.0",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^20.11.5",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@vitest/coverage-v8": "^1.2.1",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"eslint": "^8.49.0",
"eslint-plugin-lube": "^0.1.7",
"eslint": "^8.56.0",
"eslint-plugin-lube": "^0.4.3",
"jsdom": "22.0.0",
"playwright": "^1.35.1",
"prettier": "^3.0.1",
"prettier-plugin-svelte": "^3.0.3",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"typescript": "^5.3.3",
"vitest": "^1.2.1"
},
"pnpm": {
"overrides": {
"jimp>xml2js": "^0.6.0"
}
}
}

@ -1,4 +1,5 @@
/types
/types/*.map
/types/compiler
/compiler.cjs
/action.d.ts

@ -1,5 +1,217 @@
# svelte
## 5.0.0-next.39
### Patch Changes
- fix: handle deep assignments to `$state()` class properties correctly ([#10289](https://github.com/sveltejs/svelte/pull/10289))
- fix: prevent false positive store error in module script ([#10291](https://github.com/sveltejs/svelte/pull/10291))
- fix: allow type selector in `:global()` when it's at a start of a compound selector ([#10287](https://github.com/sveltejs/svelte/pull/10287))
## 5.0.0-next.38
### Patch Changes
- chore: improve should_proxy_or_freeze logic internally ([#10249](https://github.com/sveltejs/svelte/pull/10249))
- fix: add back `derived` type overload ([`776ac3c1762da5f8147c457a997a417cfae67e4c`](https://github.com/sveltejs/svelte/commit/776ac3c1762da5f8147c457a997a417cfae67e4c))
- fix: more robust url equality check at dev time ([`14d7b26897cbfa129847c446b0ecf9557d77ef7c`](https://github.com/sveltejs/svelte/commit/14d7b26897cbfa129847c446b0ecf9557d77ef7c))
- fix: correct increment/decrement code generation ([`2861ad66e054d2b14f382aaada4512e3e5d56db8`](https://github.com/sveltejs/svelte/commit/2861ad66e054d2b14f382aaada4512e3e5d56db8))
- fix: sanitize component event names ([#10235](https://github.com/sveltejs/svelte/pull/10235))
- fix: don't hoist function when already referenced in module scope ([`1538264bd5ed431d3048d54efe9c83c4db7fb42a`](https://github.com/sveltejs/svelte/commit/1538264bd5ed431d3048d54efe9c83c4db7fb42a))
- fix: try-catch deep read during `$inspect` ([#10270](https://github.com/sveltejs/svelte/pull/10270))
- fix: allow ts casts in bindings ([#10181](https://github.com/sveltejs/svelte/pull/10181))
- fix: allow `:global(..)` in compound selectors ([#10266](https://github.com/sveltejs/svelte/pull/10266))
- fix: hydrate controlled each blocks correctly ([#10259](https://github.com/sveltejs/svelte/pull/10259))
- chore: improve $state static reference warning heuristics ([#10275](https://github.com/sveltejs/svelte/pull/10275))
- fix: correctly cleanup unowned derived dependency memory ([#10280](https://github.com/sveltejs/svelte/pull/10280))
- fix: ensure proxy is updated before notifying listeners ([#10267](https://github.com/sveltejs/svelte/pull/10267))
## 5.0.0-next.37
### Patch Changes
- fix: skip certain slot validations for custom elements ([#10207](https://github.com/sveltejs/svelte/pull/10207))
- fix: add compiler error for invalid `<p>` contents ([#10201](https://github.com/sveltejs/svelte/pull/10201))
- fix: correctly apply event.currentTarget ([#10216](https://github.com/sveltejs/svelte/pull/10216))
- fix: ensure derived signals properly capture consumers ([#10213](https://github.com/sveltejs/svelte/pull/10213))
## 5.0.0-next.36
### Patch Changes
- fix: transform textarea and contenteditable binding expressions ([#10187](https://github.com/sveltejs/svelte/pull/10187))
- fix: improve transition outro easing ([#10190](https://github.com/sveltejs/svelte/pull/10190))
- fix: ensure unstate() only deeply applies to plain objects and arrays ([#10191](https://github.com/sveltejs/svelte/pull/10191))
- fix: improve invalid nested interactive element error ([#10199](https://github.com/sveltejs/svelte/pull/10199))
- fix: react to mutated slot props in legacy mode ([#10197](https://github.com/sveltejs/svelte/pull/10197))
## 5.0.0-next.35
### Patch Changes
- fix: improve nested effect heuristics ([#10171](https://github.com/sveltejs/svelte/pull/10171))
- fix: simplify event delegation logic, only delegate event attributes ([#10169](https://github.com/sveltejs/svelte/pull/10169))
- fix: prevent transition action overfiring ([#10163](https://github.com/sveltejs/svelte/pull/10163))
- fix: improve event handling compatibility with delegation ([#10168](https://github.com/sveltejs/svelte/pull/10168))
- fix: ensure topological order for render effects ([#10175](https://github.com/sveltejs/svelte/pull/10175))
## 5.0.0-next.34
### Patch Changes
- fix: make `@types/estree` a dependency ([#10150](https://github.com/sveltejs/svelte/pull/10150))
- fix: improve intro transitions on dynamic mount ([#10162](https://github.com/sveltejs/svelte/pull/10162))
- fix: improve code generation ([#10156](https://github.com/sveltejs/svelte/pull/10156))
- fix: adjust `$inspect.with` type ([`c7cb90c91`](https://github.com/sveltejs/svelte/commit/c7cb90c91cd3553ad59126267c9bfddecbb290b4))
- fix: improve how transitions are handled on mount ([#10157](https://github.com/sveltejs/svelte/pull/10157))
- fix: adjust `parse` return type ([`a271878ab`](https://github.com/sveltejs/svelte/commit/a271878abe7018923839401129b18082eb2c811a))
## 5.0.0-next.33
### Patch Changes
- fix: improve ssr template code generation ([#10151](https://github.com/sveltejs/svelte/pull/10151))
- fix: improve template literal expression output generation ([#10147](https://github.com/sveltejs/svelte/pull/10147))
## 5.0.0-next.32
### Patch Changes
- fix: improve outro behavior with transitions ([#10139](https://github.com/sveltejs/svelte/pull/10139))
- chore: remove internal functions from `svelte/transition` exports ([#10132](https://github.com/sveltejs/svelte/pull/10132))
- fix: further animation transition improvements ([#10138](https://github.com/sveltejs/svelte/pull/10138))
- fix: improve animation transition heuristics ([#10119](https://github.com/sveltejs/svelte/pull/10119))
## 5.0.0-next.31
### Patch Changes
- fix: infer `svg` namespace correctly ([#10027](https://github.com/sveltejs/svelte/pull/10027))
- fix: keep intermediate number value representations ([`d171a39b0`](https://github.com/sveltejs/svelte/commit/d171a39b0ad97e2a05de1f38bc76a3d345e2b3d5))
- feat: allow modifiying derived props ([#10080](https://github.com/sveltejs/svelte/pull/10080))
- fix: improve signal consumer tracking behavior ([#10121](https://github.com/sveltejs/svelte/pull/10121))
- fix: support async/await in destructuring assignments ([#9962](https://github.com/sveltejs/svelte/pull/9962))
- fix: take into account member expressions when determining legacy reactive dependencies ([#10128](https://github.com/sveltejs/svelte/pull/10128))
- fix: make `ComponentType` generic optional ([`14dbc1be1`](https://github.com/sveltejs/svelte/commit/14dbc1be1720ff69e6f3c407e43c9c0765b0c140))
- fix: silence false positive state warning ([`dda4ad510`](https://github.com/sveltejs/svelte/commit/dda4ad510f1907a114a16227c3412eb00bd21738))
- fix: ensure nested blocks are inert during outro transitions ([#10126](https://github.com/sveltejs/svelte/pull/10126))
- fix: improve ssr template literal generation ([#10127](https://github.com/sveltejs/svelte/pull/10127))
## 5.0.0-next.30
### Patch Changes
- fix: allow transition undefined payload ([#10117](https://github.com/sveltejs/svelte/pull/10117))
- fix: apply key animations on proxied arrays ([#10113](https://github.com/sveltejs/svelte/pull/10113))
- fix: improve internal signal dependency checking logic ([#10111](https://github.com/sveltejs/svelte/pull/10111))
- fix: correctly call exported state ([#10114](https://github.com/sveltejs/svelte/pull/10114))
- fix: take into account setters when spreading and binding ([#10091](https://github.com/sveltejs/svelte/pull/10091))
- fix: transform `{@render ...}` expression ([#10116](https://github.com/sveltejs/svelte/pull/10116))
## 5.0.0-next.29
### Patch Changes
- fix: improve text node output ([#10081](https://github.com/sveltejs/svelte/pull/10081))
- fix: improve style parser whitespace handling ([#10077](https://github.com/sveltejs/svelte/pull/10077))
- fix: allow input elements within button elements ([#10083](https://github.com/sveltejs/svelte/pull/10083))
- fix: support TypeScript's `satisfies` operator ([#10068](https://github.com/sveltejs/svelte/pull/10068))
- fix: provide `unstate` in server environment ([`877ff1ee7`](https://github.com/sveltejs/svelte/commit/877ff1ee7d637e2248145d975748e1012a977396))
- fix: improve key block reactivity detection ([#10092](https://github.com/sveltejs/svelte/pull/10092))
- fix: always treat spread attributes as reactive and separate them if needed ([#10071](https://github.com/sveltejs/svelte/pull/10071))
## 5.0.0-next.28
### Patch Changes
- fix: deeply unstate objects passed to inspect ([#10056](https://github.com/sveltejs/svelte/pull/10056))
- fix: handle delegated events of elements moved outside the container ([#10060](https://github.com/sveltejs/svelte/pull/10060))
- fix: improve script `lang` attribute detection ([#10046](https://github.com/sveltejs/svelte/pull/10046))
- fix: improve pseudo class parsing ([#10055](https://github.com/sveltejs/svelte/pull/10055))
- fix: add types for popover attributes and events ([#10041](https://github.com/sveltejs/svelte/pull/10041))
- fix: skip generating $.proxy() calls for unary and binary expressions ([#9979](https://github.com/sveltejs/svelte/pull/9979))
- fix: allow pseudo classes after `:global(..)` ([#10055](https://github.com/sveltejs/svelte/pull/10055))
- fix: bail-out event handler referencing each index ([#10063](https://github.com/sveltejs/svelte/pull/10063))
- fix: parse `:nth-of-type(xn+y)` correctly ([#9970](https://github.com/sveltejs/svelte/pull/9970))
- fix: ensure if block is executed in correct order ([#10053](https://github.com/sveltejs/svelte/pull/10053))
## 5.0.0-next.27
### Patch Changes
- fix: evaluate transition parameters when the transition runs ([#9836](https://github.com/sveltejs/svelte/pull/9836))
- feat: add `$state.frozen` rune ([#9851](https://github.com/sveltejs/svelte/pull/9851))
- fix: correctly transform prop fallback values that use other props ([#9985](https://github.com/sveltejs/svelte/pull/9985))
- fix: escape template literal characters in text sequences ([#9973](https://github.com/sveltejs/svelte/pull/9973))
- fix: inject comment in place of `<noscript>` in client output ([#9953](https://github.com/sveltejs/svelte/pull/9953))
## 5.0.0-next.26
### Patch Changes
@ -132,7 +344,7 @@
### Patch Changes
- feat: proxied staet ([#9739](https://github.com/sveltejs/svelte/pull/9739))
- feat: proxied state ([#9739](https://github.com/sveltejs/svelte/pull/9739))
- chore: more validation errors ([#9723](https://github.com/sveltejs/svelte/pull/9723))

@ -59,6 +59,7 @@ export type WheelEventHandler<T extends EventTarget> = EventHandler<WheelEvent,
export type AnimationEventHandler<T extends EventTarget> = EventHandler<AnimationEvent, T>;
export type TransitionEventHandler<T extends EventTarget> = EventHandler<TransitionEvent, T>;
export type MessageEventHandler<T extends EventTarget> = EventHandler<MessageEvent, T>;
export type ToggleEventHandler<T extends EventTarget> = EventHandler<ToggleEvent, T>;
//
// DOM Attributes
@ -136,10 +137,13 @@ export interface DOMAttributes<T extends EventTarget> {
onerror?: EventHandler | undefined | null; // also a Media Event
onerrorcapture?: EventHandler | undefined | null; // also a Media Event
// Detail Events
'on:toggle'?: EventHandler<Event, T> | undefined | null;
ontoggle?: EventHandler<Event, T> | undefined | null;
ontogglecapture?: EventHandler<Event, T> | undefined | null;
// Popover Events
'on:beforetoggle'?: ToggleEventHandler<T> | undefined | null;
onbeforetoggle?: ToggleEventHandler<T> | undefined | null;
onbeforetogglecapture?: ToggleEventHandler<T> | undefined | null;
'on:toggle'?: ToggleEventHandler<T> | undefined | null;
ontoggle?: ToggleEventHandler<T> | undefined | null;
ontogglecapture?: ToggleEventHandler<T> | undefined | null;
// Keyboard Events
'on:keydown'?: KeyboardEventHandler<T> | undefined | null;
@ -727,6 +731,7 @@ export interface HTMLAttributes<T extends EventTarget> extends AriaAttributes, D
title?: string | undefined | null;
translate?: 'yes' | 'no' | '' | undefined | null;
inert?: boolean | undefined | null;
popover?: 'auto' | 'manual' | '' | undefined | null;
// Unknown
radiogroup?: string | undefined | null; // <command>, <menuitem>
@ -873,6 +878,8 @@ export interface HTMLButtonAttributes extends HTMLAttributes<HTMLButtonElement>
name?: string | undefined | null;
type?: 'submit' | 'reset' | 'button' | undefined | null;
value?: string | string[] | number | undefined | null;
popovertarget?: string | undefined | null;
popovertargetaction?: 'toggle' | 'show' | 'hide' | undefined | null;
}
export interface HTMLCanvasAttributes extends HTMLAttributes<HTMLCanvasElement> {
@ -897,6 +904,10 @@ export interface HTMLDetailsAttributes extends HTMLAttributes<HTMLDetailsElement
open?: boolean | undefined | null;
'bind:open'?: boolean | undefined | null;
'on:toggle'?: EventHandler<Event, HTMLDetailsElement> | undefined | null;
ontoggle?: EventHandler<Event, HTMLDetailsElement> | undefined | null;
ontogglecapture?: EventHandler<Event, HTMLDetailsElement> | undefined | null;
}
export interface HTMLDelAttributes extends HTMLAttributes<HTMLModElement> {
@ -1628,7 +1639,15 @@ export interface SVGAttributes<T extends EventTarget> extends AriaAttributes, DO
'stroke-dasharray'?: string | number | undefined | null;
'stroke-dashoffset'?: string | number | undefined | null;
'stroke-linecap'?: 'butt' | 'round' | 'square' | 'inherit' | undefined | null;
'stroke-linejoin'?: 'miter' | 'round' | 'bevel' | 'inherit' | undefined | null;
'stroke-linejoin'?:
| 'arcs'
| 'miter-clip'
| 'miter'
| 'round'
| 'bevel'
| 'inherit'
| undefined
| null;
'stroke-miterlimit'?: string | undefined | null;
'stroke-opacity'?: number | string | undefined | null;
'stroke-width'?: number | string | undefined | null;

@ -2,7 +2,7 @@
"name": "svelte",
"description": "Cybernetically enhanced web apps",
"license": "MIT",
"version": "5.0.0-next.26",
"version": "5.0.0-next.39",
"type": "module",
"types": "./types/index.d.ts",
"engines": {
@ -90,40 +90,41 @@
"templating"
],
"scripts": {
"build": "rollup -c && node scripts/build.js && node scripts/check-treeshakeability.js",
"build": "rollup -c && pnpm generate:types && node scripts/check-treeshakeability.js",
"dev": "rollup -cw",
"check": "tsc && cd ./tests/types && tsc",
"check:watch": "tsc --watch",
"generate:version": "node ./scripts/generate-version.js",
"generate:types": "node ./scripts/generate-types.js",
"prepublishOnly": "pnpm build"
},
"devDependencies": {
"@jridgewell/trace-mapping": "^0.3.19",
"@jridgewell/trace-mapping": "^0.3.22",
"@playwright/test": "^1.35.1",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-virtual": "^3.0.2",
"@types/aria-query": "^5.0.3",
"@types/estree": "^1.0.5",
"dts-buddy": "^0.4.0",
"esbuild": "^0.19.2",
"rollup": "^4.1.5",
"@types/aria-query": "^5.0.4",
"dts-buddy": "^0.4.4",
"esbuild": "^0.19.11",
"rollup": "^4.9.5",
"source-map": "^0.7.4",
"tiny-glob": "^0.2.9"
},
"dependencies": {
"@ampproject/remapping": "^2.2.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
"acorn": "^8.10.0",
"acorn-typescript": "^1.4.11",
"@types/estree": "^1.0.5",
"acorn": "^8.11.3",
"acorn-typescript": "^1.4.13",
"aria-query": "^5.3.0",
"axobject-query": "^4.0.0",
"esm-env": "^1.0.0",
"esrap": "^1.2.1",
"is-reference": "^3.0.1",
"is-reference": "^3.0.2",
"locate-character": "^3.0.0",
"magic-string": "^0.30.4",
"magic-string": "^0.30.5",
"zimmerframe": "^1.1.0"
}
}

@ -78,7 +78,7 @@ const parse = {
* @param {string} reason
*/
'invalid-closing-tag-after-autoclose': (name, reason) =>
`</${name}> attempted to close element that was already automatically closed by <${reason}>`,
`</${name}> attempted to close element that was already automatically closed by <${reason}> (cannot nest <${reason}> inside <${name}>)`,
'invalid-dollar-binding': () =>
`The $ name is reserved, and cannot be used for variables and imports`,
'invalid-dollar-prefix': () =>
@ -100,7 +100,7 @@ const css = {
`:global(...) can be at the start or end of a selector sequence, but not in the middle`,
'invalid-css-global-selector': () => `:global(...) must contain exactly one selector`,
'invalid-css-global-selector-list': () =>
`:global(...) cannot be used to modify a selector, or be modified by another selector`,
`:global(...) must not contain type or universal selectors when used in a compound selector`,
'invalid-css-selector': () => `Invalid selector`,
'invalid-css-identifier': () => 'Expected a valid CSS identifier'
};
@ -234,8 +234,8 @@ const attributes = {
type === 'no-each'
? `An element that uses the animate directive must be the immediate child of a keyed each block`
: type === 'each-key'
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
: `An element that uses the animate directive must be the sole child of a keyed each block`,
? `An element that uses the animate directive must be used inside a keyed each block. Did you forget to add a key to your each block?`
: `An element that uses the animate directive must be the sole child of a keyed each block`,
'duplicate-animation': () => `An element can only have one 'animate' directive`,
/** @param {string[] | undefined} [modifiers] */
'invalid-event-modifier': (modifiers) =>
@ -262,7 +262,7 @@ const attributes = {
? `An element can only have one '${directive1}' directive`
: `An element cannot have both ${describe(directive1)} directive and ${describe(
directive2
)} directive`;
)} directive`;
},
'invalid-let-directive-placement': () => 'let directive at invalid position'
};
@ -435,10 +435,6 @@ const errors = {
// code: 'illegal-declaration',
// message: 'The $ prefix is reserved, and cannot be used for variable and import names'
// },
// illegal_subscription: {
// code: 'illegal-subscription',
// message: 'Cannot reference store value inside <script context="module">'
// },
// illegal_global: /** @param {string} name */ (name) => ({
// code: 'illegal-global',
// message: `${name} is an illegal variable name`
@ -447,19 +443,6 @@ const errors = {
// code: 'illegal-variable-declaration',
// message: 'Cannot declare same variable name which is imported inside <script context="module">'
// },
// css_invalid_global_selector: {
// code: 'css-invalid-global-selector',
// message: ':global(...) must contain a single selector'
// },
// css_invalid_global_selector_position: {
// code: 'css-invalid-global-selector-position',
// message:
// ':global(...) not at the start of a selector sequence should not contain type or universal selectors'
// },
// css_invalid_selector: /** @param {string} selector */ (selector) => ({
// code: 'css-invalid-selector',
// message: `Invalid selector "${selector}"`
// }),
// invalid_directive_value: {
// code: 'invalid-directive-value',
// message:

@ -6,6 +6,7 @@ import { getLocator } from 'locate-character';
import { walk } from 'zimmerframe';
import { validate_component_options, validate_module_options } from './validate-options.js';
import { convert } from './legacy.js';
import { CompileError } from './errors.js';
export { default as preprocess } from './preprocess/index.js';
/**
@ -30,12 +31,8 @@ export function compile(source, options) {
const result = transform_component(analysis, source, combined_options);
return result;
} catch (e) {
if (/** @type {any} */ (e).name === 'CompileError') {
handle_compile_error(
/** @type {import('#compiler').CompileError} */ (e),
options.filename,
source
);
if (e instanceof CompileError) {
handle_compile_error(e, options.filename, source);
}
throw e;
@ -56,12 +53,8 @@ export function compileModule(source, options) {
const analysis = analyze_module(parse_acorn(source, false), validated);
return transform_module(analysis, source, validated);
} catch (e) {
if (/** @type {any} */ (e).name === 'CompileError') {
handle_compile_error(
/** @type {import('#compiler').CompileError} */ (e),
options.filename,
source
);
if (e instanceof CompileError) {
handle_compile_error(e, options.filename, source);
}
throw e;
@ -98,7 +91,7 @@ function handle_compile_error(error, filename, source) {
* https://svelte.dev/docs/svelte-compiler#svelte-parse
* @param {string} source
* @param {{ filename?: string; modern?: boolean }} [options]
* @returns {import('#compiler').SvelteNode | import('./types/legacy-nodes.js').LegacySvelteNode}
* @returns {import('#compiler').Root | import('./types/legacy-nodes.js').LegacyRoot}
*/
export function parse(source, options = {}) {
/** @type {import('#compiler').Root} */
@ -106,12 +99,8 @@ export function parse(source, options = {}) {
try {
ast = _parse(source);
} catch (e) {
if (/** @type {any} */ (e).name === 'CompileError') {
handle_compile_error(
/** @type {import('#compiler').CompileError} */ (e),
options.filename,
source
);
if (e instanceof CompileError) {
handle_compile_error(e, options.filename, source);
}
throw e;
@ -119,7 +108,7 @@ export function parse(source, options = {}) {
if (options.modern) {
// remove things that we don't want to treat as public API
return walk(/** @type {import('#compiler').SvelteNode} */ (ast), null, {
return walk(ast, null, {
_(node, { next }) {
// @ts-ignore
delete node.parent;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save