diff --git a/.changeset/config.json b/.changeset/config.json index 78f066bcad..35736f64d3 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -5,7 +5,7 @@ "fixed": [], "linked": [], "access": "public", - "baseBranch": "svelte-4", + "baseBranch": "svelte-5", "bumpVersionsWithWorkspaceProtocolOnly": true, "ignore": ["!(@sveltejs/*|svelte)"] } diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..fbab8fbc0d --- /dev/null +++ b/.eslintignore @@ -0,0 +1,23 @@ +# NOTE: In general this should be kept in sync with .eslintignore + +**/dist/** +**/config/** +**/build/** +**/playgrounds/sandbox/** +**/npm/** +**/*.js.flow +**/*.d.ts +**/playwright*/** +**/vite.config.js +**/vite.prod.config.js +**/node_modules + +**/tests/** + +# documentation can contain invalid examples +documentation/** + +# contains a fork of the REPL which doesn't adhere to eslint rules +sites/svelte-5-preview/** +# Wasn't checked previously, reenable at some point +sites/svelte.dev/** diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000000..e161e50ef1 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,54 @@ +module.exports = { + extends: ['@sveltejs'], + + // TODO: add runes to eslint-plugin-svelte + globals: { + $state: true, + $derived: true, + $effect: true, + $props: true + }, + + overrides: [ + { + // scripts and playground should be console logging so don't lint against them + files: ['playgrounds/**/*', 'scripts/**/*'], + rules: { + 'no-console': 'off' + } + }, + { + // the playgrounds can use public naming conventions since they're examples + files: ['playgrounds/**/*'], + rules: { + 'lube/svelte-naming-convention': 'off' + } + }, + { + files: ['packages/svelte/src/compiler/**/*'], + rules: { + 'no-var': 'error' + } + } + ], + + plugins: ['lube'], + + rules: { + 'no-console': 'error', + 'lube/svelte-naming-convention': ['error', { fixSameNames: true }], + // eslint isn't that well-versed with JSDoc to know that `foo: /** @type{..} */ (foo)` isn't a violation of this rule, so turn it off + 'object-shorthand': 'off', + 'no-var': 'off', + + // TODO: enable these rules and run `pnpm lint:fix` + // skipping that for now so as to avoid impacting real work + '@typescript-eslint/array-type': 'off', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-unused-vars': 'off', + 'prefer-const': 'off', + 'svelte/valid-compile': 'off', + quotes: 'off' + } +}; diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2eb842967a..3a6f994de1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,7 @@ name: CI on: push: - branches: [svelte-4] + branches: [svelte-5] pull_request: permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/ecosystem-ci-trigger.yml b/.github/workflows/ecosystem-ci-trigger.yml index 952f83a861..ce7bf04136 100644 --- a/.github/workflows/ecosystem-ci-trigger.yml +++ b/.github/workflows/ecosystem-ci-trigger.yml @@ -61,11 +61,11 @@ jobs: repo: pr.head.repo.full_name } - id: generate-token - uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0 + uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0 with: app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }} private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }} - repository: "${{ github.repository_owner }}/svelte-ecosystem-ci" + repository: '${{ github.repository_owner }}/svelte-ecosystem-ci' - uses: actions/github-script@v6 id: trigger env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 999f04d80c..f6b82c64df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release on: push: branches: - - svelte-4 + - svelte-5 permissions: {} jobs: diff --git a/.gitignore b/.gitignore index cc2e05ea5f..7026f39607 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,27 @@ +# Dependency directories +node_modules/ + +# IDE related .idea -.DS_Store .vscode/* !.vscode/launch.json -node_modules + +# Test coverage +coverage +*.lcov + +# Optional eslint cache .eslintcache + +# dotenv environment variables file +.env +.env.test + +# build output +dist +.vercel + +# OS-specific +.DS_Store + +tmp diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..e7914ff487 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,30 @@ +# NOTE: In general this should be kept in sync with .eslintignore + +packages/**/dist/*.js +packages/**/build/*.js +packages/**/npm/**/* +packages/**/config/*.js +packages/svelte/tests/**/*.svelte +packages/svelte/tests/**/_expected* +packages/svelte/tests/**/_actual* +packages/svelte/tests/**/expected* +packages/svelte/tests/**/_output +packages/svelte/tests/**/shards/*.test.js +packages/svelte/tests/hydration/samples/*/_before.html +packages/svelte/tests/hydration/samples/*/_before_head.html +packages/svelte/tests/hydration/samples/*/_after.html +packages/svelte/tests/hydration/samples/*/_after_head.html +packages/svelte/types +packages/svelte/compiler.cjs +playgrounds/demo/src +playgrounds/sandbox/input/**.svelte +playgrounds/sandbox/output +**/*.md +**/node_modules +**/.svelte-kit +flow-typed +.github/CODEOWNERS +.prettierignore +.eslintignore +pnpm-lock.yaml +pnpm-workspace.yaml diff --git a/.prettierrc b/.prettierrc index 0ea7a0b1e9..c2d09a4289 100644 --- a/.prettierrc +++ b/.prettierrc @@ -18,6 +18,5 @@ "tabWidth": 2 } } - ], - "pluginSearchDirs": ["."] + ] } diff --git a/.vscode/launch.json b/.vscode/launch.json index 2e22a5ab9b..095d9c57a2 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,7 @@ "name": "Playground: Server", "outputCapture": "std", "program": "start.js", - "cwd": "${workspaceFolder}/packages/playground", + "cwd": "${workspaceFolder}/playgrounds/demo", "cascadeTerminateToConfigurations": ["Playground: Browser"] } ], diff --git a/documentation/examples/06-lifecycle/02-update/App.svelte b/documentation/examples/06-lifecycle/02-update/App.svelte index ac23335899..afc1b29ea8 100644 --- a/documentation/examples/06-lifecycle/02-update/App.svelte +++ b/documentation/examples/06-lifecycle/02-update/App.svelte @@ -31,22 +31,28 @@ const reply = eliza.transform(text); - setTimeout(() => { - comments = comments.concat({ - author: 'eliza', - text: '...', - placeholder: true - }); - - setTimeout(() => { - comments = comments - .filter((comment) => !comment.placeholder) - .concat({ - author: 'eliza', - text: reply - }); - }, 500 + Math.random() * 500); - }, 200 + Math.random() * 200); + setTimeout( + () => { + comments = comments.concat({ + author: 'eliza', + text: '...', + placeholder: true + }); + + setTimeout( + () => { + comments = comments + .filter((comment) => !comment.placeholder) + .concat({ + author: 'eliza', + text: reply + }); + }, + 500 + Math.random() * 500 + ); + }, + 200 + Math.random() * 200 + ); } } diff --git a/documentation/examples/17-special-elements/00-svelte-self/Folder.svelte b/documentation/examples/17-special-elements/00-svelte-self/Folder.svelte index 543a7140d3..356263a91c 100644 --- a/documentation/examples/17-special-elements/00-svelte-self/Folder.svelte +++ b/documentation/examples/17-special-elements/00-svelte-self/Folder.svelte @@ -34,8 +34,8 @@ background-size: 1em 1em; font-weight: bold; cursor: pointer; - border:none; - font-size:14px; + border: none; + font-size: 14px; } .expanded { diff --git a/documentation/examples/21-miscellaneous/02-immutable-data/App.svelte b/documentation/examples/21-miscellaneous/02-immutable-data/App.svelte index 05d0820f9e..f43f3bb767 100644 --- a/documentation/examples/21-miscellaneous/02-immutable-data/App.svelte +++ b/documentation/examples/21-miscellaneous/02-immutable-data/App.svelte @@ -27,10 +27,10 @@

Immutable

{#each todos as todo} - toggle(todo.id)} />
+ toggle(todo.id)} />
{/each}

Mutable

{#each todos as todo} - toggle(todo.id)} />
+ toggle(todo.id)} />
{/each} diff --git a/documentation/examples/21-miscellaneous/02-immutable-data/ImmutableTodo.svelte b/documentation/examples/21-miscellaneous/02-immutable-data/ImmutableTodo.svelte index 8044f6be4e..72d3d83e6b 100644 --- a/documentation/examples/21-miscellaneous/02-immutable-data/ImmutableTodo.svelte +++ b/documentation/examples/21-miscellaneous/02-immutable-data/ImmutableTodo.svelte @@ -23,8 +23,8 @@ diff --git a/documentation/examples/21-miscellaneous/02-immutable-data/MutableTodo.svelte b/documentation/examples/21-miscellaneous/02-immutable-data/MutableTodo.svelte index f92468ab79..fb960ead91 100644 --- a/documentation/examples/21-miscellaneous/02-immutable-data/MutableTodo.svelte +++ b/documentation/examples/21-miscellaneous/02-immutable-data/MutableTodo.svelte @@ -21,8 +21,8 @@ diff --git a/documentation/tutorial/02-reactivity/01-reactive-assignments/app-a/App.svelte b/documentation/tutorial/02-reactivity/01-reactive-assignments/app-a/App.svelte index 8b1569bffb..76483b567a 100644 --- a/documentation/tutorial/02-reactivity/01-reactive-assignments/app-a/App.svelte +++ b/documentation/tutorial/02-reactivity/01-reactive-assignments/app-a/App.svelte @@ -13,6 +13,6 @@ diff --git a/documentation/tutorial/02-reactivity/01-reactive-assignments/app-b/App.svelte b/documentation/tutorial/02-reactivity/01-reactive-assignments/app-b/App.svelte index d51ca2e068..17e7c07312 100644 --- a/documentation/tutorial/02-reactivity/01-reactive-assignments/app-b/App.svelte +++ b/documentation/tutorial/02-reactivity/01-reactive-assignments/app-b/App.svelte @@ -13,6 +13,6 @@ diff --git a/documentation/tutorial/04-logic/05-keyed-each-blocks/app-a/Thing.svelte b/documentation/tutorial/04-logic/05-keyed-each-blocks/app-a/Thing.svelte index eb3a6f076d..e1b0bd43e7 100644 --- a/documentation/tutorial/04-logic/05-keyed-each-blocks/app-a/Thing.svelte +++ b/documentation/tutorial/04-logic/05-keyed-each-blocks/app-a/Thing.svelte @@ -34,7 +34,7 @@ padding: 0.2em 1em 0.3em; text-align: center; border-radius: 0.2em; - color:#333333; + color: #333333; background-color: #ffdfd3; } diff --git a/documentation/tutorial/04-logic/05-keyed-each-blocks/app-b/Thing.svelte b/documentation/tutorial/04-logic/05-keyed-each-blocks/app-b/Thing.svelte index eb3a6f076d..e1b0bd43e7 100644 --- a/documentation/tutorial/04-logic/05-keyed-each-blocks/app-b/Thing.svelte +++ b/documentation/tutorial/04-logic/05-keyed-each-blocks/app-b/Thing.svelte @@ -34,7 +34,7 @@ padding: 0.2em 1em 0.3em; text-align: center; border-radius: 0.2em; - color:#333333; + color: #333333; background-color: #ffdfd3; } diff --git a/documentation/tutorial/07-lifecycle/03-update/app-a/App.svelte b/documentation/tutorial/07-lifecycle/03-update/app-a/App.svelte index 1677825de4..235b53889f 100644 --- a/documentation/tutorial/07-lifecycle/03-update/app-a/App.svelte +++ b/documentation/tutorial/07-lifecycle/03-update/app-a/App.svelte @@ -31,22 +31,28 @@ const reply = eliza.transform(text); - setTimeout(() => { - comments = comments.concat({ - author: 'eliza', - text: '...', - placeholder: true - }); - - setTimeout(() => { - comments = comments - .filter((comment) => !comment.placeholder) - .concat({ - author: 'eliza', - text: reply - }); - }, 500 + Math.random() * 500); - }, 200 + Math.random() * 200); + setTimeout( + () => { + comments = comments.concat({ + author: 'eliza', + text: '...', + placeholder: true + }); + + setTimeout( + () => { + comments = comments + .filter((comment) => !comment.placeholder) + .concat({ + author: 'eliza', + text: reply + }); + }, + 500 + Math.random() * 500 + ); + }, + 200 + Math.random() * 200 + ); } } diff --git a/documentation/tutorial/07-lifecycle/03-update/app-b/App.svelte b/documentation/tutorial/07-lifecycle/03-update/app-b/App.svelte index 644810a35e..7afb5eb427 100644 --- a/documentation/tutorial/07-lifecycle/03-update/app-b/App.svelte +++ b/documentation/tutorial/07-lifecycle/03-update/app-b/App.svelte @@ -31,22 +31,28 @@ const reply = eliza.transform(text); - setTimeout(() => { - comments = comments.concat({ - author: 'eliza', - text: '...', - placeholder: true - }); - - setTimeout(() => { - comments = comments - .filter((comment) => !comment.placeholder) - .concat({ - author: 'eliza', - text: reply - }); - }, 500 + Math.random() * 500); - }, 200 + Math.random() * 200); + setTimeout( + () => { + comments = comments.concat({ + author: 'eliza', + text: '...', + placeholder: true + }); + + setTimeout( + () => { + comments = comments + .filter((comment) => !comment.placeholder) + .concat({ + author: 'eliza', + text: reply + }); + }, + 500 + Math.random() * 500 + ); + }, + 200 + Math.random() * 200 + ); } } diff --git a/documentation/tutorial/14-composition/05-slot-props/app-a/App.svelte b/documentation/tutorial/14-composition/05-slot-props/app-a/App.svelte index 9985963d83..dcf0dacae5 100644 --- a/documentation/tutorial/14-composition/05-slot-props/app-a/App.svelte +++ b/documentation/tutorial/14-composition/05-slot-props/app-a/App.svelte @@ -17,7 +17,7 @@ padding: 1em; margin: 0 0 1em 0; background-color: #eee; - color: black; + color: black; } .active { diff --git a/documentation/tutorial/14-composition/05-slot-props/app-b/App.svelte b/documentation/tutorial/14-composition/05-slot-props/app-b/App.svelte index 4364e013fa..024de304dc 100644 --- a/documentation/tutorial/14-composition/05-slot-props/app-b/App.svelte +++ b/documentation/tutorial/14-composition/05-slot-props/app-b/App.svelte @@ -37,7 +37,7 @@ padding: 1em; margin: 0 0 1em 0; background-color: #eee; - color: black; + color: black; } .active { diff --git a/package.json b/package.json index 4d22d9642a..708175055c 100644 --- a/package.json +++ b/package.json @@ -4,31 +4,42 @@ "description": "monorepo for svelte and friends", "private": true, "type": "module", + "license": "MIT", + "packageManager": "pnpm@8.6.12", + "engines": { + "pnpm": "^8.0.0" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sveltejs/svelte.git" + }, "scripts": { - "test": "pnpm test -r --filter=./packages/*", + "start": "cross-env NODE_ENV=development concurrently \"npm run watch\" \"npm run dev --prefix playgrounds/demo\"", "build": "pnpm -r --filter=./packages/* build", "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", - "lint": "cd packages/svelte && pnpm build && cd ../../ && pnpm -r lint", - "format": "pnpm -r format", + "format": "prettier --write --plugin prettier-plugin-svelte .", + "lint": "prettier --check --plugin prettier-plugin-svelte . && 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" }, - "repository": { - "type": "git", - "url": "git+https://github.com/sveltejs/svelte.git" - }, - "license": "MIT", "devDependencies": { - "@changesets/cli": "^2.26.1", - "@svitejs/changesets-changelog-github-compact": "^1.1.0", - "@typescript-eslint/eslint-plugin": "^5.60.0", - "eslint": "^8.44.0", - "eslint-plugin-svelte": "^2.32.2", - "eslint-plugin-unicorn": "^47.0.0", + "@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", + "cross-env": "^7.0.3", + "eslint": "^8.49.0", + "eslint-plugin-lube": "^0.1.7", + "jsdom": "22.0.0", "playwright": "^1.35.1", - "prettier": "^2.8.8", - "prettier-plugin-svelte": "^2.10.1" - }, - "packageManager": "pnpm@8.6.3" + "prettier": "^3.0.1", + "prettier-plugin-svelte": "^3.0.3", + "typescript": "^5.2.2", + "vitest": "^0.34.6" + } } diff --git a/packages/svelte/.eslintignore b/packages/svelte/.eslintignore deleted file mode 100644 index 67a89ff12c..0000000000 --- a/packages/svelte/.eslintignore +++ /dev/null @@ -1,17 +0,0 @@ -**/_actual.js -**/expected.js -_output -test/*/samples/*/output.js - -# automatically generated -internal_exports.js - -# output files -animate/*.js -esing/*.js -internal/*.js -motion/*.js -store/*.js -transition/*.js -index.js -compiler.js diff --git a/packages/svelte/.eslintrc.cjs b/packages/svelte/.eslintrc.cjs deleted file mode 100644 index e504664b8a..0000000000 --- a/packages/svelte/.eslintrc.cjs +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - root: true, - extends: ['@sveltejs'], - rules: { - '@typescript-eslint/no-non-null-assertion': 'off' - } -}; diff --git a/packages/svelte/.gitignore b/packages/svelte/.gitignore index 2f5d67e7de..5395fb32cb 100644 --- a/packages/svelte/.gitignore +++ b/packages/svelte/.gitignore @@ -1,18 +1,12 @@ -*.map -/src/compiler/compile/internal_exports.js -/compiler.cjs -/scratch/ -/test/*/samples/_ -/test/runtime/shards -_actual*.* -_output /types +/compiler.cjs action.d.ts animate.d.ts compiler.d.ts easing.d.ts index.d.ts +legacy.d.ts motion.d.ts store.d.ts transition.d.ts diff --git a/packages/svelte/.prettierignore b/packages/svelte/.prettierignore deleted file mode 100644 index fef52b1e8f..0000000000 --- a/packages/svelte/.prettierignore +++ /dev/null @@ -1,22 +0,0 @@ -/* -!/elements -!/scripts -!/src -src/compiler/compile/internal_exports.js -src/shared/version.js -!/test -!documentation -!sites -sites/svelte.dev/src/lib/generated/*.js -sites/svelte.dev/.svelte-kit -sites/svelte.dev/.vercel -/test/**/*.svelte -/test/**/_expected* -/test/**/_actual* -/test/**/expected* -/test/**/_output -/test/**/shards/*.test.js -/test/hydration/samples/raw-repair/_after.html -/types -!rollup.config.js -!vitest.config.js diff --git a/packages/svelte/CHANGELOG.md b/packages/svelte/CHANGELOG.md deleted file mode 100644 index 07edffc2b7..0000000000 --- a/packages/svelte/CHANGELOG.md +++ /dev/null @@ -1,2926 +0,0 @@ -# svelte - -## 4.2.3 - -### Patch Changes - -- fix: improve a11y-click-events-have-key-events message ([#9358](https://github.com/sveltejs/svelte/pull/9358)) - -- fix: more robust hydration of html tag ([#9184](https://github.com/sveltejs/svelte/pull/9184)) - -## 4.2.2 - -### Patch Changes - -- fix: support camelCase properties on custom elements ([#9328](https://github.com/sveltejs/svelte/pull/9328)) - -- fix: add missing plaintext-only value to contenteditable type ([#9242](https://github.com/sveltejs/svelte/pull/9242)) - -- chore: upgrade magic-string to 0.30.4 ([#9292](https://github.com/sveltejs/svelte/pull/9292)) - -- fix: ignore trailing comments when comparing nodes ([#9197](https://github.com/sveltejs/svelte/pull/9197)) - -## 4.2.1 - -### Patch Changes - -- fix: update style directive when style attribute is present and is updated via an object prop ([#9187](https://github.com/sveltejs/svelte/pull/9187)) - -- fix: css sourcemap generation with unicode filenames ([#9120](https://github.com/sveltejs/svelte/pull/9120)) - -- fix: do not add module declared variables as dependencies ([#9122](https://github.com/sveltejs/svelte/pull/9122)) - -- fix: handle `svelte:element` with dynamic this and spread attributes ([#9112](https://github.com/sveltejs/svelte/pull/9112)) - -- fix: silence false positive reactive component warning ([#9094](https://github.com/sveltejs/svelte/pull/9094)) - -- fix: head duplication when binding is present ([#9124](https://github.com/sveltejs/svelte/pull/9124)) - -- fix: take custom attribute name into account when reflecting property ([#9140](https://github.com/sveltejs/svelte/pull/9140)) - -- fix: add `indeterminate` to the list of HTMLAttributes ([#9180](https://github.com/sveltejs/svelte/pull/9180)) - -- fix: recognize option value on spread attribute ([#9125](https://github.com/sveltejs/svelte/pull/9125)) - -## 4.2.0 - -### Minor Changes - -- feat: move `svelteHTML` from language-tools into core to load the correct `svelte/element` types ([#9070](https://github.com/sveltejs/svelte/pull/9070)) - -## 4.1.2 - -### Patch Changes - -- fix: allow child element with slot attribute within svelte:element ([#9038](https://github.com/sveltejs/svelte/pull/9038)) - -- fix: Add data-\* to svg attributes ([#9036](https://github.com/sveltejs/svelte/pull/9036)) - -## 4.1.1 - -### Patch Changes - -- fix: `svelte:component` spread props change not picked up ([#9006](https://github.com/sveltejs/svelte/pull/9006)) - -## 4.1.0 - -### Minor Changes - -- feat: add ability to extend custom element class ([#8991](https://github.com/sveltejs/svelte/pull/8991)) - -### Patch Changes - -- fix: ensure `svelte:component` evaluates props once ([#8946](https://github.com/sveltejs/svelte/pull/8946)) - -- fix: remove `let:variable` slot bindings from select binding dependencies ([#8969](https://github.com/sveltejs/svelte/pull/8969)) - -- fix: handle destructured primitive literals ([#8871](https://github.com/sveltejs/svelte/pull/8871)) - -- perf: optimize imports that are not mutated or reassigned ([#8948](https://github.com/sveltejs/svelte/pull/8948)) - -- fix: don't add accessor twice ([#8996](https://github.com/sveltejs/svelte/pull/8996)) - -## 4.0.5 - -### Patch Changes - -- fix: generate type definition with nullable types ([#8924](https://github.com/sveltejs/svelte/pull/8924)) - -## 4.0.4 - -### Patch Changes - -- fix: claim svg tags in raw mustache tags correctly ([#8910](https://github.com/sveltejs/svelte/pull/8910)) - -- fix: repair invalid raw html content during hydration ([#8912](https://github.com/sveltejs/svelte/pull/8912)) - -## 4.0.3 - -### Patch Changes - -- fix: handle falsy srcset values ([#8901](https://github.com/sveltejs/svelte/pull/8901)) - -## 4.0.2 - -### Patch Changes - -- fix: reflect all custom element prop updates back to attribute ([#8898](https://github.com/sveltejs/svelte/pull/8898)) - -- fix: shrink custom element baseline a bit ([#8858](https://github.com/sveltejs/svelte/pull/8858)) - -- fix: use non-destructive hydration for all `@html` tags ([#8880](https://github.com/sveltejs/svelte/pull/8880)) - -- fix: align `disclose-version` exports specification ([#8874](https://github.com/sveltejs/svelte/pull/8874)) - -- fix: check srcset when hydrating to prevent needless requests ([#8868](https://github.com/sveltejs/svelte/pull/8868)) - -## 4.0.1 - -### Patch Changes - -- fix: ensure identifiers in destructuring contexts don't clash with existing ones ([#8840](https://github.com/sveltejs/svelte/pull/8840)) - -- fix: ensure `createEventDispatcher` and `ActionReturn` work with types from generic function parameters ([#8872](https://github.com/sveltejs/svelte/pull/8872)) - -- fix: apply transition to `` with local transition ([#8865](https://github.com/sveltejs/svelte/pull/8865)) - -- fix: relax a11y "no redundant role" rule for li, ul, ol ([#8867](https://github.com/sveltejs/svelte/pull/8867)) - -- fix: remove tsconfig.json from published package ([#8859](https://github.com/sveltejs/svelte/pull/8859)) - -## 4.0.0 - -### Major Changes - -- breaking: Minimum supported Node version is now Node 16 ([#8566](https://github.com/sveltejs/svelte/pull/8566)) - -- breaking: Minimum supported webpack version is now webpack 5 ([#8515](https://github.com/sveltejs/svelte/pull/8515)) - -- breaking: Bundlers must specify the `browser` condition when building a frontend bundle for the browser ([#8516](https://github.com/sveltejs/svelte/pull/8516)) - -- breaking: Minimum supported vite-plugin-svelte version is now 2.4.1. SvelteKit users can upgrade to 1.20.0 or newer to ensure a compatible version ([#8516](https://github.com/sveltejs/svelte/pull/8516)) - -- breaking: Minimum supported `rollup-plugin-svelte` version is now 7.1.5 ([198dbcf](https://github.com/sveltejs/svelte/commit/198dbcf)) - -- breaking: Minimum supported `svelte-loader` is now 3.1.8 ([198dbcf](https://github.com/sveltejs/svelte/commit/198dbcf)) - -- breaking: Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that) ([#8488](https://github.com/sveltejs/svelte/pull/8488)) - -- breaking: Remove `svelte/register` hook, CJS runtime version and CJS compiler output ([#8613](https://github.com/sveltejs/svelte/pull/8613)) - -- breaking: Stricter types for `createEventDispatcher` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224)) - -- breaking: Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7442](https://github.com/sveltejs/svelte/pull/7442)) - -- breaking: Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions - (see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136)) - -- breaking: Overhaul and drastically improve creating custom elements with Svelte (see PR for list of changes and migration instructions) ([#8457](https://github.com/sveltejs/svelte/pull/8457)) - -- breaking: Deprecate `SvelteComponentTyped` in favor of `SvelteComponent` ([#8512](https://github.com/sveltejs/svelte/pull/8512)) - -- breaking: Make transitions local by default to prevent confusion around page navigations ([#6686](https://github.com/sveltejs/svelte/issues/6686)) - -- breaking: Error on falsy values instead of stores passed to `derived` ([#7947](https://github.com/sveltejs/svelte/pull/7947)) - -- breaking: Custom store implementers now need to pass an `update` function additionally to the `set` function ([#6750](https://github.com/sveltejs/svelte/pull/6750)) - -- breaking: Do not expose default slot bindings to named slots and vice versa ([#6049](https://github.com/sveltejs/svelte/pull/6049)) - -- breaking: Change order in which preprocessors are applied ([#8618](https://github.com/sveltejs/svelte/pull/8618)) - -- breaking: The runtime now makes use of `classList.toggle(name, boolean)` which does not work in very old browsers ([#8629](https://github.com/sveltejs/svelte/pull/8629)) - -- breaking: apply `inert` to outroing elements ([#8628](https://github.com/sveltejs/svelte/pull/8628)) - -- breaking: use `CustomEvent` constructor instead of deprecated `createEvent` method ([#8775](https://github.com/sveltejs/svelte/pull/8775)) - -### Minor Changes - -- Add a way to modify attributes for script/style preprocessors ([#8618](https://github.com/sveltejs/svelte/pull/8618)) - -- Improve hydration speed by adding `data-svelte-h` attribute to detect unchanged HTML elements ([#7426](https://github.com/sveltejs/svelte/pull/7426)) - -- Add `a11y no-noninteractive-element-interactions` rule ([#8391](https://github.com/sveltejs/svelte/pull/8391)) - -- Add `a11y-no-static-element-interactions`rule ([#8251](https://github.com/sveltejs/svelte/pull/8251)) - -- Allow `#each` to iterate over iterables like `Set`, `Map` etc ([#7425](https://github.com/sveltejs/svelte/issues/7425)) - -- Improve duplicate key error for keyed `each` blocks ([#8411](https://github.com/sveltejs/svelte/pull/8411)) - -- Warn about `:` in attributes and props to prevent ambiguity with Svelte directives ([#6823](https://github.com/sveltejs/svelte/issues/6823)) - -- feat: add version info to `window`. You can opt out by setting `discloseVersion` to `false` in the compiler options ([#8761](https://github.com/sveltejs/svelte/pull/8761)) - -- feat: smaller minified output for destructor chunks ([#8763](https://github.com/sveltejs/svelte/pull/8763)) - -### Patch Changes - -- Bind `null` option and input values consistently ([#8312](https://github.com/sveltejs/svelte/issues/8312)) - -- Allow `$store` to be used with changing values including nullish values ([#7555](https://github.com/sveltejs/svelte/issues/7555)) - -- Initialize stylesheet with `/* empty */` to enable setting CSP directive that also works in Safari ([#7800](https://github.com/sveltejs/svelte/pull/7800)) - -- Treat slots as if they don't exist when using CSS adjacent and general sibling combinators ([#8284](https://github.com/sveltejs/svelte/issues/8284)) - -- Fix transitions so that they don't require a `style-src 'unsafe-inline'` Content Security Policy (CSP) ([#6662](https://github.com/sveltejs/svelte/issues/6662)). - -- Explicitly disallow `var` declarations extending the reactive statement scope ([#6800](https://github.com/sveltejs/svelte/pull/6800)) - -- Improve error message when trying to use `animate:` directives on inline components ([#8641](https://github.com/sveltejs/svelte/issues/8641)) - -- fix: export ComponentType from `svelte` entrypoint ([#8578](https://github.com/sveltejs/svelte/pull/8578)) - -- fix: never use html optimization for mustache tags in hydration mode ([#8744](https://github.com/sveltejs/svelte/pull/8744)) - -- fix: derived store types ([#8578](https://github.com/sveltejs/svelte/pull/8578)) - -- Generate type declarations with dts-buddy ([#8578](https://github.com/sveltejs/svelte/pull/8578)) - -- fix: ensure types are loaded with all TS settings ([#8721](https://github.com/sveltejs/svelte/pull/8721)) - -- fix: account for preprocessor source maps when calculating meta info ([#8778](https://github.com/sveltejs/svelte/pull/8778)) - -- chore: deindent cjs output for compiler ([#8785](https://github.com/sveltejs/svelte/pull/8785)) - -- warn on boolean compilerOptions.css ([#8710](https://github.com/sveltejs/svelte/pull/8710)) - -- fix: export correct SvelteComponent type ([#8721](https://github.com/sveltejs/svelte/pull/8721)) - -## 4.0.0-next.3 - -### Patch Changes - -- feat: smaller minified output for destructor chunks ([#8763](https://github.com/sveltejs/svelte/pull/8763)) - -- breaking: use `CustomEvent` constructor instead of deprecated `createEvent` method ([#8775](https://github.com/sveltejs/svelte/pull/8775)) - -- fix: account for preprocessor source maps when calculating meta info ([#8778](https://github.com/sveltejs/svelte/pull/8778)) - -- chore: deindent cjs output for compiler ([#8785](https://github.com/sveltejs/svelte/pull/8785)) - -- feat: add version info to `window`. You can opt out by setting `discloseVersion` to `false` in the compiler options ([#8761](https://github.com/sveltejs/svelte/pull/8761)) - -## 4.0.0-next.2 - -### Patch Changes - -- fix: never use html optimization for mustache tags in hydration mode ([#8744](https://github.com/sveltejs/svelte/pull/8744)) - -- fix: ensure types are loaded with all TS settings ([#8721](https://github.com/sveltejs/svelte/pull/8721)) - -- warn on boolean compilerOptions.css ([#8710](https://github.com/sveltejs/svelte/pull/8710)) - -- fix: export correct SvelteComponent type ([#8721](https://github.com/sveltejs/svelte/pull/8721)) - -## 4.0.0-next.1 - -### Patch Changes - -- fix: export ComponentType from `svelte` entrypoint ([#8694](https://github.com/sveltejs/svelte/pull/8694)) - -- fix: derived store types ([#8700](https://github.com/sveltejs/svelte/pull/8700)) - -- Generate type declarations with dts-buddy ([#8702](https://github.com/sveltejs/svelte/pull/8702)) - -## 4.0.0-next.0 - -### Major Changes - -- breaking: Minimum supported Node version is now Node 16 ([#8566](https://github.com/sveltejs/svelte/pull/8566)) -- breaking: Minimum supported webpack version is now webpack 5 ([#8515](https://github.com/sveltejs/svelte/pull/8515)) -- breaking: Bundlers must specify the `browser` condition when building a frontend bundle for the browser ([#8516](https://github.com/sveltejs/svelte/pull/8516)) -- breaking: Minimum supported vite-plugin-svelte version is now 2.4.1. SvelteKit users can upgrade to 1.20.0 or newer to ensure a compatible version ([#8516](https://github.com/sveltejs/svelte/pull/8516)) -- breaking: Minimum supported `rollup-plugin-svelte` version is now 7.1.5 ([198dbcf](https://github.com/sveltejs/svelte/commit/198dbcf)) -- breaking: Minimum supported `svelte-loader` is now 3.1.8 ([198dbcf](https://github.com/sveltejs/svelte/commit/198dbcf)) -- breaking: Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that) ([#8488](https://github.com/sveltejs/svelte/pull/8488)) -- breaking: Remove `svelte/register` hook, CJS runtime version and CJS compiler output ([#8613](https://github.com/sveltejs/svelte/pull/8613)) -- breaking: Stricter types for `createEventDispatcher` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224)) -- breaking: Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7442](https://github.com/sveltejs/svelte/pull/7442)) -- breaking: Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions (see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136)) -- breaking: Overhaul and drastically improve creating custom elements with Svelte (see PR for list of changes and migration instructions) ([#8457](https://github.com/sveltejs/svelte/pull/8457)) -- breaking: Deprecate `SvelteComponentTyped` in favor of `SvelteComponent` ([#8512](https://github.com/sveltejs/svelte/pull/8512)) -- breaking: Make transitions local by default to prevent confusion around page navigations ([#6686](https://github.com/sveltejs/svelte/issues/6686)) -- breaking: Error on falsy values instead of stores passed to `derived` ([#7947](https://github.com/sveltejs/svelte/pull/7947)) -- breaking: Custom store implementers now need to pass an `update` function additionally to the `set` function ([#6750](https://github.com/sveltejs/svelte/pull/6750)) -- breaking: Do not expose default slot bindings to named slots and vice versa ([#6049](https://github.com/sveltejs/svelte/pull/6049)) -- breaking: Change order in which preprocessors are applied ([#8618](https://github.com/sveltejs/svelte/pull/8618)) -- breaking: The runtime now makes use of `classList.toggle(name, boolean)` which does not work in very old browsers ([#8629](https://github.com/sveltejs/svelte/pull/8629)) -- breaking: apply `inert` to outroing elements ([#8627](https://github.com/sveltejs/svelte/pull/8627)) - -### Minor Changes - -- Add a way to modify attributes for script/style preprocessors ([#8618](https://github.com/sveltejs/svelte/pull/8618)) -- Improve hydration speed by adding `data-svelte-h` attribute to detect unchanged HTML elements ([#7426](https://github.com/sveltejs/svelte/pull/7426)) -- Add `a11y no-noninteractive-element-interactions` rule ([#8391](https://github.com/sveltejs/svelte/pull/8391)) -- Add `a11y-no-static-element-interactions`rule ([#8251](https://github.com/sveltejs/svelte/pull/8251)) -- Allow `#each` to iterate over iterables like `Set`, `Map` etc ([#7425](https://github.com/sveltejs/svelte/issues/7425)) -- Improve duplicate key error for keyed `each` blocks ([#8411](https://github.com/sveltejs/svelte/pull/8411)) -- Warn about `:` in attributes and props to prevent ambiguity with Svelte directives ([#6823](https://github.com/sveltejs/svelte/issues/6823)) - -### Patch Changes - -- Bind `null` option and input values consistently ([#8312](https://github.com/sveltejs/svelte/issues/8312)) -- Allow `$store` to be used with changing values including nullish values ([#7555](https://github.com/sveltejs/svelte/issues/7555)) -- Initialize stylesheet with `/* empty */` to enable setting CSP directive that also works in Safari ([#7800](https://github.com/sveltejs/svelte/pull/7800)) -- Treat slots as if they don't exist when using CSS adjacent and general sibling combinators ([#8284](https://github.com/sveltejs/svelte/issues/8284)) -- Fix transitions so that they don't require a `style-src 'unsafe-inline'` Content Security Policy (CSP) ([#6662](https://github.com/sveltejs/svelte/issues/6662)). -- Explicitly disallow `var` declarations extending the reactive statement scope ([#6800](https://github.com/sveltejs/svelte/pull/6800)) -- Improve error message when trying to use `animate:` directives on inline components ([#8641](https://github.com/sveltejs/svelte/issues/8641)) - -## 3.59.2 - -- Fix escaping `', - test({ assert, target }) { - const textarea = target.querySelector('textarea'); - assert.ok(textarea.readOnly === false); - } -}; diff --git a/packages/svelte/test/runtime/samples/attribute-boolean-hidden/_config.js b/packages/svelte/test/runtime/samples/attribute-boolean-hidden/_config.js deleted file mode 100644 index 5a6d28c08a..0000000000 --- a/packages/svelte/test/runtime/samples/attribute-boolean-hidden/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - get props() { - return { hidden: true }; - }, - html: '