Skip to content

Commit

Permalink
feat: support node 22
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Sep 2, 2024
1 parent a156f5d commit 0f561c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
RUSTUP_IO_THREADS: 1
with:
operating_system: freebsd
version: '14.0'
version: '14.1'
memory: 8G
cpu_count: 3
environment_variables: 'DEBUG RUSTUP_IO_THREADS'
Expand Down Expand Up @@ -257,6 +257,7 @@ jobs:
node:
- '18'
- '20'
- '22'
transform_all:
- 'true'
- 'false'
Expand Down Expand Up @@ -307,6 +308,7 @@ jobs:
node:
- '18'
- '20'
- '22'
exclude:
# too slow
- target: aarch64-unknown-linux-gnu
Expand Down
2 changes: 1 addition & 1 deletion packages/core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface LoadContext {
/** Export conditions of the relevant `package.json` */
conditions?: Array<string>
/** The format optionally supplied by the `resolve` hook chain */
format: string
format: string | null
/** An object whose key-value pairs represent the assertions for the module to import */
importAttributes: Record<string, string>
}
Expand Down
13 changes: 7 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ pub struct LoadContext {
/// Export conditions of the relevant `package.json`
pub conditions: Option<Vec<String>>,
/// The format optionally supplied by the `resolve` hook chain
pub format: String,
pub format: Either<String, Null>,
/// An object whose key-value pairs represent the assertions for the module to import
pub import_attributes: HashMap<String, String>,
}
Expand All @@ -487,11 +487,12 @@ pub fn load(
>,
) -> Result<Either<LoadFnOutput, PromiseRaw<LoadFnOutput>>> {
tracing::debug!(url = ?url, context = ?context, "load");
if url.starts_with("data:")
|| context.format == "builtin"
|| context.format == "json"
|| context.format == "wasm"
{
if url.starts_with("data:") || {
match context.format {
Either::A(ref format) => format == "builtin" || format == "json" || format == "wasm",
_ => true,
}
} {
tracing::debug!("short-circuiting load: {}", url);
return next_load.call((url, Some(context)));
}
Expand Down

0 comments on commit 0f561c4

Please sign in to comment.