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 — Replace vague 'may not' with definitive 'will not' by mikemaccana · Pull Request #23143 · nodejs/node

Conversation

@mikemaccana

@mikemaccana mikemaccana commented Sep 28, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

This vagueness of 'may' has caused a great deal of confusion. See https://stackoverflow.com/questions/8887318/understanding-node-js-modules-multiple-requires-return-the-same-object

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.

All reactions
Mike MacCana
Replace vague 'may not' with definitive 'will not'
f4d400d
This vagueness of 'may' has caused a great deal of confusion. See https://stackoverflow.com/questions/8887318/understanding-node-js-modules-multiple-requires-return-the-same-object
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. module Issues and PRs related to the module subsystem. labels Sep 28, 2018
addaleax
addaleax approved these changes Sep 28, 2018
View reviewed changes
cjihrig
cjihrig approved these changes Sep 28, 2018
View reviewed changes
BridgeAR
BridgeAR approved these changes Sep 28, 2018
View reviewed changes
@vsemozhetbyt vsemozhetbyt added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 28, 2018
@vsemozhetbyt

vsemozhetbyt commented Sep 28, 2018

Copy link
Copy Markdown
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1050/

(Not sure why CI shows different commit though)

All reactions

Sorry, something went wrong.

Uh oh!

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

@vsemozhetbyt

vsemozhetbyt commented Sep 28, 2018

Copy link
Copy Markdown
Contributor

Node.js Collaborators, please, add 👍 here if you approve fast-tracking.

lpinca reacted with thumbs up emoji refack reacted with thumbs down emoji
All reactions
  • 👍 1 reaction
  • 👎 1 reaction

Sorry, something went wrong.

Uh oh!

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

@richardlau

richardlau commented Sep 28, 2018

Copy link
Copy Markdown
Member

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1050/

(Not sure why CI shows different commit though)

image

If you're referring to ea008c89204368d6534b1690a3fd99ed7976c9d2 (f4d400d02167747d4de3967589294fad1948fe31 is the commit for this PR) then it refers to the commit of the build repository that is used for the pipeline (we're storing the definition for the pipeline in the build repository, in this case https://github.com/nodejs/build/blob/ea008c89204368d6534b1690a3fd99ed7976c9d2/jenkins/pipelines/node-test-pull-request-lite-pipeline.jenkinsfile).

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

lpinca
lpinca approved these changes Sep 28, 2018
View reviewed changes
@refack

refack commented Sep 28, 2018

Copy link
Copy Markdown
Contributor

/CC @nodejs/modules

All reactions

Sorry, something went wrong.

Uh oh!

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

@jdalton

jdalton commented Sep 28, 2018

Copy link
Copy Markdown
Member

The may not is hinting at something that could be clarified in a more explicit way.
Which is that multiple calls to require('foo') will not cause the module code to be
executed multiple times unless it is removed from the module cache.

refack, Fishrock123, and ljharb reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

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

@Fishrock123

Fishrock123 commented Sep 28, 2018

Copy link
Copy Markdown
Contributor

It could potentially be clarified that this will not happen under default circumstances. Once you modify the require cache all bets are off.

ljharb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

ljharb
ljharb reviewed Sep 28, 2018
View reviewed changes
Comment thread doc/api/modules.md Outdated
exactly the same object returned, if it would resolve to the same file.

Multiple calls to `require('foo')` may not cause the module code to be
Multiple calls to `require('foo')` will not cause the module code to be

@ljharb ljharb Sep 28, 2018

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.

It’s “may” because someone could have deleted it from require.cache - i think “will” is incorrect.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mikemaccana
Mention modules will load once by default.
cb473e7
mikemaccana
mikemaccana commented Sep 28, 2018
View reviewed changes

@mikemaccana mikemaccana left a comment

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.

Updated as requested

Sorry, something went wrong.

Uh oh!

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

All reactions
@mikemaccana
Damn typo
43e4208
mikemaccana
mikemaccana commented Sep 28, 2018
View reviewed changes

@mikemaccana mikemaccana left a comment

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.

Typo.

Sorry, something went wrong.

Uh oh!

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

All reactions
@mikemaccana

mikemaccana commented Sep 28, 2018

Copy link
Copy Markdown
Contributor Author

Updated per @Fishrock123 - now it's more specific:

By default (provided the require.cache is not modified), multiple calls to executed multiple times. This is an important feature. With it, require('foo') will not cause the module code to be executed multiple times.

All reactions

Sorry, something went wrong.

Uh oh!

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

Trott
Trott reviewed Sep 28, 2018
View reviewed changes
Comment thread doc/api/modules.md Outdated
executed multiple times. This is an important feature. With it,
"partially done" objects can be returned, thus allowing transitive
dependencies to be loaded even when they would cause cycles.
By default (provided the `require.cache` is not modified), multiple calls to

@Trott Trott Sep 28, 2018

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.

Optional nit: Get rid of By default and the parentheses:

Provided `require.cache` is not modified, multiple calls to

I'm fine with it the way it is but I think that change makes it a tiny bit more clear.

Sorry, something went wrong.

Uh oh!

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

refack, trivikr, mcollina, and sendilkumarn reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
jdalton
jdalton approved these changes Sep 28, 2018
View reviewed changes
vsemozhetbyt
vsemozhetbyt reviewed Sep 29, 2018
View reviewed changes
Comment thread doc/api/modules.md Outdated
By default (provided the `require.cache` is not modified), multiple calls to
`require('foo')` will not cause the module code to be executed multiple times.

This is an important feature. With it, "partially done" objects can be returned,

@vsemozhetbyt vsemozhetbyt Sep 29, 2018

Copy link
Copy Markdown
Contributor

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 line has trailing space and exceeds the limit of 80 characters producing linter issue.

Sorry, something went wrong.

Uh oh!

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

All reactions
xtuc
xtuc approved these changes Sep 29, 2018
View reviewed changes
mcollina
mcollina approved these changes Sep 29, 2018
View reviewed changes

@mcollina mcollina left a comment

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.

LGTM with @Trott nit.

Sorry, something went wrong.

Uh oh!

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

All reactions
benjamingr
benjamingr approved these changes Sep 29, 2018
View reviewed changes
thefourtheye
thefourtheye approved these changes Sep 29, 2018
View reviewed changes
sendilkumarn
sendilkumarn approved these changes Sep 29, 2018
View reviewed changes
@trivikr trivikr removed the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 30, 2018
trivikr
trivikr approved these changes Sep 30, 2018
View reviewed changes

@trivikr trivikr left a comment

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.

LGTM.
Removing author ready label as there are some outstanding comments

Sorry, something went wrong.

Uh oh!

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

All reactions
Trott added 3 commits September 30, 2018 09:37
@Trott
Update modules.md
93b7750
@Trott
Update modules.md
58e2fee
@Trott
Update modules.md
f4bdf88
@Trott Trott added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 30, 2018
@Trott

Trott commented Sep 30, 2018

Copy link
Copy Markdown
Member

Since the comments were rather minor (remove a space here, optionally change wording there), I did them rather than waiting for OP to do it and have restored the author ready label.

All reactions

Sorry, something went wrong.

Uh oh!

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

@mikemaccana

mikemaccana commented Sep 30, 2018 via email

Copy link
Copy Markdown
Contributor Author
Thanks Rich! I can enjoy the rest of my weekend 😀
…
On Sun, 30 Sep 2018 at 5:43 pm, Rich Trott ***@***.***> wrote: Since the comments were rather minor (remove a space here, optionally change wording there), I did them rather than waiting for OP to do it and have restored the author ready label. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#23143 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAKiMh16ZcGm-8XxDsho6Kc6qNL8Ajh7ks5ugPS2gaJpZM4W-TUm> .
All reactions

Sorry, something went wrong.

Uh oh!

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

@trivikr

trivikr commented Oct 1, 2018

Copy link
Copy Markdown
Member

CI Lite: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1091/

All reactions

Sorry, something went wrong.

Uh oh!

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

trivikr
trivikr approved these changes Oct 1, 2018
View reviewed changes
@trivikr

trivikr commented Oct 1, 2018

Copy link
Copy Markdown
Member

Landed in a82ac6e

All reactions

Sorry, something went wrong.

Uh oh!

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

@trivikr trivikr closed this Oct 1, 2018
trivikr pushed a commit that referenced this pull request Oct 1, 2018
Mike MacCana @trivikr
Replace vague 'may not' with definitive 'will not'
a82ac6e
This vagueness of 'may' has caused a great deal of confusion.
See https://stackoverflow.com/questions/8887318

PR-URL: #23143
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
targos pushed a commit that referenced this pull request Oct 3, 2018
Mike MacCana @targos
Replace vague 'may not' with definitive 'will not'
39e3ef7
This vagueness of 'may' has caused a great deal of confusion.
See https://stackoverflow.com/questions/8887318

PR-URL: #23143
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: John-David Dalton <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@targos targos mentioned this pull request Oct 7, 2018
Release proposal: v10.12.0 #23313
Merged
This was referenced Oct 10, 2018
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#225
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#239
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#226
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#240
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#227
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#241
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#242
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#228
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#243
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#229
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ljharb ljharb ljharb left review comments
@Trott Trott Trott left review comments
@mcollina mcollina mcollina approved these changes
@addaleax addaleax addaleax approved these changes
@benjamingr benjamingr benjamingr approved these changes
@lpinca lpinca lpinca approved these changes
@cjihrig cjihrig cjihrig approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
@trivikr trivikr trivikr approved these changes
+5 more reviewers
@vsemozhetbyt vsemozhetbyt vsemozhetbyt left review comments
@jdalton jdalton jdalton approved these changes
@thefourtheye thefourtheye thefourtheye approved these changes
@xtuc xtuc xtuc approved these changes
@sendilkumarn sendilkumarn sendilkumarn approved these changes
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

author ready PRs with CI started, the required approvals, and no outstanding review comments. doc Issues and PRs related to Node.js documentation. module Issues and PRs related to the module subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

19 participants

@mikemaccana @vsemozhetbyt @richardlau @refack @jdalton @Fishrock123 @Trott @trivikr @ljharb @mcollina @thefourtheye @addaleax @benjamingr @lpinca @xtuc @cjihrig @BridgeAR @sendilkumarn @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 01402775 — 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.