René's URL Explorer Experiment


Title: src: initial support for ESM in embedder API by joyeecheung · Pull Request #61548 · nodejs/node · GitHub

Open Graph Title: src: initial support for ESM in embedder API by joyeecheung · Pull Request #61548 · nodejs/node

X Title: src: initial support for ESM in embedder API by joyeecheung · Pull Request #61548 · nodejs/node

Description: This patch extends LoadEnvironment to support loading ES modules, and adds the following new types: enum class ModuleFormat : uint8_t { kCommonJS, kModule, }; // Data for specifying an entry point script for LoadEnvironment(). // This class uses an opaque layout to allow future additions without // breaking ABI. Use the setter methods to configure the entry point. class ModuleData { void set_source(std::string_view source); void set_format(ModuleFormat format); void set_resource_name(std::string_view name); std::string_view source() const; ModuleFormat format() const; std::string_view resource_name() const; }; class StartExecutionCallbackInfoWithModule { void set_env(Environment* env); void set_process_object(v8::Local process_object); void set_native_require(v8::Local native_require); void set_run_module(v8::Local run_module); void set_data(void* data); Environment* env(); v8::Local process(); v8::Local native_require(); v8::Local run_module(); void* data(); }; And two new LoadEnvironment() overloads: // Run entry point with ModuleData configuration MaybeLocal LoadEnvironment( Environment* env, const ModuleData* entry_point, EmbedderPreloadCallback preload = nullptr); // Callback-based with new StartExecutionCallbackInfoWithModule MaybeLocal LoadEnvironment( Environment* env, StartExecutionCallbackWithModule cb, EmbedderPreloadCallback preload = nullptr, void* callback_data = nullptr); Notes about the run_module function: The run_cjs function is renamed to run_module and now accepts three arguments: (source, format, resourceName) where format corresponds to ModuleFormat values. This keeps the old StartExecutionCallback backward-compatible, and reuses this new function for StartExecutionCallbackWithModule. ESM entry points return the module namespace object, CJS entry points continue to return the wrapper's return value. The following are left as TODO for follow-up PRs. Support for import() and import.meta Support for SEA: I have a branch here to support ESM in SEA via the new API. Support for snapshot: this requires integration of ModuleWrap objects Support for code cache: needs more plumbing for v8::Module cache Refs: #53565

Open Graph Description: This patch extends LoadEnvironment to support loading ES modules, and adds the following new types: enum class ModuleFormat : uint8_t { kCommonJS, kModule, }; // Data for specifying an entry p...

X Description: This patch extends LoadEnvironment to support loading ES modules, and adds the following new types: enum class ModuleFormat : uint8_t { kCommonJS, kModule, }; // Data for specifying an entry p...

Opengraph URL: https://github.com/nodejs/node/pull/61548

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:528225d9-fbdb-fdd7-0a1f-a91f5a1f56a7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCA50:1E2E76:218438:2D85EC:6A4C261C
html-safe-nonceceb5a5ccf25c8c53cdd4e90abf6f1d00bcb1e432618ba024082a292f9f2675e7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTUwOjFFMkU3NjoyMTg0Mzg6MkQ4NUVDOjZBNEMyNjFDIiwidmlzaXRvcl9pZCI6IjMxNzIxMjcxNjQyOTcxMjc0NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac09c89776bdd39426db06feb06bbcc7103527e9e291e380d8e7396bd96f33d0bf
hovercard-subject-tagpull_request:3215617704
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/61548/files
twitter:imagehttps://avatars.githubusercontent.com/u/4299420?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/4299420?s=400&v=4
og:image:altThis patch extends LoadEnvironment to support loading ES modules, and adds the following new types: enum class ModuleFormat : uint8_t { kCommonJS, kModule, }; // Data for specifying an entry p...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release9ee13484b32cf23e15fde191da4c9aa47d41201c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/61548/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F61548%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F61548%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/61548/files
Reloadhttps://github.com/nodejs/node/pull/61548/files
Reloadhttps://github.com/nodejs/node/pull/61548/files
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 967 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
joyeecheunghttps://github.com/joyeecheung
nodejs:mainhttps://github.com/nodejs/node/tree/main
joyeecheung:esm-apihttps://github.com/joyeecheung/node/tree/esm-api
Conversation 15 https://github.com/nodejs/node/pull/61548
Commits 2 https://github.com/nodejs/node/pull/61548/commits
Checks 34 https://github.com/nodejs/node/pull/61548/checks
Files changed https://github.com/nodejs/node/pull/61548/files
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
src: initial support for ESM in embedder API https://github.com/nodejs/node/pull/61548/files#top
Show all changes 2 commits https://github.com/nodejs/node/pull/61548/files
9465a44 src: add initial support for ESM in embedder API joyeecheung Jan 26, 2026 https://github.com/nodejs/node/pull/61548/commits/9465a44da907d8503b680f3ebfa1156090ad711b
03fcd4d fixup! src: add initial support for ESM in embedder API joyeecheung Jan 30, 2026 https://github.com/nodejs/node/pull/61548/commits/03fcd4d0075e3b11e614f971ff347cd75034c41d
Clear filters https://github.com/nodejs/node/pull/61548/files
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
embedding.js https://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
environment.cc https://github.com/nodejs/node/pull/61548/files#diff-5f2fc380364ef43210af4a28c08f9a0c7ec5f85e3ec1f5c1df5e0204eb9dc721
node.cc https://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
node.h https://github.com/nodejs/node/pull/61548/files#diff-7c19dd5fd5584cd4a8111f4c82a9f49f4aa1bdb9470ad11daa90f3d394a23b4e
node_internals.h https://github.com/nodejs/node/pull/61548/files#diff-6648b37276e20be36473a32445be879f73cedc8d557c06a8a8dfc9adb013a42d
node_main_instance.cc https://github.com/nodejs/node/pull/61548/files#diff-ee087afd55f181d56a9450bcf909502d8b858f16c5fa22ad80002f9f4626c188
node_modules.cc https://github.com/nodejs/node/pull/61548/files#diff-5a97cbf52068365f285949eaef2d5d154bc504b4112890ac09813386e13e4647
node_worker.cc https://github.com/nodejs/node/pull/61548/files#diff-b06b65a7f7e33816a1986d731765d732ab23f585bece6b23c5e83ca3682dba62
test_environment.cc https://github.com/nodejs/node/pull/61548/files#diff-24b6b2e258ff33df69fa563c4a877f0c7756bc1b6cc4e7422fae14e5be2dca07
sea.js https://github.com/nodejs/node/pull/61548/files#diff-456de803cf5f2568cf8d9d941544996175fa329698ace165ea59fb277ddb18a6
lib/internal/main/embedding.jshttps://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
View file https://github.com/joyeecheung/node/blob/03fcd4d0075e3b11e614f971ff347cd75034c41d/lib/internal/main/embedding.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/61548/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
https://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
https://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
https://github.com/nodejs/node/pull/61548/files#diff-b599803b304405417e4d4139e8341ac060d7fbcc8bda37eaa071ce6e3812cd48
src/api/environment.cchttps://github.com/nodejs/node/pull/61548/files#diff-5f2fc380364ef43210af4a28c08f9a0c7ec5f85e3ec1f5c1df5e0204eb9dc721
View file https://github.com/joyeecheung/node/blob/03fcd4d0075e3b11e614f971ff347cd75034c41d/src/api/environment.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/61548/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/61548/files#diff-5f2fc380364ef43210af4a28c08f9a0c7ec5f85e3ec1f5c1df5e0204eb9dc721
https://github.com/nodejs/node/pull/61548/files#diff-5f2fc380364ef43210af4a28c08f9a0c7ec5f85e3ec1f5c1df5e0204eb9dc721
https://github.com/nodejs/node/pull/61548/files#diff-5f2fc380364ef43210af4a28c08f9a0c7ec5f85e3ec1f5c1df5e0204eb9dc721
src/node.cchttps://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
View file https://github.com/joyeecheung/node/blob/03fcd4d0075e3b11e614f971ff347cd75034c41d/src/node.cc
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/61548/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
https://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
https://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
joyeecheunghttps://github.com/joyeecheung
Jan 30, 2026https://github.com/nodejs/node/pull/61548/files#r2748309270
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
https://github.com/nodejs/node/pull/61548/files#diff-6c1386cbc6e4a11941649af31a0257d5c3e40b5f41223cdddf87ab2e984b705a
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
Please reload this pagehttps://github.com/nodejs/node/pull/61548/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.