Skip to content

Conversation

Renegade334
Copy link
Contributor

Manual backport for #58896, which doesn't land cleanly on v22.x, and is needed to ensure that future PRs that touch the fast API will backport cleanly where possible.

Requires #58054 and #58489, both of which also need manual backporting.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/loaders
  • @nodejs/security-wg
  • @nodejs/url

@nodejs-github-bot nodejs-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. v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch. labels Jul 14, 2025
@Renegade334 Renegade334 force-pushed the v22.x-backport-fast-api-changes branch from b42761a to 48174f1 Compare July 16, 2025 22:48
Renegade334 pushed a commit to Renegade334/node that referenced this pull request Jul 16, 2025
PR-URL: nodejs#58054
Backport-PR-URL: nodejs#59065
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Renegade334 pushed a commit to Renegade334/node that referenced this pull request Jul 16, 2025
There are several motivation for removing this:

1. The implementation does not align with InternalModuleStat,
   most noticably it does not namespace the path or convert
   it to UTF-16 before using it with std::filesystem::path
   on Windows which could crash on non-English locale.
2. It needs the Environment - if not for decoding the string,
   at least for env->exec_path() to resolve the path for
   namespacing - and therefore needs a handle to the Context
   which requires a handle scope which actually makes the
   fast API version slower than the normal binding.

For simplicity this just removes the fast API to fix the bug and
improve the performance.

PR-URL: nodejs#58489
Backport-PR-URL: nodejs#59065
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Renegade334 added a commit to Renegade334/node that referenced this pull request Jul 16, 2025
PR-URL: nodejs#58896
Backport-PR-URL: nodejs#59065
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
@aduh95 aduh95 requested review from anonrig and joyeecheung July 21, 2025 14:10
@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

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

anonrig and others added 3 commits July 28, 2025 08:58
PR-URL: nodejs#58054
Backport-PR-URL: nodejs#59065
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
There are several motivation for removing this:

1. The implementation does not align with InternalModuleStat,
   most noticably it does not namespace the path or convert
   it to UTF-16 before using it with std::filesystem::path
   on Windows which could crash on non-English locale.
2. It needs the Environment - if not for decoding the string,
   at least for env->exec_path() to resolve the path for
   namespacing - and therefore needs a handle to the Context
   which requires a handle scope which actually makes the
   fast API version slower than the normal binding.

For simplicity this just removes the fast API to fix the bug and
improve the performance.

PR-URL: nodejs#58489
Backport-PR-URL: nodejs#59065
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
PR-URL: nodejs#58896
Backport-PR-URL: nodejs#59065
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
@aduh95 aduh95 force-pushed the v22.x-backport-fast-api-changes branch from 48174f1 to 6905258 Compare July 28, 2025 06:59
@aduh95
Copy link
Contributor

aduh95 commented Jul 28, 2025

Landed in 2fc8989...6905258

@aduh95 aduh95 merged commit 6905258 into nodejs:v22.x-staging Jul 28, 2025
19 checks passed
@Renegade334 Renegade334 deleted the v22.x-backport-fast-api-changes branch July 28, 2025 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. v22.x Issues that can be reproduced on v22.x or PRs targeting the v22.x-staging branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants