feat(cli): add reflex run-rust driving page emission via reflex-compiler-rust#6522
Closed
FarhanAliRaza wants to merge 1 commit into
Closed
feat(cli): add reflex run-rust driving page emission via reflex-compiler-rust#6522FarhanAliRaza wants to merge 1 commit into
reflex run-rust driving page emission via reflex-compiler-rust#6522FarhanAliRaza wants to merge 1 commit into
Conversation
…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/`.
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: |
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.
…
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 underREFLEX_RUST_NO_LEGACY_REBUILDfor the diff script.Splits
_compile_root_stylesheetinto_resolve_root_stylesheetsso the rust pipeline can reuse the asset-walk + SASS-compile side effects without going through the legacy template, and addscli_run_rustto the telemetryCompileTriggerliteral. Also ignorestarget/.All Submissions:
Type of change
Please delete options that are not relevant.
New Feature Submission:
Changes To Core Features:
After these steps, you're ready to open a pull request.