feat: add svelte-shaker support and remove routes.ts convention in favor of single index.ts#74
Merged
Conversation
Contributor
Mochi review reportTry this PRExpand instructionsgh run download -R khromov/mochi 27104728073 -n mochi-framework-pr -D /tmp/mochi-pr && bun i /tmp/mochi-pr/mochi-framework-pr.tgzDependency reportExpand reportLines of codepackages/mochi
Unchanged: packages/docs
packages/site
Unchanged: packages/demos
Unchanged: packages/minimal
packages/cli
Unchanged: |
Shorter option name. Also adds a required `enabled: boolean` field to MochiSvelteShakerOptions so the optimizer can be toggled on/off in object form without discarding exclude/report config.
Merged
khromov
pushed a commit
that referenced
this pull request
Jun 7, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>mochi-framework: 0.6.0</summary> ## [0.6.0](mochi-framework-v0.5.1...mochi-framework-v0.6.0) (2026-06-07) ### Features * add svelte-shaker support and remove routes.ts convention in favor of single index.ts ([#74](#74)) ([ec4487f](ec4487f)) * added a new "info" tab to debug bar showing runtime versions and mochi configuration ([a6a1792](a6a1792)) ### Bug Fixes * **mochi-framework:** various hmr edge case fixes ([ecb627d](ecb627d)) * trigger hmr when shell.html is edited ([#72](#72)) ([d519b89](d519b89)) * various hmr edge case fixes ([79048e3](79048e3)) </details> <details><summary>create-mochi: 0.2.4</summary> ## [0.2.4](create-mochi-v0.2.3...create-mochi-v0.2.4) (2026-06-07) ### Bug Fixes * **mochi-framework:** various hmr edge case fixes ([ecb627d](ecb627d)) * various hmr edge case fixes ([79048e3](79048e3)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Summary
This PR has two themes: svelte-shaker integration and removing the
routes.tsconvention in favor of a singleindex.tsentry as the source of truth.svelte-shaker support
optimizeWithSvelteShaker?: boolean | { exclude?: string[]; report?: boolean }toMochi.serve()andMochiBuildOptionssvelte-shaker/node) — no Vite/Rollup plugin host needed.sveltesource via prop folding, dead-branch removal, and CSS narrowing before the Svelte compiler runsexcludeglobs let callers opt specific components out of shaking (safe: they still count as call sites for others)reportlogs a per-component size breakdown at build time (scanned vs slimmed counts)packages/docs/177-svelte-shaker.md; unit tests insvelteShaker.test.tsandComponentRegistry.shake*.test.tsSingle
index.tsentry — drop theroutes.tsconventionMochi.serve()call via the newextractServeOptions(a capturingserve()stub), so the prebuilt manifest stays single-sourced with the runtime--routesCLI flag and therouteModuleserve option / auto-discovery of./src/routes.tsextractServeOptionsand hot-swaps handlers in place — no restart, no special route moduleroute-modulerecompile trigger renamed toentryindex.ts;packages/demos/src/routes.tsandpackages/minimal/src/routes.tsdeleted,packages/siteroutes split intosrc/routes.tsimported byindex.tspackages/docs/updated to the single-entry pattern