-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Vote on ES module detection #5648
Comments
/cc @trevnorris @nodejs/ctc |
I'm a little concerned about this. There are a few too many externalities for this to be voted on strictly by Node.js contributors. |
@mikeal the determination is not solely based upon this, but I am having trouble since people continue to ask for a head count of votes. There also needs to be a clearer way to make decisions on highly debated topics. |
This is definitely true. But this is specifically within the Node.js project, we can't be expected to get an accurate vote or representation from outside of self-identified Node.js developers. This has a much broader effect than what I feel we have the capacity to represent. I understand the concern, and the complaints, and I also know that there is a lot of tension because of the feeling that TC39 is not representative of our interests, but I don't necessarily think that the solution is push forward with our own unrepresentative decisions. |
@mikeal the proposal has input from TC39 both ways, as well as input from those who are front end. What are you looking for in order to make this decision? If there is not a definitive requirement my request for a vote will still stand. Do we need to form a separate standards body prior to this decision? |
To note:
|
@bmeck yes, it has input from a broad base, but I would assume those voting here would have voting rights associating with their committer or TC membership status in Node.js Core, which is not as representative. |
@mikeal There's a misunderstanding of what a vote from the CTC represents in this case. We are voting on whether or not the implementation presented in the EP is an implementation node core is willing to adopt. Our vote does not directly reflect the ultimate decision of the TC39 spec, and if ultimately the spec were to deviate from the EP then we would work with it. We have received external requests on how node would like this implemented, and it is our responsibility to make sure our voice is heard. Especially in a change so substantial it will alter a basic component of the node ecosystem. These external requests have asked "what is an acceptable implementation for node?" This EP is the result of substantial discussion and debate. As such, we will not please everyone, but irregardless the external requests have a deadline and that is now. Again this is not authoritative or even irreversible but it is necessary. |
@bmeck (also /cc @ljharb), I remember that we tried to sum the proposals up at https://docs.google.com/spreadsheets/d/1aC2kPwpahPnTjFmfb9EL2hFoNl7NhRGbdh6UG3VG3XU. I hadn't been keeping an eye on this for some time, are there any new proposals that are not listed there, or is anything there out of date? |
An ideal outcome, in my opinion, is one where someone could write up a few straightforward instructions to follow that would encompass the "best practice" for using CJS and ES6 seamlessly, across browsers, node, build tools, and editors. In other words, I don't think it's important to please everyone - I just think it's important to the entire ecosystem that every corner of it shares a cohesive story, even if it's a bit less convenient for some. @ChALkeR I don't agree with some of the degree of the colors on there, but i think the list is complete and accurate otherwise. |
@trevnorris Definitely! i currently believe that a |
I prefer |
@trevnorris I piped in when that spreadsheet was created. Same with @ljharb I have disagreements on coloring, but those colors are vague and affected by subjective views sometimes. Note: All methods need a flag to state the mode of things coming in via Why is it down to these two options?Parsing mostly. One thing to note is that parsing is a big effect on the ecosystem mechanically, both JS and JSON parsing, and this kind of parsing is not typical of asset pipelines. NVM, rails asset pipelines, redirect rules, and various tools w/o parsers would struggle with these. JSON parsing is much more available and less of an impact in this regard, but it would still require a change in mentality for all tools currently based off file extensions.
Why keep
|
The emphasis should be on the second bullet point (EDIT: and considerations stated in the preceding paragraph). If those considerations make it unworkable, there you go. But the ambiguity argument is less compelling. Probably most ES6 modules will already organically include at least one Any of these solutions (file extension, The performance and toolchain issues should be the main reasons given against that idea. There's also an argument about ambiguity for humans about what type a file is, but that's also an issue with |
@JacksonTian The argument could boil down to "file extension" vs "package.json". If file extension wins then exactly what that file extension is can be bikeshed later. That aspect only affects the implementation details on our end. |
I probably won't be able to participate in the vote on today's CTC meeting but for the record, I think I prefer the file extension approach. If nothing else, it's easy to |
@nodejs/ctc ... TBH I do not yet fully grok enough of the details of the ES6 module system to feel comfortable voting on this issue so I'm going to abstain from voting. I'll have to spend a bit more time digging into the details on this. |
Closing given that this was discussed by the ctc and voted on. The result is that the CTC preferred the file extension approach. |
why not use .es as a ES modules file extension? |
In order for the EPS for ES modules to progress we need a definitive vote to choose between:
.jsm
package.json
fieldsmain
->module
for ES module entry pointmodules
to list all the.js
files in the package that should be treated as ES and not CJS.The full discussion is in nodejs/node-eps#3
A sidecar discussion specific to module detection is in nodejs/node-eps#13 (comment)
The text was updated successfully, but these errors were encountered: