-
Notifications
You must be signed in to change notification settings - Fork 43
Missed needed breaking change for 12.x #320
Comments
Also worth mentioning that since we have |
@MylesBorins are you suggesting removing the "type" field entirely? |
@ljharb no, removing the "throw" on require('thing.mjs') |
FWIW, it should also be non-breaking, IMO, to simply respect the |
The semantics and naming of the field aren't set in stone; i don't think it'd be a good idea for it to affect anything without the flag. |
It's worth noting the hazard also only exists within a package with For anyone unsure, the hazard is this:
Assuming Again, since |
@ljharb I think the cjs resolver behavior for |
I’m fine with this change. We need it if unflagging If we don’t end up shipping |
That wouldn't be great, since it introduces the same execution hazard I described above, but without ever opting into |
That hazard is the same one I was writing about in #317 (comment), about double instantiation. The tldr is basically that the user probably needs to go out of their way to cause the hazard, so it’s not worth trying to protect them against it. |
Not really. if I |
landed in d370d126c3 |
In a call with @weswigham today it became apparent that we likely should have unflagged throwing on
require('./path.mjs')
, as it is arguably a breaking change to require. I've opened a PR to get the behavior change landed ASAP as Semver-Patch... under the guise that this should have landed in 12.x... it is a stretch, but we should have this conversationnodejs/node#27417
The text was updated successfully, but these errors were encountered: