From bf46a5f08cea200dd5353066acebec030b33c816 Mon Sep 17 00:00:00 2001 From: Abdo Date: Wed, 25 Sep 2024 11:49:07 +0300 Subject: [PATCH] Update to Svelte 5 (#3292) * Update to Svelte 5 * Fix ` is invalid inside ` * Update sveltekit-svg to match svelte version Fixes deck options failing to load, and a bunch of warnings with ./yarn dev * Fix graph tooltips * Fix editor loading * Fix MathJax editor not loading * Formatting * Fix new formatting errors * Merge remote-tracking branch 'origin/main' into svelte5 * Remove slot inside EditorToolbar I think this is just stray code left over from a refactor, but I'm not 100% sure. Fixes Error: Object literal may only specify known properties, and 'children' does not exist in type '{ size: number; wrap: boolean; api?: Partial | undefined; }'. (ts)
* Fix component typing error * Comment out svelte/internal exports, so editor loads * Fix image occlusions in editor * Revert "Remove slot inside EditorToolbar" This reverts commit b3095e07ac046a56706e94b8af1e823a25cf5826, which prevented the Preview button from showing in the browser. This will break our tests again. * Update vite * Disable routes/tmp for now * Fix references issue in routes/tmp --- package.json | 14 +- ts/editable/ContentEditable.svelte | 2 +- ts/editable/mathjax-element.ts | 5 +- ts/editor/CodeMirror.svelte | 2 +- ts/editor/HandleBackground.svelte | 2 +- ts/editor/HandleControl.svelte | 10 +- ts/editor/NoteEditor.svelte | 2 +- ts/editor/base.ts | 19 +- .../mathjax-overlay/MathjaxEditor.svelte | 9 +- .../rich-text-input/RichTextInput.svelte | 11 +- .../rich-text-input/RichTextStyles.svelte | 6 +- .../BackendProgressIndicator.svelte | 8 +- ts/lib/components/Collapsible.svelte | 2 +- ts/lib/components/FloatingArrow.svelte | 2 +- ts/lib/components/HelpModal.svelte | 2 +- ts/lib/components/Icon.svelte | 10 +- ts/lib/components/ScrollArea.svelte | 16 +- ts/lib/components/Spacer.svelte | 2 +- ts/lib/components/VirtualTable.svelte | 4 +- ts/lib/components/types.ts | 3 - ts/lib/sveltelib/export-runtime.ts | 8 +- ts/routes/card-info/CardStats.svelte | 14 +- .../deck-options/CardStateCustomizer.svelte | 2 +- ts/routes/deck-options/TextInputModal.svelte | 2 +- ts/routes/deck-options/WeightsInput.svelte | 2 +- ts/routes/graphs/CardCounts.svelte | 34 +- ts/routes/graphs/GraphsPage.svelte | 2 +- ts/routes/graphs/RangeBox.svelte | 2 +- ts/routes/graphs/TableData.svelte | 14 +- ts/routes/graphs/buttons.ts | 2 +- ts/routes/graphs/calendar.ts | 2 +- ts/routes/graphs/histogram-graph.ts | 2 +- ts/routes/graphs/hours.ts | 2 +- ts/routes/graphs/reviews.ts | 2 +- ts/routes/graphs/simulator.ts | 3 +- .../{tooltip.ts => tooltip-utils.svelte.ts} | 33 +- ts/routes/image-occlusion/MaskEditor.svelte | 2 +- ts/routes/image-occlusion/Notes.svelte | 4 +- ts/routes/image-occlusion/StickyFooter.svelte | 2 +- ts/routes/import-csv/Preview.svelte | 24 +- ts/routes/import-page/DetailsTable.svelte | 2 +- ts/routes/tmp/{+page.ts => _page.ts} | 0 yarn.lock | 619 +++++++++--------- 43 files changed, 475 insertions(+), 435 deletions(-) rename ts/routes/graphs/{tooltip.ts => tooltip-utils.svelte.ts} (51%) rename ts/routes/tmp/{+page.ts => _page.ts} (100%) diff --git a/package.json b/package.json index b4c803c93..490449e32 100644 --- a/package.json +++ b/package.json @@ -16,11 +16,11 @@ }, "devDependencies": { "@bufbuild/protoc-gen-es": "^1.8.0", - "@poppanator/sveltekit-svg": "^4.2.1", + "@poppanator/sveltekit-svg": "^5.0.0-svelte5.5", "@sqltools/formatter": "^1.2.2", "@sveltejs/adapter-static": "^3.0.0", "@sveltejs/kit": "^2.4.1", - "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@sveltejs/vite-plugin-svelte": "4.0.0-next.7", "@types/bootstrap": "^5.0.12", "@types/codemirror": "^5.60.0", "@types/d3": "^7.0.0", @@ -39,15 +39,15 @@ "dprint": "^0.47.2", "esbuild": "^0.18.10", "esbuild-sass-plugin": "^2", - "esbuild-svelte": "^0.7.4", + "esbuild-svelte": "^0.8.1", "eslint": "^8.44.0", "eslint-plugin-compat": "^4.1.4", "eslint-plugin-import": "^2.25.4", "eslint-plugin-svelte": "^2", "license-checker-rseidelsohn": "=4.3.0", "prettier": "^2.4.1", - "prettier-plugin-svelte": "^2.10.1", - "svelte": "^4.0.1", + "prettier-plugin-svelte": "^3.2.6", + "svelte": "5.0.0-next.179", "svelte-check": "^3.4.4", "svelte-preprocess": "^5.0.4", "svelte-preprocess-esbuild": "^3.0.1", @@ -55,7 +55,7 @@ "tslib": "^2.0.3", "tsx": "^3.12.0", "typescript": "^5.0.4", - "vite": "=5.0.13", + "vite": "=5.4.7", "vitest": "^1.2.1" }, "dependencies": { @@ -80,7 +80,7 @@ }, "resolutions": { "canvas": "npm:empty-npm-package", - "vite": "=5.0.13" + "vite": "=5.4.7" }, "browserslist": [ "defaults", diff --git a/ts/editable/ContentEditable.svelte b/ts/editable/ContentEditable.svelte index e5ba95251..9b1b4f056 100644 --- a/ts/editable/ContentEditable.svelte +++ b/ts/editable/ContentEditable.svelte @@ -54,7 +54,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html on:blur on:click={updateAllState} on:keyup={updateAllState} -/> +>