GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — module: prevent `format` from being set to `null` internaly by avivkeller · Pull Request #53015 · nodejs/node Conversation
|
|
Review requested:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
format from being nullformat from being set to null internaly
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The reason for this is to simplify tests. The format value might be null or it might be undefined based on arbitrary things like which code path is followed. Our internal code is careful to do loose tests like format == null to account for format being either null or undefined, but not all the tests are so loose. Eliminating null from the potential possibilities means that our tests can remain precise while not breaking as we refactor code paths. The internal conditions will remain loose so that user hooks can still set format: null.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
https://github.com/nodejs/node/blob/main/doc/api/module.md needs updating too, the various lines like this: * `format` {string|null|undefined} The format optionally supplied by the `resolve` hook chain To remove |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
IIUC, before this change, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I accidentally found this PR and looked a bit into the details (might still miss something). But iiuc the goal of the module detection is to allow I can have a look and open a PR if I find a solution. I agree that cc: @aduh95, @GeoffreyBooth |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
#53016 has some more information, but essentially, in the end, we want it to default to CJS, but it defaults to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I disagree this simplifies anything, let's not land this – it'd be a small breaking change, but still a breaking change, and we should have some justification for breaking things
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I was actually planning on closing this favor of another PR (I need to find it then I'll link it) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.