Repository navigation
feat: frontends option for languages that lower to Solid, with .rx built in - #471
Merged
Merged
Conversation
A front end claims a file extension and compiles its modules itself:
compile(source, { id, ssr, root, solid, addWatchFile }) returns
{ code, map, css }, given the compiler options a JSX module would get in
that environment. The module then takes the lowered .tsrx route: lazy and
refresh passes, server functions keyed by the real module path, css as a
CSS module, dep scanning.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq
🦋 Changeset detectedLatest commit: b8cc5fe The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
A front end that imports its own modules under a query (ReactiveScript compiles `./x.rx?rx-dep` as a dependency, a plain `x.rx` as a program entry) needs the query; `id` stays the clean file path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq
ryansolid
pushed a commit
to ryansolid/reactivescript
that referenced
this pull request
Oct 27, 2026
…lain solid() - The crate's Node-API build (`--features node`, src/node.rs) over `app`, now a library function (src/app.rs) that `rxc app` also calls; a missing entry is an error instead of an empty program. - package.json for @reactivescript/compiler: one binary per platform (npm/*, as @solidjs/compiler ships), the napi loader, and the Vite front end at `/vite` (moved from vite-plugin-rx/, now calling the binding instead of spawning rxc). Solid's plugin loads it on its own (solidjs/solid-vite-plugin#471), so the examples build with `solid()`. - .github/workflows/compiler.yml: build and test each platform; on main, publish a new version by trusted publishing and tag compiler-v<version>. - spec/11: the Vite paragraph, and decision 7 (taken by default). Tests: npm test (binding, every target); compiler/test/vite.mjs 14 pass on plain solid(); crate conformance 280/280. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq
`.rx` (ReactiveScript) compiles with no option when the project has `@reactivescript/compiler`: its `/vite` front end is resolved from the project root the first time an `.rx` module is compiled, so a project without `.rx` files never loads it. A missing package fails the module with an install hint (and is retried, so installing it fixes a running server). A `.rx` entry in `frontends` replaces the built-in one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq
This was referenced Oct 27, 2026
Merged
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 adds a
frontendsoption. A language that lowers to Solid can claim a file extension and compile its own modules:.rx(ReactiveScript) is built in. If the project has@reactivescript/compilerinstalled,.rxmodules compile with plainsolid().@reactivescript/compiler/vitefrom the project root the first time it meets an.rxmodule. A project without.rxfiles never loads it..rxmodule, so installing the package fixes a running server..rxentry infrontendsreplaces the built-in one.A front end implements
compile(source, { id, moduleId, ssr, root, solid, addWatchFile })and returns{ code, map?, css? }, ornullto pass the module through.idis the file path.moduleIdis the full id with its query, so a front end that imports its own modules under a query (e.g../x.rx?rx-dep) can tell the forms apart.solidholds the compiler options this plugin would use for a JSX module in that environment (generate,hydratable,moduleName,dev, …), so a front end that ends in@solidjs/compilercompiles the same way.The result then takes the lowered
.tsrxroute:cssas a CSS module (?solid-tsrx-css), including on hot update;optimizeDeps.extensions);Solid's own extensions can't be claimed. Today
extensionsparses its files as JSX text, which a language with its own syntax can't use, and.tsrxis routed by name.What changed:
src/index.ts: the types, validation and routing, and the lazily loaded built-in.rx.src/server-functions/index.ts: front-end extensions are included, and lowered modules are handled after Solid's pass.src/tsrx.ts: the CSS query alone identifies the stylesheet module.Dependency: server functions in front-end modules need solidjs/solid#4320, which is merged and will ship in the next compiler release. That test is skipped until then (the
directivesTakeAnyExtension()probe).Testing
src/frontends.test.tsuses a.fefront end. It covers:moduleId;addWatchFile;.tsx;.rx, against a stub@reactivescript/compilerin a temp project, plus the install hint when the package is missing. 10/10 pass.tsc --noEmitis clean.@reactivescript/compiler(a Node-API build of ReactiveScript's compiler, Rust crate: front half, resolved model (CP-6), lowering through compile_program, and @reactivescript/compiler ryansolid/reactivescript#6) builds all 12 example apps through plainsolid()with Vite 8.🤖 Generated with Claude Code
https://claude.ai/code/session_0117BoWMdD4K7882vob4J9vq