Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: remove --no-experimental-global-webcrypto flag #46079

Closed
wants to merge 2 commits into from

Conversation

panva
Copy link
Member

@panva panva commented Jan 3, 2023

Removes the --no-experimental-global-webcrypto flag and moves the global definitions to internal/bootstrap/browser.

@panva panva added crypto Issues and PRs related to the crypto subsystem. cli Issues and PRs related to the Node.js command line interface. webcrypto labels Jan 3, 2023
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/startup

@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. labels Jan 3, 2023
@panva
Copy link
Member Author

panva commented Jan 3, 2023

@aduh95 what is the semverness of this change? We've only made the webcrypto api global (and stable) by default in 19.x onward.

Also, should process.config.variables.node_no_browser_globals continue to affect the globals within internal/bootstrap/browser?

@panva panva added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2023
@nodejs-github-bot

This comment was marked as outdated.

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

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

I'm not sure we should rush it, unless having the flag is blocking something else.

src/node_options.cc Show resolved Hide resolved
@aduh95 aduh95 added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 3, 2023
@aduh95
Copy link
Contributor

aduh95 commented Jan 3, 2023

Also, should process.config.variables.node_no_browser_globals continue to affect the globals within internal/bootstrap/browser?

Yes, as it simplifies the job of embedders such as Electron that expose browser globals from another runtime such as Chromium. It's being taken care of by

node/src/node_realm.cc

Lines 226 to 231 in 4310522

if (!env_->no_browser_globals()) {
result = ExecuteBootstrapper("internal/bootstrap/browser");
if (result.IsEmpty()) {
return MaybeLocal<Value>();
}

@panva panva added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jan 3, 2023
@nodejs-github-bot

This comment was marked as outdated.

@panva panva added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 4, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 4, 2023
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@panva
Copy link
Member Author

panva commented Jan 9, 2023

I'm not sure we should rush it, unless having the flag is blocking something else.

It's probably just blocking the TODO so that pre_execution could get cleaned up.

If that's not a pressing issue I propose we alias the flag as --no-global-webcrypto in 19.x and remove the unstable documentation around the flag instead.

WDYT?

@aduh95
Copy link
Contributor

aduh95 commented Jan 9, 2023

I think we need to keep the flag as experimental and get rid of it in the near future, if we remove the experimental part of it, we would have to go through a full deprecation cycle.

While the WebCrypto implementation itself is robust, and deserves to be called stable, the --eval and --print integration (that keeps globalThis.crypto as referring to WebCrypto but introduces a local crypto that refers to node:crypto) is much less so, and still quite new, I think we should leave an escape hatch for a little longer.

I would do that for 21.x or 22.x, so in case the current implementation breaks someone's code, they have a full LTS cycle to adapt and can use the flag to unblock them in the mean time.

@panva
Copy link
Member Author

panva commented Jan 9, 2023

Very well. I did not think of the CLI flag itself as experimental. I'll revisit this before 21 or 22.

@panva panva closed this Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. crypto Issues and PRs related to the crypto subsystem. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. semver-major PRs that contain breaking changes and should be released in the next major version. webcrypto
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants