Update to stable Svelte 5 release (#3513)

* Update to stable Svelte 5 release

This causes a bunch of warnings to be omitted:

ts/routes/graphs/RangeBox.svelte:52:18
Warn: Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update (svelte)
                break;
            case RevlogRange.All:
                $days = 0;

They are triggered on enum references, and it appears to be a bug.
May need to report it to Svelte?

* Deps update

* Silence spurious errors + fix a real one

https://github.com/sveltejs/svelte/issues/13811
This commit is contained in:
Damien Elmes 2024-10-26 18:21:45 +10:00 committed by GitHub
parent a9ebf842ea
commit 014620ab65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 496 additions and 417 deletions

View file

@ -20,7 +20,7 @@
"@sqltools/formatter": "^1.2.2", "@sqltools/formatter": "^1.2.2",
"@sveltejs/adapter-static": "^3.0.0", "@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.4.1", "@sveltejs/kit": "^2.4.1",
"@sveltejs/vite-plugin-svelte": "4.0.0-next.7", "@sveltejs/vite-plugin-svelte": "4.0.0",
"@types/bootstrap": "^5.0.12", "@types/bootstrap": "^5.0.12",
"@types/codemirror": "^5.60.0", "@types/codemirror": "^5.60.0",
"@types/d3": "^7.0.0", "@types/d3": "^7.0.0",
@ -47,7 +47,8 @@
"license-checker-rseidelsohn": "=4.3.0", "license-checker-rseidelsohn": "=4.3.0",
"prettier": "^2.4.1", "prettier": "^2.4.1",
"prettier-plugin-svelte": "^3.2.6", "prettier-plugin-svelte": "^3.2.6",
"svelte": "5.0.0-next.179", "sass": "<1.77",
"svelte": "5.0.0",
"svelte-check": "^3.4.4", "svelte-check": "^3.4.4",
"svelte-preprocess": "^5.0.4", "svelte-preprocess": "^5.0.4",
"svelte-preprocess-esbuild": "^3.0.1", "svelte-preprocess-esbuild": "^3.0.1",
@ -56,8 +57,7 @@
"tsx": "^3.12.0", "tsx": "^3.12.0",
"typescript": "^5.0.4", "typescript": "^5.0.4",
"vite": "=5.4.7", "vite": "=5.4.7",
"vitest": "^1.2.1", "vitest": "^1.2.1"
"sass": "<1.77"
}, },
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^1.2.1", "@bufbuild/protobuf": "^1.2.1",

View file

@ -224,7 +224,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
Number(actualWidth) <= maxWidth && Number(actualHeight) <= maxHeight; Number(actualWidth) <= maxWidth && Number(actualHeight) <= maxHeight;
let restoringDisabled: boolean; let restoringDisabled: boolean;
$: restoringDisabled = !activeImage?.hasAttribute("width") ?? true; $: restoringDisabled = !(activeImage?.hasAttribute("width") ?? true);
const widthObserver = new MutationObserver(() => { const widthObserver = new MutationObserver(() => {
restoringDisabled = !activeImage!.hasAttribute("width"); restoringDisabled = !activeImage!.hasAttribute("width");

View file

@ -17,7 +17,7 @@ export function supportsVerticalText(): boolean {
); );
} }
export function direction(): string { export function direction(): "ltr" | "rtl" {
const firstLang = firstLanguage(); const firstLang = firstLanguage();
if ( if (
firstLang.startsWith("ar") firstLang.startsWith("ar")

View file

@ -5,21 +5,21 @@
"path": "node_modules/@bufbuild/protobuf", "path": "node_modules/@bufbuild/protobuf",
"licenseFile": "node_modules/@bufbuild/protobuf/README.md" "licenseFile": "node_modules/@bufbuild/protobuf/README.md"
}, },
"@floating-ui/core@1.6.7": { "@floating-ui/core@1.6.8": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui", "repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks", "publisher": "atomiks",
"path": "node_modules/@floating-ui/core", "path": "node_modules/@floating-ui/core",
"licenseFile": "node_modules/@floating-ui/core/LICENSE" "licenseFile": "node_modules/@floating-ui/core/LICENSE"
}, },
"@floating-ui/dom@1.6.10": { "@floating-ui/dom@1.6.11": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui", "repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks", "publisher": "atomiks",
"path": "node_modules/@floating-ui/dom", "path": "node_modules/@floating-ui/dom",
"licenseFile": "node_modules/@floating-ui/dom/LICENSE" "licenseFile": "node_modules/@floating-ui/dom/LICENSE"
}, },
"@floating-ui/utils@0.2.7": { "@floating-ui/utils@0.2.8": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/floating-ui/floating-ui", "repository": "https://github.com/floating-ui/floating-ui",
"publisher": "atomiks", "publisher": "atomiks",
@ -84,7 +84,7 @@
"path": "node_modules/acorn-globals/node_modules/acorn", "path": "node_modules/acorn-globals/node_modules/acorn",
"licenseFile": "node_modules/acorn-globals/node_modules/acorn/LICENSE" "licenseFile": "node_modules/acorn-globals/node_modules/acorn/LICENSE"
}, },
"acorn@8.12.1": { "acorn@8.13.0": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/acornjs/acorn", "repository": "https://github.com/acornjs/acorn",
"path": "node_modules/acorn", "path": "node_modules/acorn",
@ -127,7 +127,7 @@
"path": "node_modules/browser-process-hrtime", "path": "node_modules/browser-process-hrtime",
"licenseFile": "node_modules/browser-process-hrtime/LICENSE" "licenseFile": "node_modules/browser-process-hrtime/LICENSE"
}, },
"codemirror@5.65.17": { "codemirror@5.65.18": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/codemirror/CodeMirror", "repository": "https://github.com/codemirror/CodeMirror",
"publisher": "Marijn Haverbeke", "publisher": "Marijn Haverbeke",
@ -398,7 +398,7 @@
"path": "node_modules/data-urls", "path": "node_modules/data-urls",
"licenseFile": "node_modules/data-urls/LICENSE.txt" "licenseFile": "node_modules/data-urls/LICENSE.txt"
}, },
"debug@4.3.6": { "debug@4.3.7": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/debug-js/debug", "repository": "https://github.com/debug-js/debug",
"publisher": "Josh Junon", "publisher": "Josh Junon",
@ -474,7 +474,7 @@
"path": "node_modules/fabric", "path": "node_modules/fabric",
"licenseFile": "node_modules/fabric/LICENSE" "licenseFile": "node_modules/fabric/LICENSE"
}, },
"form-data@4.0.0": { "form-data@4.0.1": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/form-data/form-data", "repository": "https://github.com/form-data/form-data",
"publisher": "Felix Geisendörfer", "publisher": "Felix Geisendörfer",
@ -597,13 +597,13 @@
"path": "node_modules/mime-types", "path": "node_modules/mime-types",
"licenseFile": "node_modules/mime-types/LICENSE" "licenseFile": "node_modules/mime-types/LICENSE"
}, },
"ms@2.1.2": { "ms@2.1.3": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/zeit/ms", "repository": "https://github.com/vercel/ms",
"path": "node_modules/ms", "path": "node_modules/ms",
"licenseFile": "node_modules/ms/license.md" "licenseFile": "node_modules/ms/license.md"
}, },
"nwsapi@2.2.12": { "nwsapi@2.2.13": {
"licenses": "MIT", "licenses": "MIT",
"repository": "https://github.com/dperini/nwsapi", "repository": "https://github.com/dperini/nwsapi",
"publisher": "Diego Perini", "publisher": "Diego Perini",

View file

@ -17,6 +17,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let ctx: MapContext; export let ctx: MapContext;
let unusedMsg: string; let unusedMsg: string;
// svelte-ignore reactive_declaration_non_reactive_property
$: unusedMsg = $: unusedMsg =
ctx === MapContext.Field ctx === MapContext.Field
? tr.changeNotetypeWillDiscardContent() ? tr.changeNotetypeWillDiscardContent()

View file

@ -18,6 +18,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
$: info = state.info; $: info = state.info;
// svelte-ignore reactive_declaration_non_reactive_property
$: unused = $: unused =
$info.isCloze && ctx === MapContext.Template ? [] : $info.unusedItems(ctx); $info.isCloze && ctx === MapContext.Template ? [] : $info.unusedItems(ctx);
</script> </script>

View file

@ -38,6 +38,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const currentDeck = "\n\n" + tr.deckConfigDisplayOrderWillUseCurrentDeck(); const currentDeck = "\n\n" + tr.deckConfigDisplayOrderWillUseCurrentDeck();
let disabledNewSortOrders: number[] = []; let disabledNewSortOrders: number[] = [];
// svelte-ignore reactive_declaration_non_reactive_property
$: { $: {
switch ($config.newCardGatherPriority) { switch ($config.newCardGatherPriority) {
case GatherOrder.RANDOM_NOTES: case GatherOrder.RANDOM_NOTES:

View file

@ -51,6 +51,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
? tr.deckConfigGoodAboveEasy() ? tr.deckConfigGoodAboveEasy()
: ""; : "";
// svelte-ignore reactive_declaration_non_reactive_property
$: insertionOrderRandom = $: insertionOrderRandom =
$config.newCardInsertOrder == DeckConfig_Config_NewCardInsertOrder.RANDOM $config.newCardInsertOrder == DeckConfig_Config_NewCardInsertOrder.RANDOM
? tr.deckConfigNewInsertionOrderRandomWithV3() ? tr.deckConfigNewInsertionOrderRandomWithV3()

View file

@ -49,6 +49,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
); );
} }
// svelte-ignore reactive_declaration_non_reactive_property
$: { $: {
if (revlogRange < RevlogRange.Year) { if (revlogRange < RevlogRange.Year) {
minYear = maxYear; minYear = maxYear;

View file

@ -44,6 +44,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
} }
// svelte-ignore reactive_declaration_non_reactive_property
$: { $: {
switch (revlogRange as RevlogRange) { switch (revlogRange as RevlogRange) {
case RevlogRange.Year: case RevlogRange.Year:

875
yarn.lock

File diff suppressed because it is too large Load diff