-
Notifications
You must be signed in to change notification settings - Fork 97
Consider additive systems for importing ES Modules #56
Comments
I'm sure you mean well but there's a lot of context behind the decisions to go for Removing |
@jkrems To counter your point, there's also context for why many developers feel this is a poor design decision. I personally feel that Node loses empathy, by continually dismissing counter-points to this effect. If you need proof that it's possible to avoid MJS with ESM, look no further than Google Chrome or @jdalton's I find it disappointing that we can't even have this conversation here, in a fork, designed to invite empathy and community. I implore you to rethink how you address this issue with this in mind. It is fundamentally wrong and irritating to hear that My question to Node and to you @jkrems is if you've asked developers what they want? Do they want fragmentation or do they want unity at the expense of edge case issues? |
It's a little tongue-in-cheek after a discussion at work, but at the same time, my naive impression is that there may be alternative solutions worth considering that mitigate some of the issues with I wasn't opening this with any expectation that you would change anything here, and, you're right, this discussion has been discussed ad nauseam on the Node.js project. I don't know all of the goals of Ayo, but I bet if some smart people got together to discuss an alternative to One thing I think would be cool would be to consider what it'd look like to begin planning for a breaking change where Feel free to close this if you'd like @jkrems, but I do think Ayo provides a compelling place for an And, who knows, maybe a really good |
I agree (even though I hardly speak for ayo)! :) But to paraphrase my favorite Hearthstone streamer: "If you suggest to add a card, you need to suggest to remove a card". Otherwise every decisions seems way easier than it actually is. There definitely are ways to get rid of
I'd personally be fine with dropping all module resolution, dropping support for |
That's a totally valid consideration, but "ew, a new file extension" isn't as bad as "i can't use modules because i don't have a package.json". |
@ljharb a Node flag is completely out of the question because....? |
@ljharb I'm already having to write ridiculous scripts to maintain parity with |
I think Watching things unfold over the last 2 years I was struck by how many issues come down to an unwillingness to budge on the part of __everyone__ (Node, TC39, browser reps, JS tooling, etc.). Meanwhile, I'm over here like... |
I don’t think Ayo should get rid of |
@jdalton DIdn't mean to sounds as if I'm not appreciating your work on But I do disagree that it allows people to "have their 🍰 and eat it too". I'd maybe call it "allow people to pick a different flavor of 🍰 and eat that". It's not like the unlockables are just pure additions w/o any downsides and some of them do exploit the fact that you're not bound to the existing module spec & implementations. E.g. exposing |
Coming from my side, userland package solution, I was surprised to see usage like
be so popular. That makes me think a Node/Ayo flag might be an acceptable route. One of the ways For example, take one of the unlockable @jkrems was picking at, source type pragmas (i.e.
It's still 🍰. Opting-in is the dev saying "Yes, I understand this thing may not be perfect, but it's good enough for my needs and I'm willing to accept any gotchas that might pop up." |
Wouldn't needing to do |
@Qard, what I proposed was a Under Once a script gets executed with I'd love for someone to refute why this is not an acceptable solution. |
Ah, missed that. So that require would create a Script type rather than Module type, therefore no access to es module syntax inside those? Seems reasonable. |
Imagine something like @tbranyen's solution, but with this additional roadmap: 1st major release: the I'd love to see modules become the default sometime, and I think a slow rollout like this makes it seem realistic. As a developer looking at this roadmap, I'd know how to plan and prepare for the eventual breaking change, well in advance. Ecosystem tools, like npm, might be able to do some things to ease the transition. The Perhaps something like:
I'm definitely not an expert on this subject, though, so there could be some issues with this suggestion. |
Note with this approach the Node core would have to remain CJS (in order to allow |
For fun, I'm going to try and implement my suggestion in Ayo. I've wanted a reason to explore the Node core and this is an interesting alternative to implement. I've already got some of this working (the code is so good this is straightforward to piece together). Not sure if I'll PR, but I'd like to try this out for a while to see how it breaks down. One change I'm making is |
I mean, Ayo really isn't constrained with user breakage they way Node is, so... migrating to module mode as a default is probably possible. It probably won't be nice either though - you'll end up running into code that refuses to run correctly just by using npm modules. As for flags, I'd suggest taking a look at nodejs/node-eps#62 - which will probably be pulled into Ayo at some point anyways once it lands in node, and would allow us to re-use some familiar options. Also do consider that in the future, loading WASM/WAST modules will likely be a thing, and the same issue will occur there. Node is very likely to extension-detect |
There are also discussions of loader hooks ala nodejs/node#15445 ; I would want strong discussions to take place around use cases since as @jdalton has stated, no one party seems to be satisfied by any of the approaches. As I have stated in nodejs/node-eps#60 , additive changes are welcome in Node as well. If either environment wishes to make breaking changes wrt the other or the web I would be hesitant to adopt things without very thorough discussions. |
@jmeas I would be hesitant to encourage such a broad change, almost everything on |
got a discord channel if people want to chat in there: https://discordapp.com/channels/350004786915180548/359451835779514378 |
@bmeck I tried accessing that url, but it just loads a blank page in discord asking me to add friends, do I need special access? |
@tbranyen How about https://discord.gg/QhR4JyZ? |
I think people want this
The text was updated successfully, but these errors were encountered: