Skip to content

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

Closed
panva wants to merge 2 commits into
nodejs:mainfrom
panva:remove-webcrypto-flag
Closed

cli: remove --no-experimental-global-webcrypto flag#46079
panva wants to merge 2 commits into
nodejs:mainfrom
panva:remove-webcrypto-flag

Conversation

@panva

@panvapanva commented Jan 3, 2023

Copy link
Copy Markdown
Member

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

@panvapanva 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
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @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 Jan 3, 2023
@panva

panva commented Jan 3, 2023

Copy link
Copy Markdown
MemberAuthor

@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
panvaforce-pushed the remove-webcrypto-flag branch from 3f0ed98 to d8edf03CompareJanuary 3, 2023 16:36
@panvapanva added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2023
@github-actionsgithub-actionsBot 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.

@aduh95aduh95 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadsrc/node_options.cc
@aduh95aduh95 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
Copy Markdown
Contributor

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>();
}

@panvapanva 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
panvaforce-pushed the remove-webcrypto-flag branch from 6c4fffa to c72ce95CompareJanuary 3, 2023 19:11
@panvapanva added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 4, 2023
@github-actionsgithub-actionsBot 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
Copy Markdown
Collaborator

@panva

panva commented Jan 9, 2023

Copy link
Copy Markdown
MemberAuthor

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
Copy Markdown
Contributor

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

panva commented Jan 9, 2023

Copy link
Copy Markdown
MemberAuthor

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

@panvapanva closed this Jan 9, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cliIssues and PRs related to the Node.js command line interface.commit-queue-squashAdd this label to instruct the Commit Queue to squash all the PR commits into the first one.cryptoIssues and PRs related to the crypto subsystem.lib / srcIssues and PRs related to general changes in the lib or src directory.needs-ciPRs that need a full CI run.semver-majorPRs 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.

3 participants

@panva@nodejs-github-bot@aduh95