Skip to content

refactor(web-gen-api-axum): extract start-axum-ui crate (dark_mode + app) - #12617

Merged
dezren39 merged 4 commits into
mainfrom
archer-lane-n/8968-start-axum-ui
Nov 22, 2026
Merged

dezren39 merged 4 commits into
mainfrom
archer-lane-n/8968-start-axum-ui

Conversation

@dezren39

@dezren39 dezren39 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Step 2 of the pkgs/web-gen-api-axum crate split (#8965), mirroring the step-1 pattern from #8967 / PR #12395:

pkgs/start-axum-ui/            # owns app (App, HomePage, visitor server fns) and dark_mode (DarkModeToggle)
  Cargo.toml                   # depends on start-axum-error; hydrate/ssr feature wiring mirrors the facade's
  src/lib.rs                   # pub mod app; pub mod dark_mode;
  src/app.rs                   # moved; only change: AppError/ErrorTemplate now imported from start_axum_error
  src/dark_mode.rs             # moved byte-identical
pkgs/web-gen-api-axum/
  src/app.rs                   # compatibility re-export only: pub use start_axum_ui::app::*;
  src/dark_mode.rs             # compatibility re-export only: pub use start_axum_ui::dark_mode::*;
  Cargo.toml                   # start-axum-ui path dep; forwards hydrate/ssr to start-axum-ui
  Cargo.lock                   # start-axum-ui package entry added

Pure code motion, no behavior change: the facade re-exports keep start_axum::app and start_axum::dark_mode working for the known consumers (facade lib.rs hydrate fn, main.rs, fileserv.rs crate::app::App). The visitor server fns in app.rs (AddVisitorData, GetVisitorRows) moved with app as one unit, per the step scope. Facade shim file modes kept at 100755, matching the step-1 shim.

Closes #8968.

Evidence

Oracle = the step-1 gate, run via fleet-run in the repo's nix develop .#fleet shell (all runs check out the target ref of developing-today/code):

  • Baseline on main (8f47a87), run 45038657750: all gates green — cargo check --features ssr, cargo check --locked --features hydrate, cargo check --locked --features ssr, cargo test --locked --features ssr (0 tests; project baseline per step 0).
  • First branch run (45039022523) failed E0463 can't find crate for serde: the leptos #[server] macro expansion references serde by name in the invoking crate. Fixed by giving start-axum-ui the facade's own serde spec (1.0.176 + derive) as a direct dependency.
  • Second branch run (45039870829) failed E0433 cannot find tracing: the #[component] macro expands through leptos_dom::tracing::instrument — the same wiring step 1 recorded for start-axum-error. Fixed the same way: tracing optional, dep:tracing in both hydrate and ssr.
  • Final branch run (45040690050): all four gates green, identical results to baseline (test: 0 passed / 0 failed). The --locked gates passing against the committed lock, plus the runner-printed start-axum-ui lock entry matching the committed one byte for byte, prove the lock update is canonical.
  • Motion proof: git show <main>:pkgs/web-gen-api-axum/src/app.rs | diff - pkgs/start-axum-ui/src/app.rs shows exactly one changed line (the crate::error_template → start_axum_error import); dark_mode.rs is byte-identical.
  • Definition grep: App, DarkModeToggle, toggle_dark_mode, add_visitor, get_visitor_rows are defined only under pkgs/start-axum-ui/src/; the facade files hold only the re-exports.

Merge Danger

Door: Two-way; the extraction and feature wiring can be reverted.

Blast Radius: Low; limited to the web-gen-api-axum app/dark_mode modules and their new crate. Step 3 (#8969, facade slimming) builds on this and is untouched.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…app)

Step 2 of the pkgs/web-gen-api-axum crate split (#8965), following the
step-1 pattern from #8967 / PR #12395. Pure code motion, no behavior
change:

- New member crate pkgs/start-axum-ui owns src/app.rs and
  src/dark_mode.rs (moved verbatim except app.rs now imports
  AppError/ErrorTemplate from start_axum_error instead of
  crate::error_template). It depends on start-axum-error and mirrors
  the facade's hydrate/ssr feature wiring for the moved code.
- Facade src/app.rs and src/dark_mode.rs are now re-export shims
  (pub use start_axum_ui::app::* / dark_mode::*), keeping
  start_axum::app and start_axum::dark_mode paths working for lib.rs,
  main.rs and fileserv.rs, exactly as step 1 did for error_template.
- Facade Cargo.toml gains the start-axum-ui path dependency and
  forwards hydrate/ssr to it; Cargo.lock updated to match.

Closes #8968
The leptos #[server] macro expansion references serde by name in the
invoking crate; the facade had it as a direct dep, so the extracted
crate must too (E0463 in the step-2 gate run). Same spec as the
facade: 1.0.176 with derive.
…xum-error

The leptos #[component] macro expands through leptos_dom::tracing::
instrument, which requires tracing as a direct dependency of the
invoking crate in both hydrate and ssr modes (E0433 in the step-2
gate run). This is the same wiring step 1 recorded for
start-axum-error: tracing optional, dep:tracing in both features.
@dezren39
dezren39 requested a review from a team as a code owner November 22, 2026 16:01
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 64c8a85b-5073-4fca-b309-a1365767ea88
Commits

Reviewing files that changed from the base of the PR and between 497df9c and f9d5a02.

Files ignored due to path filters: 1

  • pkgs/web-gen-api-axum/Cargo.lock is excluded by !**/*.lock
Files selected for processing: 7

  • pkgs/start-axum-ui/Cargo.toml
  • pkgs/start-axum-ui/src/app.rs
  • pkgs/start-axum-ui/src/dark_mode.rs
  • pkgs/start-axum-ui/src/lib.rs
  • pkgs/web-gen-api-axum/Cargo.toml
  • pkgs/web-gen-api-axum/src/app.rs
  • pkgs/web-gen-api-axum/src/dark_mode.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T16:03:20.673618Z f9d5a02 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

pkgs/web-gen-api-axum crate split — step 2: extract start-axum-ui (dark_mode + app)

1 participant