Title: Divergent specifier hazard · Issue #371 · nodejs/modules · GitHub
Open Graph Title: Divergent specifier hazard · Issue #371 · nodejs/modules
X Title: Divergent specifier hazard · Issue #371 · nodejs/modules
Description: @jkrems and I created a repo to demonstrate the hazard mentioned by @MylesBorins in #273 (comment) and #273 (comment) where a single specifier resolves to separate things in ESM and CommonJS environments within the same runtime. This haz...
Open Graph Description: @jkrems and I created a repo to demonstrate the hazard mentioned by @MylesBorins in #273 (comment) and #273 (comment) where a single specifier resolves to separate things in ESM and CommonJS enviro...
X Description: @jkrems and I created a repo to demonstrate the hazard mentioned by @MylesBorins in #273 (comment) and #273 (comment) where a single specifier resolves to separate things in ESM and CommonJS enviro...
Opengraph URL: https://github.com/nodejs/modules/issues/371
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Divergent specifier hazard","articleBody":"@jkrems and I created a [repo](https://github.com/jkrems/singleton-issue) to demonstrate the hazard mentioned by @MylesBorins in https://github.com/nodejs/modules/issues/273#issuecomment-492355098 and https://github.com/nodejs/modules/issues/273#issuecomment-492408041 where a single specifier resolves to separate things in ESM and CommonJS environments within the same runtime. This hazard is currently blocking dual packages, and logically would also block `--es-module-specifier-resolution=node` from becoming the default behavior.\r\n\r\nHopefully the repo illustrates the issue clearly enough that everyone can get a solid grasp on it. It seems to me that we have three options:\r\n\r\n1. Accept that the hazard is a serious concern and that it therefore rules out supporting dual packages and automatic extension resolution. The current modules implementation is what ships with regard to those two features, and presumably we would remove the `--es-module-specifier-resolution` flag (since arguably the flag’s existence invites users to stumble into the hazard).\r\n\r\n1. Acknowledge the hazard but decide that user education can overcome it. @MylesBorins and others concerned about the hazard would need to be persuaded as to why it isn’t a blocker, especially considering that it’s [already come up in the real world](https://github.com/graphql/graphql-js/issues/1479#issuecomment-416718578). If the persuasion effort succeeds, we would then need to decide how far to lean into enabling features that invite the hazard (such as automatic extension resolution and dual packages).\r\n\r\n1. Find a technical solution to prevent the hazard, such as making `require` of ESM work in a way that everyone is comfortable with (cc @weswigham). As with the previous option, we would then need to decide whether or not to support dual packages and/or automatic extension resolution.\r\n\r\nDeciding on any of these options would lead to a resolution of the dual packages item in [Phase 3 of our roadmap](https://github.com/nodejs/modules/blob/master/doc/plan-for-new-modules-implementation.md#in-progress).","author":{"url":"https://github.com/GeoffreyBooth","@type":"Person","name":"GeoffreyBooth"},"datePublished":"2019-08-14T06:32:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":64},"url":"https://github.com/371/modules/issues/371"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a663e3bb-ce7d-0926-268e-d7d21e7d83a1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BEA4:38840C:E3438C:134E70D:6A4D5E7D |
| html-safe-nonce | ad70e2d8ac28167faff7a0db6f19624efc656b2d76e3abe42af80d130401b151 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRUE0OjM4ODQwQzpFMzQzOEM6MTM0RTcwRDo2QTRENUU3RCIsInZpc2l0b3JfaWQiOiI4MzMxNjI4MzE5OTM0ODY1MDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 10722c4a90468799215e47dad9d6e86a9082ca43636aafce6e4ece879d73619e |
| hovercard-subject-tag | issue:480504681 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/modules/371/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4887cb18acd1c046f6077efc3cfc216c87ba81d399bf6e4a3afd529c65ce5e18/nodejs/modules/issues/371 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4887cb18acd1c046f6077efc3cfc216c87ba81d399bf6e4a3afd529c65ce5e18/nodejs/modules/issues/371 |
| og:image:alt | @jkrems and I created a repo to demonstrate the hazard mentioned by @MylesBorins in #273 (comment) and #273 (comment) where a single specifier resolves to separate things in ESM and CommonJS enviro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | GeoffreyBooth |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2a1443ff9733a3016431263ea73c93d8fe00c195eb4a7670ac30e7848f045441 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/modules git https://github.com/nodejs/modules.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 119901830 |
| octolytics-dimension-repository_nwo | nodejs/modules |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 119901830 |
| octolytics-dimension-repository_network_root_nwo | nodejs/modules |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f3bdd3157ea1f0fd738d408eceeead721acf1dc3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width