Conversation
- Upgrade to @sveltejs/kit 3.0.0-next.27, adapter-cloudflare 8.0.0-next.7, Vite 8, vite-plugin-svelte 7, TypeScript 6, and Vitest 5. - Move kit config into vite.config.ts, replace $lib with #lib subpath imports, extend $app/tsconfig, and declare env vars in src/env.ts. - Select the database driver at build time through the #db subpath import: the atlantis-d1 condition resolves the D1 driver (cloudflare:workers), the default resolves the SQLite driver. Routes no longer thread platform. - Pair D1 with adapter-cloudflare and SQLite with no adapter, so plain dev never starts workerd and SQLite builds never overwrite the worker output. - Patch runed useSearchParams to use the kit 3 goto options. - Build a SQLite bundle inside the Playwright web server and run Node 24 in the nix shell to meet the kit 3 Node minimum.
Read dashboard filters from page.url through the zod schema, keep the group-by clamp derived, and write the URL only from event handlers via goto with SvelteKit 3 options. Drop runed and its goto patch.
flamboh
added this pull request to stack #118
September 25, 2026 10:46
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
🤖 Claude Opus 5.5 on behalf of Oliver. This moves the dashboard to a prerelease SvelteKit (
3.0.0-next.27). That is intentional.ELI5
This moves the dashboard to the next major version of its web framework. It also picks the database (a local SQLite file or Cloudflare D1) when the app is built, instead of on every request.
Why
Alchemy's SvelteKit support needs kit ≥
3.0.0-next.27and Vite 7 or 8. SvelteKit 3 also removesplatform.envon Cloudflare, so D1 has to come fromcloudflare:workers. That module can't be imported in a Node build, so the runtimeplatform?.env.DBcheck had to go.Implementation
3.0.0-next.27and adapter-cloudflare8.0.0-next.7, pinned exactly.vite-plugin-svelte7, TypeScript 6 and vitest 5.shell.nixand.node-version, because kit 3 needs Node ≥ 22.17 and nixpkgs only has 22.16. The Node version pins across the stack are reconciled in feat(infra): add self-hosted container stack #117.svelte.config.jsis gone. Its settings now live insveltekit({...})invite.config.ts.$libimports are now#libsubpath imports with file extensions, and env vars come from$app/env/private.#dbresolves todb/d1.tsunder a customatlantis-d1condition, and todb/sqlite.tsotherwise.ATLANTIS_DB_DRIVERis read only from the shell, never from.env. A stray.envvalue can't turn a deploy build into a SQLite worker.vite builddefaults to D1 andvite devto SQLite. Routes no longer receiveplatform.page.urlthrough the zod schema. All writes go through oneupdateSearch()called from event handlers, usinggoto(…, { reset: false }). The group-by clamp is a$derived, and URL sync no longer writes state from an effect.{ groupBy, startDate, endDate }payload. The page applies it in a singleupdateSearch(). Previously the new group-by was sent before the new dates, so it was clamped against the old range.Supported build and preview pairs
vite previewruns the server in Node, so it can only serve the SQLite build.bun run dev:webATLANTIS_DB_DRIVER=d1 bun run dev:webbun run --cwd apps/web previewvite previewbun run build:web, thencd apps/web && bunx wrangler devvite previewalso ignoresATLANTIS_DB_DRIVERand always resolves SQLite. Runningbuild:weband thenpreviewused to load the Cloudflare bundle in Node and return 500. It now works.Flows to exercise
Setup: a local SQLite dataset covering at least 90 days, with daily rows.
/datasets/<id>?startDate=2025-01-01&endDate=2025-03-31&groupBy=dateand click a daily point.groupBy=hour./api/netflow/statsrequest hasgroupBy=hour.groupBystayed atdate.groupBy=hourin the URL./api/ip/stats(or protocol/spectrum) request hasgranularity=1h.bun run build:web, thenbun run --cwd apps/web preview.bun run dev:web.Edge cases and decisions
groupByis no longer rewritten on load. The clamped value is shown, and the URL is corrected on the next filter change. The old effect pushed an extra history entry.previewalways builds before serving, so it is slower than a barevite preview. In exchange, it can't serve a stale or mismatched build.components.jsonstill generates$libimports. Fix them by hand when adding components.Verification
Automated (all pass):
bun run format,lint,typecheckandtest:web.bun run test:e2e(8 tests). It includes the newdashboard-drilldown.spec.ts, which checks both the URLgroupByand the API granularity for Traffic Overview and the IP breakdown. Both tests fail without the fix.preview, so every e2e run covers build → preview. With the oldpreviewscript, all 8 tests fail.build:web, which the e2e web server runs.Checked manually on this branch before the fixes:
better-sqlite3, and the Node build contains nocloudflare:workers.wrangler devreturns 200.Remaining manual checks:
wrangler devagainst local D1 afterbuild:web.Claude Opus 5.5 · Claude Code (T3 Code)