Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Upgrades the Desktop app’s Vite/SvelteKit toolchain to Vite 8 and adjusts Vite/Svelte preprocessing and dependency optimization to work around Vite 8/Rolldown regressions (notably around CJS interop and Svelte preprocessing of node_modules).
Changes:
- Bump Vite to 8.0.0 and update SvelteKit / vite-plugin-svelte versions in the workspace catalog.
- Update Desktop Vite/Svelte config to avoid new Vite 8 + tooling pitfalls (dependency optimization, preprocessing, CSS handling for node_modules).
- Adjust redux-persist integration and a Svelte component store access pattern for compatibility.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Updates catalog versions for Vite and Svelte tooling. |
| package.json | Adds a pnpm override to force Vite 8.0.0 resolution. |
| apps/desktop/vite.config.ts | Updates optimizeDeps handling for svelte-lexical/Lexical and removes manualChunks config. |
| apps/desktop/svelte.config.js | Filters TS preprocessing for node_modules and injects CSS for node_modules Svelte files. |
| apps/desktop/src/lib/state/clientState.svelte.ts | Changes redux-persist imports and replaces lib/storage with an inline localStorage wrapper. |
| apps/desktop/src/components/PrTemplateSection.svelte | Switches to get(store) instead of using $store in script logic (Svelte 5 runes compatibility). |
| "@lexical/dragon", | ||
| "@lexical/extension", |
There was a problem hiding this comment.
optimizeDeps.include lists @lexical/dragon and @lexical/extension, but these packages don’t appear to be installed (no entries in pnpm-lock.yaml). With Vite, unresolved entries in optimizeDeps.include typically fail dependency optimization / dev server startup. Remove the non-existent entries, or add them as explicit dependencies (and pin via overrides/catalog) so they resolve consistently.
| "@lexical/dragon", | |
| "@lexical/extension", |
fcb0503 to
8ebe295
Compare
8ebe295 to
3c0353a
Compare
| getItem: (key: string) => Promise.resolve(localStorage.getItem(key)), | ||
| setItem: (key: string, value: string) => Promise.resolve(localStorage.setItem(key, value)), | ||
| removeItem: (key: string) => Promise.resolve(localStorage.removeItem(key)), |
There was a problem hiding this comment.
The inline redux-persist storage wrapper calls localStorage.* inside Promise.resolve(...), which will throw synchronously if access fails (e.g., storage disabled/quota exceeded) instead of returning a rejected promise. Wrap the localStorage operations in try/catch (or use an async function) so failures are surfaced as promise rejections and don’t crash store initialization.
| getItem: (key: string) => Promise.resolve(localStorage.getItem(key)), | |
| setItem: (key: string, value: string) => Promise.resolve(localStorage.setItem(key, value)), | |
| removeItem: (key: string) => Promise.resolve(localStorage.removeItem(key)), | |
| getItem: async (key: string) => { | |
| return localStorage.getItem(key); | |
| }, | |
| setItem: async (key: string, value: string) => { | |
| localStorage.setItem(key, value); | |
| }, | |
| removeItem: async (key: string) => { | |
| localStorage.removeItem(key); | |
| }, |
| optimizeDeps: { | ||
| // Exclude local packages from pre-bundling | ||
| exclude: ["@gitbutler/core", "@gitbutler/ui", "@gitbutler/shared"], | ||
| // Force pre-bundling of lexical packages — they all use process.env.NODE_ENV |
There was a problem hiding this comment.
PR description mentions excluding svelte-lexical from Vite pre-bundling, but optimizeDeps.exclude here only lists the local @gitbutler packages. If svelte-lexical still needs to be excluded for Vite 8, add it to optimizeDeps.exclude; otherwise update the PR description to match the actual behavior.
3c0353a to
10a4f4c
Compare
10a4f4c to
496416c
Compare
496416c to
3dfdf27
Compare
3dfdf27 to
bbd150c
Compare
bbd150c to
d755435
Compare
d755435 to
16e30a7
Compare
16e30a7 to
d637c03
Compare
d637c03 to
8eee90b
Compare
8eee90b to
0556734
Compare
0556734 to
825cc00
Compare
825cc00 to
4f606a5
Compare
4f606a5 to
0bed009
Compare
0bed009 to
ab2da60
Compare
ab2da60 to
9e16233
Compare
9e16233 to
e9df533
Compare
e9df533 to
d309014
Compare
Upgrade core build tooling: - Vite 6.4.1 → 8.0.0 (via pnpm override + catalog) - @sveltejs/kit 2.52.2 → 2.55.0 - @sveltejs/vite-plugin-svelte 6.2.4 → 7.0.0 Fix Vite 8 compatibility issues: - Change build target from "modules" (unsupported by Rolldown) to "es2021" - Remove empty manualChunks config (no longer needed) - Add explicit optimizeDeps.include for all lexical packages — Vite 8 no longer auto-handles process.env.NODE_ENV for transitive deps of excluded packages - Filter vitePreprocess to skip node_modules scripts — transformWithOxc strips cross-block imports (e.g. <script module> using <script> values) - Add style preprocessor to strip @import rules from node_modules — Svelte 5's CSS parser rejects @import inside :global {} blocks - Use css: "injected" for node_modules via dynamicCompileOptions - Remove deprecated scss preprocessorOptions from apps/web - Add HotUpdateOptions type annotation for Vite 8 API change - Add prismjs as explicit dependency and import in test setup — @lexical/code requires globalThis.Prism Improve E2E blackbox test diagnostics: - Set E2E_TEST_APP_DATA_DIR to absolute path so Tauri logs are findable - Upload GitButler backend logs, videos, and browser console logs as separate artifacts on test failure - Capture browser console logs via getLogs("browser") on test failure - Fix video recording path (remove extra /e2e/ prefix) - Increase debounce reload delay from 5s to 8s for package changes
d309014 to
b89bd85
Compare
Summary
@sveltejs/kit2.52.2 → 2.55.0, and@sveltejs/vite-plugin-svelte6.2.4 → 7.0.0redux-persist: importspersistStorefrom the main ESM entry and replaces thelib/storageimport with an inlinelocalStoragewrappercreateCommand) from being strippedcss: "injected"for node_modules Svelte files to avoid PostCSS issuessvelte-lexicalfrom pre-bundling and explicitly includes all@lexical/*packages (Vite 8 no longer auto-handlesprocess.env.NODE_ENVfor transitive deps of excluded packages)manualChunksrollup option (Rolldown replaces Rollup in Vite 8)PrTemplateSection.svelteto useget(path)instead of a top-level$storesubscription (required by Svelte 5 runes mode)Test plan
pnpm devstarts without errors inapps/desktopsvelte-lexical) works withoutcreateCommandreference errors🤖 Generated with Claude Code