Free Studio from Bundle dependency (#88) - #113
Draft
nounder wants to merge 1 commit into
Draft
Conversation
Studio's HTML wrapper resolved 'effect-start/datastar' via the generic Bundle context, so any app mounting Studio had to also configure a Bundle layer (esbuild/rolldown/BunBundle) just to get a working page. Bundle src/datastar/ into src/studio/internal/DatastarClient.ts ahead of time (scripts/build-datastar-client) and serve it from a dedicated Studio route (/_datastar.js), protected by the same basic-auth middleware as the rest of Studio. Studio no longer touches Bundle.Bundle at all. - scripts/build-datastar-client: one-time bundling step (Bun.build), checked into git via src/studio/internal/DatastarClient.ts - test/datastar/DatastarClient.test.ts: guards against the generated file drifting from src/datastar/ - test/studio/routes.test.tsx: drops the Bundle layer from the test harness, adds coverage for the new /_datastar.js route - drop the now-unnecessary BunBundle layer from the OTLP capture fixture Co-authored-by: Ralph Gutkowski <nounder@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.
Fixes #88
Summary
Studio required a Bundle layer just to resolve the datastar client script. It now serves a prebuilt JS artifact directly, so Studio no longer depends on Bundle.
Changes
DatastarClientESM string/_datastar.jsroute (auth-protected) replacesbundle.resolve(...)src/datastar/Test plan
bun test test/studio/routes.test.tsx test/datastar/DatastarClient.test.ts