oxc-project
oxc-resolver
BlogDocsChangelog

feat: add ESM file:// protocol support with comprehensive tests

#746Merged
Comparing
esm-file-protocol-tests
(
48d28e1
) with
main
(
a1122a7
)
CodSpeed Performance Gauge
0%
Untouched
7
Skipped
2

Benchmarks

Skipped (2)

parallel_batch_4_files
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
Skipped
91.1 µs*
batch_4_files
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
Skipped
78.6 µs*

Passed

resolver[multi-thread]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
+2%
518.6 µs509.2 µs
medium
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
CodSpeed Performance Gauge
0%
22.3 µs22.3 µs
resolver[single-thread]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
482.1 µs482.9 µs
small
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
CodSpeed Performance Gauge
0%
10.7 µs10.7 µs
large
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
CodSpeed Performance Gauge
0%
43.8 µs43.9 µs
resolver[resolve from symlinks]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
63.1 ms63.3 ms
complex_real
benches/resolver.rs::resolver::bench_package_json_deserialization::package_json_deserialization
CodSpeed Performance Gauge
0%
33.4 µs33.5 µs

Commits

Click on a commit to change the comparison range
Base
main
a1122a7
+0.28%
[autofix.ci] apply automated fixes
87dfa13
15 days ago
by autofix-ci[bot]
-0.39%
feat: enable file:// protocol support on all platforms Enable ESM file:// protocol URL resolution on macOS and Linux, not just Windows. Changes: - Move `url` crate dependency from Windows-only to all platforms in Cargo.toml - Remove `#[cfg(target_os = "windows")]` from `resolve_file_protocol` function - Remove platform-specific `cfg_if` wrapper at call site - Preserve URL query strings and fragments when converting file:// URLs to paths All file-protocol tests now pass on macOS/Linux. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
f80e4a3
14 days ago
by Boshen
+0.04%
fix: add wasm32 support for file:// protocol code Add conditional compilation to support wasm32 targets where `to_file_path()` is not available. On wasm32, the file:// protocol resolver is a no-op that returns the specifier unchanged, since WebAssembly has no filesystem access. This fixes the build error: ``` error[E0599]: no method named `to_file_path` found for struct `Url` ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
02530e4
14 days ago
by Boshen
-0.03%
refactor: use cfg_if at call site for file:// protocol Refactor to use cfg_if::cfg_if! macro at the call site instead of having two separate function definitions. This matches the original pattern and is more consistent with the rest of the codebase. Changes: - Wrap resolve_file_protocol call in cfg_if block - Only compile/call on non-wasm32 targets - Remove wasm32 stub function (no longer needed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2c7426b
14 days ago
by Boshen
-0.03%
fix: address clippy warnings in resolve_file_protocol Fix clippy warnings: - Remove unnecessary reference in url::Url::parse call - Use () instead of _ for explicit unit type in map_err 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
d20a820
14 days ago
by Boshen
-0.04%
test: skip file:// protocol tests for WASI/wasm32 Skip all file:// protocol tests when running with WASI_TEST=1 since the file:// protocol code is excluded on wasm32 targets (no filesystem access). Uses vitest's `test.skipIf(process.env.WASI_TEST)` to conditionally skip all 9 tests in the file when running on WASI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
19593e0
14 days ago
by Boshen
+0.22%
refactor: use describe.skipIf block for WASI tests Refactor file:// protocol tests to use a single `describe.skipIf` block instead of repeating `test.skipIf` on each individual test. This is cleaner and groups all file:// protocol tests together. Changes: - Import `describe` from vitest - Wrap all tests in `describe.skipIf(process.env.WASI_TEST)` block - Simplify test names (remove "file:// protocol" prefix) - Proper indentation for nested tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
48d28e1
14 days ago
by Boshen
© 2025 CodSpeed Technology
Home Terms Privacy Docs