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

fix: disable deprecation warnings #1971

Merged
merged 11 commits into from
Dec 3, 2024
Merged

fix: disable deprecation warnings #1971

merged 11 commits into from
Dec 3, 2024

Conversation

cristiand391
Copy link
Member

What does this PR do?

Disables deprecation warnings by passing in the --no-deprecation flag to node
forcedotcom/cli#2535

--no-deprecation:
https://nodejs.org/api/cli.html#--no-deprecation

Why not use --disable-warning= DEP0040 to only disable the punycode deprecation warning?
--disable-warning was added in node v21, we still support node v18 so we can't use that flag yet.

Setting it dynamically like in the block above doesn't work because NODE_OPTIONS is expected to be set before the node process starts.

if (process.version.startsWith('v22') {
  process.env.NODE_OPTIONS = '--disable-warning= DEP0040'
}

https://nodejs.org/docs/latest-v22.x/api/cli.html#--disable-warningcode-or-type
https://nodejs.org/api/deprecations.html#dep0040-nodepunycode-module

Acceptance Criteria

How do you know this change is successful? What is the scope of this change? What tests test the criteria (or why no tests)?

The Acceptance Criteria can be copied from the work item if they exist there but it is useful to have on the PR when reviewing the code.

Testing Notes

run commands via bin/run on node v18, v22 and v23, see there's no deprecation warnings from punycode usage.

What issues does this PR fix or reference?

@W-17013195@

shetzel
shetzel previously approved these changes Nov 26, 2024
@shetzel
Copy link
Contributor

shetzel commented Dec 3, 2024

Tested with node versions: 18.20.4, 20.14.0, 22.2.0, 23.3.0 and didn't see the deprecation warnings.

@shetzel shetzel merged commit 681302a into main Dec 3, 2024
33 checks passed
@shetzel shetzel deleted the cd/hide-deprecation-warning branch December 3, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants