Conversation
Move the duplicated Vite-under-Elysia host out of both TanStack apps. viteDev() is middlewareMode through connect with SSR via the environment runner; viteProd() walks dist/client once and mounts the built handler. The prod handler import stays a literal path so bun build can inline it. Co-authored-by: Tomasz Kielar <k1eu@users.noreply.github.com>
Deploying typeway with
|
| Latest commit: |
44fb5e4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0b635be4.typeway.pages.dev |
| Branch Preview URL: | https://cursor-extract-typeway-vite.typeway.pages.dev |
Bun.file MIME and HEAD body stripping show up on the real socket, not through Elysia's app.handle(). Unit tests keep the routing contract; integration covers Content-Type on hashed assets and prerendered HTML. Co-authored-by: Tomasz Kielar <k1eu@users.noreply.github.com>
Re-exporting viteDev from the package root pulled Vite (and rolldown native bindings) into dist/app. Prod boots import @typeway/vite/prod; dev boots import @typeway/vite/dev. A unit test builds the prod entry and asserts the bundle mentions neither createServer nor rolldown. Co-authored-by: Tomasz Kielar <k1eu@users.noreply.github.com>
k1eu
marked this pull request as ready for review
August 26, 2026 19:37
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.
Plans 01–03 (integration smoke, TanStack feature coverage, benches) are already on main. The root README’s named next step after those was extracting the host glue so app servers are a few lines, not 50+ of Vite-under-Elysia copied between two apps.
This adds
@typeway/vite:viteDev()from@typeway/vite/dev— VitemiddlewareModethrough@typeway/connect, TanStack SSR viaenvironments.ssr.runner.import()(notssrLoadModule). Extra Connect middleware (e2e bridge probes) andHMR_PORTare options.viteProd({ handler })from@typeway/vite/prod— boot-timedist/clientmanifest as real Elysia routes (including clean URLs for prerenderedindex.html), then.mount()of the built fetch handler. Missingdist/clientfails at boot.The two entry points are load-bearing. A shared barrel re-export of
viteDevpullsvite(and rolldown native bindings) into the prodbun buildofdist/app. The prod handler import stays a literal./dist/server/server.jsso that build can inline it.src/server.tsremains the SSR entry name.Both
apps/playground-with-tanstackandapps/e2e-tanstacknow compose as.use(backend).use(await viteDev())/.use(await viteProd({ handler })). The connect package stays the eject hatch.Tests (local)
bun test packages/— 22 pass (connect + viteProd routing + abun buildguard that the prod entry mentions neithercreateServernor rolldown)bun run test:integration— 20 pass (dev + prod, including SSG clean URLs and Better Auth)bun run test:e2e-tanstack— 26 pass (dev + prod)