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

Silence potentially upcoming circular dependency warning #973

Merged
merged 1 commit into from Oct 20, 2019

Conversation

@addaleax
Copy link
Contributor

@addaleax addaleax commented Oct 18, 2019

Node.js is currently considering printing a warning when a non-existent
property of module.exports is accessed while in a circular require()
dependency, in order to make it easier to catch issues with circular
dependencies.

In order to avoid printing these warnings for shelljs, checking for the
property’s existence rather than its truthiness suffices.

Refs: nodejs/node#29935

Node.js is currently considering printing a warning when a non-existent
property of `module.exports` is accessed while in a circular `require()`
dependency, in order to make it easier to catch issues with circular
dependencies.

In order to avoid printing these warnings for shelljs, checking for the
property’s existence rather than its truthiness suffices.

Refs: nodejs/node#29935
@addaleax
Copy link
Contributor Author

@addaleax addaleax commented Oct 18, 2019

Also: I’d understand if you don’t like this PR, because the previous code was perfectly fine.

I’m trying to implement this warning in Node.js because I believe that, in the big picture, it helps debug hard problems more than it annoy people – I’d guess that circular dependencies might have tripped you up in the past, too. If you have any feedback about the Node.js PR in general, please feel free to voice it there.

@codecov-io
Copy link

@codecov-io codecov-io commented Oct 18, 2019

Codecov Report

Merging #973 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #973   +/-   ##
=======================================
  Coverage   97.14%   97.14%           
=======================================
  Files          34       34           
  Lines        1298     1298           
=======================================
  Hits         1261     1261           
  Misses         37       37
Impacted Files Coverage Δ
src/common.js 98.46% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9aef002...a6bb08e. Read the comment docs.

Copy link
Member

@nfischer nfischer left a comment

This change seems fine, I don't think we need to be worried about inheritance.

@nfischer nfischer merged commit 05374a7 into shelljs:master Oct 20, 2019
2 checks passed
@addaleax addaleax deleted the no-circ-dep-warning branch Oct 23, 2019
nfischer added a commit that referenced this issue Apr 25, 2020
Node.js is currently considering printing a warning when a non-existent
property of `module.exports` is accessed while in a circular `require()`
dependency, in order to make it easier to catch issues with circular
dependencies.

In order to avoid printing these warnings for shelljs, checking for the
property’s existence rather than its truthiness suffices.

Refs: nodejs/node#29935
nfischer pushed a commit to shelljs/shx that referenced this issue Aug 4, 2020
shelljs/shelljs#973 updated shelljs to prevent
Node 14 from emitting circular dependency warnings.
nfischer added a commit that referenced this issue Oct 26, 2020
This adds testing for node v14. This removes testing for node v6 and v7
because codecov breaks on these versions. This omits node v15 because
appveyor doesn't seem to support this version. The nodejs org currently
supports [10, 12, 14, 15].

This makes a couple minor edits to the check-node-support script for
consistency with shelljs/shx#186.

This bumps the shx dependency because it seems we're hitting issue #973
on node v14.

Test: npm run check-node-support
nfischer added a commit that referenced this issue Oct 26, 2020
This adds testing for node v14. This removes testing for node v6 and v7
because codecov breaks on these versions. This omits node v15 because
appveyor doesn't seem to support this version. The nodejs org currently
supports [10, 12, 14, 15].

This makes a couple minor edits to the check-node-support script for
consistency with shelljs/shx#186.

This bumps the shx dependency because it seems we're hitting issue #973
on node v14.

Test: npm run check-node-support
@nfischer nfischer added this to the v0.8.4 milestone Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants