example(document): replace mocket with moonback - #170
Merged
Conversation
`oboard/mocket` was the last mocket user in the repo and no longer builds: `@async/http` moved to `CaseInsensitiveString` headers, so `mocket.native.mbt` fails to check. `hackwaly/moonback` is already the server library behind `rabbita/server`, so the example now goes through that instead of a second HTTP stack. moonback is native+wasm only, so the single `main` package had to split into the layout warren already expects: app/ the shared component, js+native+wasm main/ browser entry, hydrates the server-rendered document cmd/server/ server entry, native+wasm `cmd/server` registers `/issues` as a `@moonback.Module` and hands it to `@rabbita_server.Server`, which supplies the page route and the static middleware — replacing the hand-rolled `/assets/index.js` and `/assets/styles.css` handlers. Assets move to `/index.js` and `/styles.css` to match the head that `page_service` injects, so the component no longer writes its own `<script>` tag. This is the first in-repo consumer of `rabbita/server`. Verified running, not just checking: `/` returns the full SSR document with `data-theme`, `<title>`, and a `__rabbita_transcript` that already carries the `/issues` payload, so `create_resource` resolves during SSR rather than refetching after hydration. `/issues`, `/index.js`, and `/styles.css` all serve correctly, and `warren dev --browser-entry main --server-target native` picks up `cmd/server` and injects the reload client. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmoyPMELemz5hdNNdXyAkm
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.
oboard/mocketwas the last mocket user in the repo, and it no longer builds:@async/httpmoved toCaseInsensitiveStringheaders, somocket.native.mbtfails to check.hackwaly/moonbackis already the server library behindrabbita/server, so the example now goes through that rather than carrying a second HTTP stack.Layout
moonback is native+wasm only, so the single
mainpackage (which used#cfg(target=...)to be both the browser entry and the server) had to split into the layout warren already expects:app/main/cmd/server/cmd/serverregisters/issuesas a@moonback.Moduleand hands it to@rabbita_server.Server, which supplies the page route and the static middleware. That replaces the hand-rolled/assets/index.jsand/assets/styles.csshandlers, so the server entry is ~25 lines. Assets move to/index.jsand/styles.cssto match the headpage_serviceinjects, and the component no longer writes its own<script>tag.This is the first in-repo consumer of
rabbita/server.Verification
Checked on js, native, and wasm — and actually run, not just checked:
The transcript is the interesting one:
create_resourceresolves/issuesduring SSR, so the list is in the response document instead of being refetched after hydration.warren dev --browser-entry main --server-target nativealso works — warren picks upcmd/serveras the server entry and injects the live-reload client throughWARREN_CLIENT.The example's
rabbitadependency was pinned at0.12.2; bumped to0.15.5to match the repo.🤖 Generated with Claude Code
https://claude.ai/code/session_01AmoyPMELemz5hdNNdXyAkm