Skip to content

feat(cli): add reflex run-rust driving page emission via reflex-compiler-rust#6522

Closed
FarhanAliRaza wants to merge 1 commit into
reflex-dev:mainfrom
FarhanAliRaza:exp-rust-compiler
Closed

feat(cli): add reflex run-rust driving page emission via reflex-compiler-rust#6522
FarhanAliRaza wants to merge 1 commit into
reflex-dev:mainfrom
FarhanAliRaza:exp-rust-compiler

Conversation

@FarhanAliRaza
Copy link
Copy Markdown
Contributor

Wires up a new CLI entrypoint that runs each registered page through the Rust IR/JSX emitter instead of the legacy plugin chain. Falls back to a one-shot legacy compile when .web/ is missing the static artifacts (app/root.jsx, utils/components.jsx) and skips that fallback under REFLEX_RUST_NO_LEGACY_REBUILD for the diff script.

Splits _compile_root_stylesheet into _resolve_root_stylesheets so the rust pipeline can reuse the asset-walk + SASS-compile side effects without going through the legacy template, and adds cli_run_rust to the telemetry CompileTrigger literal. Also ignores target/.

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

a. Give a descriptive title to your PR.

b. Describe your changes.

c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

…piler-rust

Wires up a new CLI entrypoint that runs each registered page through
the Rust IR/JSX emitter instead of the legacy plugin chain. Falls back
to a one-shot legacy compile when `.web/` is missing the static
artifacts (`app/root.jsx`, `utils/components.jsx`) and skips that
fallback under `REFLEX_RUST_NO_LEGACY_REBUILD` for the diff script.

Splits `_compile_root_stylesheet` into `_resolve_root_stylesheets` so
the rust pipeline can reuse the asset-walk + SASS-compile side effects
without going through the legacy template, and adds `cli_run_rust` to
the telemetry `CompileTrigger` literal. Also ignores `target/`.
@FarhanAliRaza FarhanAliRaza requested review from a team and Alek99 as code owners May 17, 2026 20:18
Comment on lines +36 to +85
name: Build ${{ matrix.package.name }} (${{ matrix.platform.target }} / ${{ matrix.platform.manylinux || matrix.platform.os }})
runs-on: ${{ matrix.platform.runs-on }}
strategy:
fail-fast: false
matrix:
package:
- { name: reflex-compiler-rust, dir: packages/reflex-compiler-rust, py_module: reflex_compiler_rust, smoke: "from reflex_compiler_rust import _native; print('schema', _native.SCHEMA_VERSION); print('ok')" }
- { name: reflex-markdown-rust, dir: packages/reflex-markdown-rust, py_module: reflex_markdown_rust, smoke: "from reflex_markdown_rust import markdown_to_html; assert '<h1>hi</h1>' in markdown_to_html('# hi'); print('ok')" }
platform:
- { runs-on: ubuntu-22.04, target: x86_64, manylinux: manylinux2014, os: linux }
- { runs-on: ubuntu-22.04, target: x86_64, manylinux: musllinux_1_2, os: linux }
- { runs-on: ubuntu-22.04-arm, target: aarch64, manylinux: manylinux2014, os: linux }
- { runs-on: macos-14, target: aarch64, os: macos }
- { runs-on: macos-13, target: x86_64, os: macos }
- { runs-on: windows-2022, target: x64, os: windows }

steps:
- uses: actions/checkout@v4

- name: Set up Python (host interpreter)
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Build wheel
uses: PyO3/maturin-action@v1
with:
working-directory: ${{ matrix.package.dir }}
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux || 'auto' }}
args: --release --out dist --interpreter python3.12
sccache: "true"

- name: Smoke test wheel
if: matrix.platform.os == 'linux' && matrix.platform.target == 'x86_64' && matrix.platform.manylinux == 'manylinux2014'
working-directory: ${{ matrix.package.dir }}
run: |
python -m pip install --upgrade pip
pip install dist/*.whl
python -c "${{ matrix.package.smoke }}"

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.package.name }}-${{ matrix.platform.os }}-${{ matrix.platform.target }}-${{ matrix.platform.manylinux || 'native' }}
path: ${{ matrix.package.dir }}/dist/*.whl
if-no-files-found: error
retention-days: 7

publish:
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 17, 2026

Merging this PR will not alter performance

✅ 24 untouched benchmarks


Comparing FarhanAliRaza:exp-rust-compiler (3189fda) with main (9ed3692)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants