Repository navigation
refactor(start-axum): facade slimming — crate split step 3 (#8969) - #12778
Merged
Merged
Conversation
- Remove src/shell.nix from the facade crate: a byte-identical duplicate of
the project-root shell.nix sitting in src/ since 2024, referenced by
nothing. Facade src/ now holds exactly lib.rs (hydrate()), fileserv.rs,
main.rs and the three facade re-export shims (app, dark_mode,
error_template).
- Add tests/facade_paths.rs: a facade-contract test (ssr-gated) that
references the pre-split public paths through the facade
(start_axum::app::App / SimpleCounter,
start_axum::dark_mode::DarkModeToggle,
start_axum::error_template::{AppError, ErrorTemplate},
start_axum::fileserv::file_and_error_handler) so a dropped re-export
fails the suite. The project baseline is 0 tests; this is the first.
No code moves and no behavior change: the extracted code already lives
solely in start-axum-ui / start-axum-error, and fileserv's
use crate::app::App already resolves through the facade re-export of
start-axum-ui.
Closes #8969
|
Warning Review limit reachedYou'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 43 minutes. View limit details
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. |
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.
Step 3 of the pkgs/web-gen-api-axum crate split (#8965), following step 1 (#8967, PR #12395) and step 2 (#8968, PR #12617).
What
pkgs/web-gen-api-axum/src/shell.nix— a byte-identical duplicate of the project-rootshell.nixsitting insrc/since 2024, referenced by nothing (code search: 0 hits). The facade'ssrc/now holds exactly what the step-3 scope names:lib.rs(hydrate()),fileserv.rs,main.rs, and the facade re-exports.pkgs/web-gen-api-axum/tests/facade_paths.rs— a facade-contract test (ssr-gated, matching the step gates) that references the pre-split public paths through the facade —start_axum::app::App/SimpleCounter,start_axum::dark_mode::DarkModeToggle,start_axum::error_template::{AppError, ErrorTemplate},start_axum::fileserv::file_and_error_handler— so a dropped or renamed re-export fails the suite at compile time. The project baseline is 0 tests; this is the first.What did not change
No code moves, no Cargo.toml changes, no behavior change. Verified by source read before the change: the extracted code already lives solely in
start-axum-ui(app.rs,dark_mode.rs) andstart-axum-error(AppError,ErrorTemplate); the facade'ssrc/app.rs/src/dark_mode.rs/src/error_template.rshold only the one-line re-exports, andfileserv'suse crate::app::Appalready resolves through the facade's re-export ofstart-axum-ui— server glue depending downward, per the umbrella's crate map.Verification
cargo check --features ssr;cargo check --locked --features hydrate;cargo check --locked --features ssr;cargo test --locked --features ssr— all green. The suite now runs 1 test (facade_paths_resolve ... ok) where the baseline ran 0.ErrorTemplatefrom the facade shim's export list leaves the lib compiling but fails the new test witherror[E0425]: cannot find value ErrorTemplate in module start_axum::error_templateat tests/facade_paths.rs:22; renaming the shim's import fails the build with E0432. The test is a working oracle for the facade contract.Closes #8969
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.