Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
# Windows checkouts with autocrlf.
*.js text eol=lf
*.mjs text eol=lf
*.ts text eol=lf
2 changes: 2 additions & 0 deletions .github/workflows/_build-docs-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ jobs:
with:
toolchain: 1.97.0

- name: Install JS build toolchain
run: npm ci
- name: Verify committed render client
run: node js/build.mjs --check

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ jobs:
with:
node-version: "22"

- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check

Expand Down Expand Up @@ -334,6 +336,9 @@ jobs:
if: matrix.browser || matrix.build_js
with:
node-version: "22"
- name: Install JS build toolchain
if: matrix.build_js
run: npm ci
- name: Build native core
if: matrix.xy
run: cargo build --release
Expand Down Expand Up @@ -402,6 +407,8 @@ jobs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22"
- name: Install JS build toolchain
run: npm ci
- name: Build core + JS client
run: |
node js/build.mjs
Expand Down Expand Up @@ -548,6 +555,8 @@ jobs:
with:
node-version: "22"

- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check

Expand Down Expand Up @@ -606,6 +615,8 @@ jobs:
with:
node-version: "22"

- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ jobs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "22"
- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check
- name: Build JS client
Expand Down Expand Up @@ -145,6 +147,8 @@ jobs:
with:
# Pyodide 0.29.x / pyodide_2025_0 ABI compiler version.
version: "4.0.9"
- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check
- name: Build JS client
Expand Down Expand Up @@ -199,6 +203,8 @@ jobs:
# user's machine if they install from sdist and have a toolchain. There is
# no fallback: without a toolchain the compute layer raises a clear
# ImportError on first use (hatch_build.py). Wheels are the normal path.
- name: Install JS build toolchain
run: npm ci
- name: Verify committed JS bundles are fresh
run: node js/build.mjs --check
- name: Build sdist
Expand Down
16 changes: 11 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,24 @@ instead of treating the implementation alone as authoritative.
package at app compile (no second copy to drift), and the adapter stays
out of the root `xy` sdist (`scripts/verify_sdist.py` enforces it).
Tests: `tests/reflex_adapter/` (skip unless reflex installed).
- `js/src/*.js` — the render client as ordered parts (concat order in
`js/build.mjs`; exports live only in `60_entries.js`), one dependency-free ES
module. **No npm packages.** `node js/build.mjs` copies it to
`python/xy/static/` (committed artifacts).
- `js/src/*.ts` — the render client as TypeScript ES modules (one module per
former concat part; `60_entries.ts` is the entry and the only public export
surface). `node js/build.mjs` typechecks (`js/tsconfig.json`), lints the
shaders, and has vite bundle + minify into `python/xy/static/index.js`
(anywidget ESM) and `standalone.js` (IIFE, `window.xy`) — committed,
minified artifacts; the minified bundles are what ships to the client.
npm devDependencies (vite/typescript/playwright, pinned in
`package-lock.json`) are build/test-time only — the shipped client stays
runtime-dependency-free. Run `npm ci` once per checkout.
- `tests/`, `scripts/bench.py` (§12 harness), `scripts/smoke_render.py`
(headless Chromium pixel probe).

## Commands

```bash
cargo test && cargo build --release # core
node js/build.mjs # regenerate static/ after JS edits
npm ci # once per checkout: vite + tsc toolchain
node js/build.mjs # typecheck + regenerate minified static/ after JS edits
python3 scripts/abi_smoke.py # C-ABI seam, stdlib only (no PyPI needed)
python3 scripts/render_smoke_nonumpy.py # WebGL2 render path in headless Chromium
uv venv && uv pip install -e ".[dev]"
Expand Down
Loading
Loading