next.js
2a93c30f - cleanup(turbopack): Added documentation comments and small optimizations to CSS import validations (#80901)

Commit
206 days ago
cleanup(turbopack): Added documentation comments and small optimizations to CSS import validations (#80901) ## Refactor CSS Import Validation Logic in Next.js ### What? Refactored the CSS import validation logic to improve readability and maintainability by reorganizing the code flow and adding comprehensive comments. ### Why? The previous implementation had a confusing flow that made it difficult to understand the validation rules for global CSS imports. This refactor makes the logic clearer by: 1. Checking if the imported module is a global CSS module first 2. Validating imports from node_modules 3. Handling root nodes with no parents 4. Allowing imports from CSS modules 5. Finally checking if the parent is the app module ### How? - Reordered the validation checks in `validate_pages_css_imports` to follow a more optimized flow - Added detailed comments explaining each validation rule and its purpose - Added documentation for the `validate_pages_css_imports` function - Improved comments in the `pages.rs` file to explain why we recreate the app_module --------- Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Author
Parents
Loading