GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: add option to silence warnings by PoojaDurgad · Pull Request #36137 · nodejs/node

Conversation

@PoojaDurgad

@PoojaDurgad PoojaDurgad commented Nov 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Introduce an option --suppress-warnings to silence experimental and deprecation warnings for specified features

Fixes: #30810

Co-Authored-By: Cody Deckard [email protected]

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss, rulatir, karlhorky, kachkaev, christian-bromann, and mikicho reacted with thumbs up emoji
All reactions
  • 👍 6 reactions
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. util Issues and PRs related to the built-in util module. labels Nov 16, 2020
@benjamingr

benjamingr commented Nov 16, 2020

Copy link
Copy Markdown
Member

Why?

sapegin reacted with thumbs down emoji
All reactions
  • 👎 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Nov 16, 2020

Copy link
Copy Markdown
Contributor

Why?

There is prior discussion in #30810 and #31000.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@benjamingr

benjamingr commented Nov 16, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@cjihrig in that case this PR goes against the TSC consensus discussed in the PR?

Edit: Oh I see this allows disabling the warning for a specific feature and not all features.

sapegin reacted with thumbs down emoji
All reactions
  • 👎 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cjihrig

cjihrig commented Nov 16, 2020

Copy link
Copy Markdown
Contributor

I haven't reviewed this PR yet, but IIRC, the idea was that we could support silencing specific warnings, not just experimental warnings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mscdex
mscdex reviewed Nov 16, 2020
View reviewed changes
Comment thread lib/internal/util.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

mscdex
mscdex reviewed Nov 16, 2020
View reviewed changes
Comment thread doc/api/cli.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Nov 16, 2020

Copy link
Copy Markdown
Contributor

It looks like this option doesn't allow specifying multiple features, is this intentional?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PoojaDurgad
PoojaDurgad force-pushed the exp-warning branch from a13be9c to e1123e3 Compare November 17, 2020 07:07
@PoojaDurgad

PoojaDurgad commented Nov 18, 2020

Copy link
Copy Markdown
Contributor Author

I'm working to address the issues.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell requested changes Nov 19, 2020
View reviewed changes

@jasnell jasnell left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Any process.emitWarning() may include a code option.

Rather than introducing a new cli option just to disable experimental warnings, we should extend the existing --no-warnings to allow silencing specific codes:

$ node --no-warnings=EXP001,DEP002

Or, by warning type:

$ node --no-warnings=ExperimentalWarning,DeprecationWarning

Note: We do not currently assign individual codes to experimental warnings. We should start doing so.

Additionally, the way this PR makes the change, experimental warnings would not be emitted to the process.on('warning') event, which is a mistake. The existing --no-warnings flag will only suppress the default action of printing warnings to stderr but those will still be emitted to process.on('warning'). This is intentional behavior that should be preserved here as well.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

BridgeAR, benjamingr, maxwellium, and johnnybenson reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
@PoojaDurgad
PoojaDurgad force-pushed the exp-warning branch 2 times, most recently from 576772c to ccef73c Compare November 20, 2020 08:00
@PoojaDurgad PoojaDurgad changed the title Add an option to silence experimental-warnings lib: add option to silence warnings Nov 20, 2020
@PoojaDurgad

PoojaDurgad commented Nov 20, 2020

Copy link
Copy Markdown
Contributor Author

@mscdex , @jasnell , @benjamingr - I pushed some changes . please have a look.

  • Introduced new flag --suppress-warnings
  • Introduced codes for experimental warnings.
  • Enabled the flag to take multiple codes.
  • Adjusted tests to the changes.
  • Added a test.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PoojaDurgad @codeman869
lib: add option to silence warnings
d9a04a9
Introduce an option `--suppress-warnings`
to silence experimental and deprecation
warnings for specified features

Fixes: nodejs#30810

Co-Authored-By: Cody Deckard <[email protected]>
@PoojaDurgad
PoojaDurgad force-pushed the exp-warning branch from ccef73c to d9a04a9 Compare December 23, 2020 09:27
aduh95
aduh95 approved these changes Dec 29, 2020
View reviewed changes
jasnell
jasnell reviewed Dec 29, 2020
View reviewed changes
Comment thread doc/api/cli.md Outdated
added: REPLACEME
-->

Silence deprecation and experimental warnings for specified codes.

@jasnell jasnell Dec 29, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

What's the difference between this and the existing --no-warnings flag?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PoojaDurgad PoojaDurgad Dec 30, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@jasnell - I have introduced the new flag --suppress-warnings and also introduced codes for experimental warnings which enables this flag to silence the experimental and deprecation warnings for supplied codes. The idea is to support silencing warnings for experimental and deprecation warnings and enabled the flag to take multiple codes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Dec 31, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Yes, and what I'm saying is that the --no-warnings flag can just be extended to support this without introducing a new flag. --no-warnings (with no arguments) would continue to work as it does today, while --no-warnings={list of codes} would suppress the named codes. In either case, the documentation here should indicate that the flag takes a list of codes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PoojaDurgad PoojaDurgad Jan 1, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@jasnell - well instead of introducing new cli option we can extend the existing --no-warnings option right . yeah I understood and thanks for the review.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasnell
jasnell requested changes Dec 29, 2020
View reviewed changes
Comment thread lib/internal/util.js
});
if (found) return;

const msg = `[${code}] ${feature} is an experimental feature. ` +

@jasnell jasnell Dec 29, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This is not the right way to include the code. The emitWarning api already has an option for including the code correctly. Also, I would add this check into the emitWarning processing so it can be applied generically to all warning types.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Dec 31, 2020

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Not sure why this comment was marked resolved as the issue is still there.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PoojaDurgad PoojaDurgad Jan 1, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

without knowing, it was marked as resolved

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@PoojaDurgad PoojaDurgad Jan 1, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@jasnell - I have a doubt , can you confirm one thing please , the experimental warning vm.measureMemory API calls emitExperimentalWarning like this emitExperimentalWarning('vm.measureMemory');

node/lib/vm.js

Line 390 in 22293ea

emitExperimentalWarning('vm.measureMemory');
so the function takes a string and it matches with the function emitExperimentalWarning(feature) like this

node/lib/internal/util.js

Line 188 in 51b4367

function emitExperimentalWarning(feature) {
so if I'm not wrong this call does not include an option for codes. If the above file modification is not the right way to include the code, then how to do that? can you suggest me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@PoojaDurgad
lib : resolved conflict files
22e6c16
@PoojaDurgad
PoojaDurgad marked this pull request as draft February 4, 2021 05:37
PoojaDurgad added 6 commits February 3, 2021 21:45
@PoojaDurgad
fixup: resolve git conflicts in doc/node.1
a6959ae
@PoojaDurgad
fixup: modified 2 files
ad00075
@PoojaDurgad
fixup: deleted 2 files
a8e4cef
@PoojaDurgad
fixup: modify testcase
7fed8b2
@PoojaDurgad
fixup: remove test
116efef
@PoojaDurgad
fixup: fix lint errors
66e4a66
@guybedford
guybedford force-pushed the master branch from dc5a5da to 8e46568 Compare March 29, 2021 21:33
@cjihrig cjihrig mentioned this pull request Oct 24, 2021
feat: add process.env.NODE_TLS_WARN_ON_UNAUTHORIZED to silence https warning #40587
Closed
@martinmunillas

martinmunillas commented Oct 24, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

@PoojaDurgad are you willing to keep working on this?, I ask because is something I'm interested in too and i would be glad to help

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tniessen tniessen mentioned this pull request Nov 23, 2021
Suppress specific warnings #40940
Closed
@Trott
Trott force-pushed the main branch from 2d76238 to ca3ed36 Compare November 12, 2022 01:49
@bnoordhuis

bnoordhuis commented Feb 27, 2023

Copy link
Copy Markdown
Member

I'm going to close this because the pull request has a great many conflicts and because the requested feature from #30810 has been implemented but thanks anway, @PoojaDurgad, it's much appreciated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bnoordhuis bnoordhuis closed this Feb 27, 2023
@karlhorky karlhorky mentioned this pull request Feb 27, 2023
Ability to suppress warnings by type (or just experimental warnings) #30810
Closed
@karlhorky karlhorky mentioned this pull request Apr 8, 2023
Ability to suppress warnings by type #47478
Closed
@haidaqn

haidaqn commented Oct 18, 2023

Copy link
Copy Markdown

I am getting this error when integrating nextjs 13 with clerk and using node 16.13.0 : " ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use node --trace-warnings ... to show where the warning was created) "

sapegin reacted with thumbs down emoji
All reactions
  • 👎 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ethan-Arrowood Ethan-Arrowood mentioned this pull request Nov 10, 2023
src: add --disable-warning option #50661
Merged
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell requested changes
@aduh95 aduh95 aduh95 approved these changes
+1 more reviewer
@mscdex mscdex mscdex left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. util Issues and PRs related to the built-in util module.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Ability to suppress warnings by type (or just experimental warnings)

Uh oh!

There was an error while loading. Please reload this page.

10 participants

@PoojaDurgad @benjamingr @cjihrig @mscdex @martinmunillas @bnoordhuis @haidaqn @jasnell @aduh95 @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.