Skip to content

Conversation

@joyeecheung
Copy link
Member

src: implement natives binding without special casing

This patch removes special case in the internal binding loader
for natives, and implements it using the builtins internal
binding. Internally we do not actually need the natives binding,
so implement it as a legacy wrapper instead.

src: implement constants binding directly

Instead of adding a special case for it in the internal binding
loader, just implement it as usual using a per-context property
initializer.

This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders
  • @nodejs/modules
  • @nodejs/startup

@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. labels May 26, 2023

returnStringPrototypeStartsWith(url,'node:internal/')||
ArrayPrototypeIncludes(PUBLIC_BUILTINS,url)||
urlinNATIVES||url==='bootstrap_node';
Copy link
MemberAuthor

@joyeecheungjoyeecheungMay 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original condition was already redundant, builtinIds actually contains both public and internal IDs, so I just removed it (as well as bootstrap_node which no longer exists)

Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer.
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

joyeecheung added a commit that referenced this pull request Jun 9, 2023
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: #48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
joyeecheung added a commit that referenced this pull request Jun 9, 2023
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: #48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
@joyeecheung
Copy link
MemberAuthor

Landed in 6a3403c...d102f18

RafaelGSS pushed a commit that referenced this pull request Jul 3, 2023
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: #48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Jul 3, 2023
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: #48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
@RafaelGSSRafaelGSS mentioned this pull request Jul 3, 2023
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: nodejs#48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: nodejs#48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
This patch removes special case in the internal binding loader for natives, and implements it using the builtins internal binding. Internally we do not actually need the natives binding, so implement it as a legacy wrapper instead. PR-URL: nodejs#48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
Instead of adding a special case for it in the internal binding loader, just implement it as usual using a per-context property initializer. PR-URL: nodejs#48186 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]>
@ruyadorno
Copy link
Member

hi @joyeecheung these commits are not landing cleanly on v18.x-staging and will need manual backport in case we want to land this in v18.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@joyeecheung@nodejs-github-bot@ruyadorno@ljharb@jasnell@anonrig@legendecas