Repository navigation
Conversation
app::app_with takes a reader in place of the disk, so serve.rs can build a program from the editor's files. With jsx: true each module also carries the JSX handed to Solid's compiler (emit::view_jsx).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The recovering parse reads a missing statement as an empty one without advancing, so parse_block looped until it found a closing brace. A half-typed handler like `onClick={() => { c` made analyze take 8 to 27 seconds.
… http The page shows its header and editor while rxc.wasm downloads, the wasm is stripped (5.5 to 4.8 MB), compiled while streaming and retried on a cut-off download, and Share falls back to the copy command where the Clipboard API is missing.
The playground shows only diagnostics from analyze, so it now passes project: false; analyze per keystroke goes from 0.16 to 0.09 ms once warm.
This branch has not been deployed
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.
A browser playground for learning what ReactiveScript compiles to: type
.rxon the left, and the right side shows the same program written with Solid 2.0's own primitives (createSignal,createMemo,createOptimistic,createProjection,action,<Errored>,<Loading>), with the checker's diagnostics underneath. Work in progress; it is not deployed.Compiler change
The language server's WebAssembly build (
src/wasm.rs) already answersanalyzeandpreludeover a hostrx_read, so it can run from memory in a browser. It could not compile, becauseapp::appreads the program from disk. Two small changes make it possible:app::app_withtakes a reader in place of the disk;app::app(the Node-API build andrxc app) calls it withread_diskand behaves as before.serve.rsanswers anapprequest ({entry, overlays, target, moduleName, spa, jsx}) through it. Withjsx: true, each module also carries the JSX handed to Solid's compiler, printed by the newemit::view_jsxoveroxc_codegen(already in the lockfile throughsolidjs-compiler, now a direct dependency).analyzetakesproject: falseto return diagnostics without building the TSX projection, which the playground does not show. Leaving it out keeps the language server's behaviour.The playground also turned up a parser bug that the language server shares: the recovering parse read a missing statement as an empty one without advancing, so
parse_blockspun on an unclosed{at the end of input. A half-typed handler such asonClick={() => { cmadeanalyzetake 8 to 27 seconds.parse_blocknow stops when a pass reads nothing, and the missing}is an ordinary parse error.The napi
wasm32-wasibrowser build was the other candidate, but its WASI has no filesystem, soapp(entry)cannot read sources there.Playground (
site/playground/)A Vite + Solid rc.21 app. Each keystroke runs
analyze(withproject: false) for diagnostics andappwithjsx: truefor the program, under 1 ms per keystroke once the compiler is warm. The page renders beforerxc.wasmarrives; the wasm is built with symbols stripped (4.8 MB), compiled while it streams, and retried if the download is cut off. The JSX is formatted with Prettier, thensrc/solidify.tswrites each__rthelper that is a Solid primitive underneath (spec/11 CP-4b,@reactivescript/runtime) as that primitive and strips the mangled names (v$id,w$idbecomeid,setId). This view is a reading aid, not the code that runs. Explain notes name the.rxform behind each line. The program is kept in the URL hash.site/.assetsignoreleavesplayground/out of the static site upload, so deploying reactivescript.dev is unchanged.public/rxc.wasmis built bypnpm wasmand not checked in.Verification
cargo check --manifest-path compiler/Cargo.toml --all-targetscargo test --release --manifest-path compiler/Cargo.toml, including the newan_unclosed_block_at_the_end_of_input_stops.analyzeandapp: the slowest step takes 14 ms.site/playground:pnpm wasm,npx tsc -p .,pnpm build, andpnpm testwithpnpm devrunning: 11 Playwright checks covering the featuredawaitlowering, Explain notes, stores, a rest prop asomit, keyed and draft projections, live updates,WRITE_TO_NON_SOURCEwith its rule and guide link, every example, the URL hash, a two-module program, and no page errors.==rewrite, renames inside string literals, store reads scoped to their declaring block, two-module formatting, the URL after adding a file, and others).Open
wasm32-unknown-unknowntarget (theeditor.ymlworkflow already builds it) and Vite'sbase: "/playground/".createMemo(() => props.x === undefined ? d : props.x)rather thanmerge:mergekeeps an explicitundefined, while 07 §5 applies defaults onundefined.🤖 Generated with Claude Code