Skip to content

[v24.x backport] src: move import.meta initializer to native land - #61048

Closed
targos wants to merge 1 commit into
nodejs:v24.x-stagingfrom
targos:backport-import-meta-v24
Closed

[v24.x backport] src: move import.meta initializer to native land#61048
targos wants to merge 1 commit into
nodejs:v24.x-stagingfrom
targos:backport-import-meta-v24

Conversation

@targos

Copy link
Copy Markdown
Member

Backport of #60603

Changed v8::Maybe<bool>::IsEmpty calls to IsNothing (they are aliases in newer V8).

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/vm

@nodejs-github-botnodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v24.x Issues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch. labels Dec 13, 2025
@aduh95aduh95 changed the title [v24.x] src: move import.meta initializer to native land[v24.x backport] src: move import.meta initializer to native landDec 13, 2025
@avivkelleravivkeller added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 1, 2026
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 1, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@avivkelleravivkeller added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue Add this label to land a pull request using GitHub Actions. labels Jan 16, 2026
When the source text module is compiled without custom callbacks,
instead of calling into JS land from the per-isolate import.meta
initializer and then back to C++ land to set up lazy data
properties, just do the initialization all in C++ land.
Only import.meta.resolve initialization will call back
into JS land to generate a closure that call the cascaded loader
for resolution.
In addition, simplify the loader structure by merging
allowImportMetaResolve into isForAsyncLoaderHookWorker - the two
are essentially equivalent, as import.meta.resolve is only
allowed in a non-loader-hook worker thread's loader.
PR-URL: nodejs#60603
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
@targos
targosforce-pushed the backport-import-meta-v24 branch from 12610e1 to a90d936CompareJanuary 23, 2026 13:56
@targostargos removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 23, 2026
@targos

Copy link
Copy Markdown
MemberAuthor

Simple rebase without conflicts. I'll land if GitHub CI is green.

targos pushed a commit that referenced this pull request Jan 28, 2026
When the source text module is compiled without custom callbacks,
instead of calling into JS land from the per-isolate import.meta
initializer and then back to C++ land to set up lazy data
properties, just do the initialization all in C++ land.
Only import.meta.resolve initialization will call back
into JS land to generate a closure that call the cascaded loader
for resolution.
In addition, simplify the loader structure by merging
allowImportMetaResolve into isForAsyncLoaderHookWorker - the two
are essentially equivalent, as import.meta.resolve is only
allowed in a non-loader-hook worker thread's loader.
PR-URL: #60603
Backport-PR-URL: #61048
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
@targos

Copy link
Copy Markdown
MemberAuthor

Landed in 0b31d9b

@targostargos closed this Jan 28, 2026
@targos
targos deleted the backport-import-meta-v24 branch January 28, 2026 07:24
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.v24.xIssues that can be reproduced on v24.x or PRs targeting the v24.x-staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@targos@nodejs-github-bot@aduh95@avivkeller@joyeecheung