@rsvelte/compiler 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -1
- package/package.json +1 -1
- package/svelte_compiler_rust_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -168,6 +168,27 @@ println!("{}", result.js.code);
|
|
|
168
168
|
|
|
169
169
|
The Rust API is the same surface OXC will eventually wire `oxlint` / `oxfmt` into. Unlike the JS surface, the Rust `CompileOptions` honours **every** field — including `css_hash` and `warning_filter` as real Rust closures.
|
|
170
170
|
|
|
171
|
+
### Call from C / Go / PHP / Ruby / Zig / Java / …
|
|
172
|
+
|
|
173
|
+
A `cdylib` exposing a stable C ABI ships in [`crates/rsvelte_capi`](crates/rsvelte_capi). One shared library + one cbindgen-generated header (`rsvelte.h`) lets any language with a C FFI drive the same compiler — UTF-8 JSON in, UTF-8 JSON out, no per-language schema generation.
|
|
174
|
+
|
|
175
|
+
**Download prebuilt binaries** from [GitHub Releases](https://github.com/baseballyama/rsvelte/releases) under the `capi-vX.Y.Z` tag scheme (`darwin-{arm64,x64}`, `linux-{x64,arm64}-gnu`, `win32-x64-msvc`; each archive ships the dylib + static archive + `rsvelte.h` + checksums):
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
VERSION=0.1.1 TRIPLE=darwin-arm64
|
|
179
|
+
curl -L "https://github.com/baseballyama/rsvelte/releases/download/capi-v${VERSION}/rsvelte_capi-${VERSION}-${TRIPLE}.tar.gz" | tar -xz
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Or build from source:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
cargo build -p rsvelte_capi --release
|
|
186
|
+
# → target/release/librsvelte_capi.{dylib,so,a}, rsvelte_capi.dll
|
|
187
|
+
# → crates/rsvelte_capi/include/rsvelte.h (regenerated via cbindgen)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Ready-to-run smoke tests are shipped — and run in CI on every PR — for **C, Go, Python, Ruby, Zig, PHP, and Java (JDK 22+ FFM)**. Drift in the generated header or any `CompileOption` deserializer is caught by 35 cargo integration tests + a `RSVELTE_CAPI_CHECK_HEADER=1` build guard. See [`crates/rsvelte_capi/README.md`](crates/rsvelte_capi/README.md) for the full API, JSON envelope shape, memory ownership rules, and the per-language quick-start table.
|
|
191
|
+
|
|
171
192
|
## Compiler option compatibility
|
|
172
193
|
|
|
173
194
|
The JS-facing surfaces (`@rsvelte/compiler` wasm bundle, `@rsvelte/vite-plugin-svelte-native` NAPI bindings) accept the full `svelte/compiler#CompileOptions` shape, but **function-valued** options can't currently cross the language boundary. The Rust core has no way to call back into JavaScript, so callback-shaped fields are accepted (so the TypeScript types stay drop-in compatible with upstream Svelte) and then **silently ignored**.
|
|
@@ -201,7 +222,7 @@ A single-threaded **100× speedup** over the JS compiler is one of this project'
|
|
|
201
222
|
## Compatibility
|
|
202
223
|
|
|
203
224
|
<!-- svelte-target-version -->
|
|
204
|
-
**Targeting Svelte `v5.
|
|
225
|
+
**Targeting Svelte `v5.55.9`** ([`b65a3f3fc5e1`](https://github.com/sveltejs/svelte/commit/b65a3f3fc5e1)) — automatically maintained by `pnpm run update-docs`.
|
|
205
226
|
<!-- /svelte-target-version -->
|
|
206
227
|
|
|
207
228
|
Current compatibility with the official Svelte compiler test suite:
|
package/package.json
CHANGED
|
Binary file
|