*WIP* Feature Proposal Prototype Hono JS, Svelte, NextJs (Cloudflare Worker) ,Website SSR support using StarlingMonkey, Javy - #439
Open
dywongcloud wants to merge 26 commits into
Open
Conversation
added 6 commits
June 2, 2026 17:10
…ming tests A real Javy-compiled JS module rendered through Taubyte (static + dynamic + /api).
added 3 commits
June 2, 2026 21:08
… through the Taubyte Javy/QuickJS SSR adapter. This shims the Cloudflare Workers virtual module/runtime globals, passes a Workers-style env/context into fetch-mode apps, and validates dynamic SvelteKit server routes as runnable WASI modules. Static asset serving is currently stubbed via ASSETS and should be wired to Taubyte asset storage separately.
added 4 commits
June 3, 2026 13:15
…est, and Next.js next-on-pages support.
added 2 commits
June 15, 2026 21:11
…into feature/ssr-javy
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.
Adds a prototype SSR, /api and Svelte, NextJs and Hono adapter that compiles JavaScript and Hono request handlers into Javy/StarlingMonkey WASI modules, packaged as Taubyte SSR handler bundles and executed through the new wasi-stdio ABI.
Streaming, pooling, and env/KV bindings are committed
Adds experimental support for running SvelteKit Cloudflare SSR output through the Taubyte Javy/StarlingMonkey SSR adapter.
This shims the Cloudflare Workers virtual module/runtime globals, passes a Workers-style env/context into fetch-mode apps, and validates dynamic SvelteKit server routes as runnable WASI modules. Static asset serving is currently stubbed via ASSETS and should be wired to Taubyte asset storage separately.
SSR Javy Diagram
This also provides minimal runtime support for Bun and NodeJs
You can try expressjs , Bun.serve() (GET,POST) , need to test and add support for PATCH, DELETE, PUT
fetch)/apiserver routes (GET/POST,request.json())build.zipassembly (--site)cloudflare:workers,node:*shims, AsyncLocalStorageSummary
Adds end-to-end support for v8 JavaScript and others like NodeJs and Bun SSR server bundles on Taubyte through a Javy/StarlingMonkey + WASI-stdio execution path, with prototype support for Web-standard frameworks like Hono and the foundation for Next.js edge-style handlers.
This PR wires the SSR framework builder to emit
wasi-stdiomanifests, packages JS server handlers ashandler.wasm.zip, and updates the substrate website runtime path so SSR requests are normalized correctly before being passed into the WASI handler. It also adds a Javy-based adapter mode forapp.fetch(Request) -> Responseframeworks by injecting minimal Web API polyfills, plus optional Node-compat shims needed by Next.js-style bundles.What changed
Added a shim for the Cloudflare Workers virtual module:
cloudflare:workersAdded an esbuild alias so SvelteKit’s generated Cloudflare worker can resolve cloudflare:workers during bundling.
Added minimal Cloudflare runtime compatibility for:
Updated fetch-mode bridging so Cloudflare-style handlers receive:
SSR runtime and request path handling
cleanRequestPathhelper for SSR website requests./correctly instead of accidentally producing//./appby stripping the mount prefix before dispatching to the SSR handler.Framework builder integration
Marks JavaScript SSR framework manifests as
wasi-stdio, matching the Javy runtime model.Updates SSR generation to call the Taubyte SSR adapter to produce both:
__taubyte__/handler.wasm.zip__taubyte__/ssr.jsonEnsures the generated manifest is valid and parseable by the website runtime.
Keeps static generation behavior separate from SSR generation.
Next.js asset assembly fixes
Refactors zip assembly through a small de-duplicating
assetZiphelper.Normalizes zip paths to slash-separated clean paths.
Adds clean URL support for prerendered Next.js HTML by writing both:
about.htmlabout/index.htmlThis lets
/aboutresolve through the existing static directory-index lookup path.Keeps
index.htmlunchanged and avoids duplicate zip entries.Javy adapter improvements
Adds
--mode fetchfor Web-standard handlers that exposeapp.fetch(Request) -> Response, such as Hono.Keeps the existing plain JSON handler mode for lightweight polyfill-free handlers.
Embeds and injects a minimal Web API runtime for Javy/StarlingMonkey:
URLURLSearchParamsHeadersRequestResponseAdds
serveFetchdispatch in the shim to translate Taubyte’s WASI-stdio request envelope into a Web-standardRequest, then serialize theResponseback to stdout.Adds a runnable Hono example with static HTML, JSON API, route params, and POST body handling.
Async / event-loop support
Updates Javy compilation to prefer event-loop-enabled builds so async handlers and
app.fetch()promises drain before the module exits.Tries multiple Javy CLI variants for compatibility across versions:
javy build -J event-loop=ycompileAdds
TAUBYTE_JAVY_ARGSoverride support for custom local Javy invocations.Node compatibility shims
Adds optional
--nodemode to inject lightweight Node compatibility before the Web API polyfill and app bundle.Provides prototype shims for common edge-runtime expectations:
processglobalBufferqueueMicrotaskThis does not attempt full Node compatibility; it is intended as a bridge for edge-style SSR bundles.
End-to-end Hono runtime coverage
Adds a dreaming integration test for a real Hono server bundle running through the substrate SSR path.
Verifies:
/apiroute renderingIncludes fixture documentation for rebuilding the Hono
main.wasmbundle with the adapter.Validation
Tested the Hono Javy bundle directly with
wasmtime:Verified responses include:
{"status":200,"headers":{"content-type":"text/html; charset=UTF-8"},"body":"<h1>Hello from Hono on Taubyte</h1>"} {"status":200,"headers":{"content-type":"application/json"},"body":"{\"ok\":true,\"runtime\":\"javy\"}"} {"status":200,"headers":{"content-type":"application/json"},"body":"{\"youSent\":\"hi there\"}"}Also ran the dreaming integration test:
go test -tags dreaming -run TestWebsiteHono_Dreaming -v ./services/monkey/fixtures/compile/Result:
Notes / limitations
This is still prototype-level framework support. The Web API and Node shims target the common SSR path needed for Hono and edge-style handlers, not full WHATWG or Node conformance. Outbound
fetch, streams, filesystem, sockets, and broader Node APIs are intentionally not implemented here and should be added only as real framework requirements appear.