-
-
Notifications
You must be signed in to change notification settings - Fork 714
Revert "feat(resolver): resolve extension alias" #7199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This reverts commit 58f8102.
|
WalkthroughThis PR removes the resolver’s extension-alias feature across code and tests. It deletes the default alias map in js_module_info/visitor.rs and removes passing extension_alias in ResolveOptions. In biome_resolver, it eliminates alias-based absolute/relative resolution, the ResolveOptions.extension_alias field, and the with_extension_alias constructor, relying solely on configured extensions. Corresponding tests validating alias behaviour are removed. A changeset entry describing the alias behaviour is deleted. No exported/public API is added; one public field and one method are removed. Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think you'll need to base it on the moduleResolution
setting. If it's node16
or nodenext
we should enable this, otherwise leave it disabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
crates/biome_resolver/src/lib.rs (1)
718-724
: Doc nit: clarify where extensions are applied (not just “relative paths”)extensions are used for absolute paths and directory defaults too. Tighten the wording.
Apply this diff to the ResolveOptions::extensions docs:
- /// List of extensions to search for in relative paths. + /// List of extensions to search for when resolving files. + /// + /// Used for: + /// - Relative paths (e.g. ./foo -> ./foo.<ext>) + /// - Absolute paths (e.g. /abs/foo -> /abs/foo.<ext>) + /// - Default files in directories (e.g. ./dir -> ./dir/index.<ext>) @@ - /// Extensions are checked in the order given, meaning the first extension - /// in the list has the highest priority. + /// Extensions are checked in the order given; the first extension has the + /// highest priority. @@ - /// Extensions should be provided without leading dot. + /// Extensions should be provided without a leading dot.Also, per repository guidelines, please run just format before landing to keep docs and code styled uniformly.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.changeset/petite-waves-love.md
(0 hunks)crates/biome_module_graph/src/js_module_info/visitor.rs
(1 hunks)crates/biome_resolver/src/lib.rs
(3 hunks)crates/biome_resolver/tests/spec_tests.rs
(0 hunks)
💤 Files with no reviewable changes (2)
- .changeset/petite-waves-love.md
- crates/biome_resolver/tests/spec_tests.rs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{rs,toml}
📄 CodeRabbit Inference Engine (CLAUDE.md)
Format code (Rust + TOML) using
just format
Format Rust and TOML files before committing (use
just f
/just format
).
Files:
crates/biome_module_graph/src/js_module_info/visitor.rs
crates/biome_resolver/src/lib.rs
crates/biome_*/**/*
📄 CodeRabbit Inference Engine (CLAUDE.md)
Core crates must be located in
/crates/biome_*/
Files:
crates/biome_module_graph/src/js_module_info/visitor.rs
crates/biome_resolver/src/lib.rs
🧠 Learnings (2)
📚 Learning: 2025-08-11T11:50:12.081Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.081Z
Learning: Applies to crates/biome_js_type_info/biome_module_graph/src/js_module_info/collector.rs : Thin (module-level) inference may resolve qualifiers to local declarations or globals (TypeReference::Resolved), mark imported bindings as TypeReference::Import, and set unresolved to TypeReference::Unknown; it must not look beyond the current module
Applied to files:
crates/biome_module_graph/src/js_module_info/visitor.rs
📚 Learning: 2025-08-11T11:50:12.081Z
Learnt from: CR
PR: biomejs/biome#0
File: crates/biome_js_type_info/CONTRIBUTING.md:0-0
Timestamp: 2025-08-11T11:50:12.081Z
Learning: Applies to crates/biome_js_type_info/src/**/*.rs : Represent links between types using TypeReference (not Arc) to avoid cross-module retention and recursive structures; store type data in linear vectors
Applied to files:
crates/biome_module_graph/src/js_module_info/visitor.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (24)
- GitHub Check: Test (depot-windows-2022-16)
- GitHub Check: Test (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_configuration)
- GitHub Check: Bench (biome_html_formatter)
- GitHub Check: Bench (biome_package)
- GitHub Check: Bench (biome_module_graph)
- GitHub Check: Documentation
- GitHub Check: Bench (biome_graphql_parser)
- GitHub Check: Bench (biome_html_parser)
- GitHub Check: Bench (biome_json_analyze)
- GitHub Check: Bench (biome_graphql_formatter)
- GitHub Check: Test Node.js API
- GitHub Check: Lint project (depot-windows-2022)
- GitHub Check: Lint project (depot-ubuntu-24.04-arm-16)
- GitHub Check: Bench (biome_json_formatter)
- GitHub Check: Bench (biome_css_analyze)
- GitHub Check: Bench (biome_json_parser)
- GitHub Check: Bench (biome_css_parser)
- GitHub Check: Check Dependencies
- GitHub Check: Bench (biome_css_formatter)
- GitHub Check: Bench (biome_js_formatter)
- GitHub Check: Bench (biome_js_analyze)
- GitHub Check: Bench (biome_js_parser)
- GitHub Check: autofix
🔇 Additional comments (3)
crates/biome_resolver/src/lib.rs (2)
43-45
: Revert restores straightforward absolute-path resolution — looks goodCalling resolve_absolute_path directly here is consistent with removing alias support. No functional concerns.
109-115
: Directly delegating relative paths to absolute resolution is appropriate post-revertJoining base_dir and path, then normalising in resolve_absolute_path, keeps behaviour correct and simple.
crates/biome_module_graph/src/js_module_info/visitor.rs (1)
396-397
: Whitespace-only tweak — all fineFormatting change only; no behavioural impact.
CodSpeed Performance ReportMerging #7199 will not alter performanceComparing Summary
Footnotes |
Reverts #7158
It should check if the remapping is actually available based on
tsconfig.json
. Reverting it for now and I'll revamp the implementation later.