Minimum requirements for releasing new experimental features #45084
Replies: 10 comments 38 replies
-
I don't like the idea of full ESM being a hard gate for new features to land. Given it itself is still considered experimental, that's a moving target against another moving target. Perhaps we could clarify our stability ratings by marking anything stable in CJS and not in ESM specifically in docs, until they are fixed? That would make stability of those things not necessarily a blocker for ESM anymore while also allowing new development without necessarily needing to support ESM right away. We could also consider having ESM support as entry criteria for being marked as stable. This would allow us to keep up development velocity while still clearly communicating which parts of the system can be trusted. It also better models how experimental really works given that it's generally incompatibility with specific other subsystems that hold things back. For example, right now async_hooks and ESM are relatively in conflict due to a lack of development effort to solve the particular cases where they overlap. |
Beta Was this translation helpful? Give feedback.
-
I don't think full ESM support is a reasonable requirement for landing something experimental, in fact I don't think there should be any minimal requirement as long as the end goal is desirable, and attainable (which is left to best judgements of the reviewers). |
Beta Was this translation helpful? Give feedback.
-
There's a larger issue here that probably is healthy to spell out (especially if it turns out I'm wrong about seeing it this way): There are people (such as @GeoffreyBooth) who view ESM as something that should be embraced by users over CJS for a variety of reasons. The impression that I get is that Geoffrey and others expect (and want) ESM to become the standard and CJS to become the legacy thing that people mostly don't use anymore and you find only in old code. And there are people (such as @mcollina) who see CJS as the better option for many use cases and think that CJS should not be constrained by ESM limitations. The implication that I get is that to Matteo and others, CJS is unlikely to be completely replaced by ESM any time soon and that a dominant ESM module ecosystem (with very little in the way of new modules with CJS support being released) might even be undesirable. It's possible I've misstated the views, but broadly, it seems to me that these two camps have very different and contradictory goals for the medium term at least and it might be a good thing to figure out what the TSC and/or the project as a whole can agree on. |
Beta Was this translation helpful? Give feedback.
-
I think for every experimental new thing added we have three lifecycle phases to be concerned with: (1) Landing in main, (2) Released, (3) Supported/Graduated. For every experimental thing, it's reasonable to have objective criteria that must be met to progress through any of these transition points. However, I think those criteria should be taken on a case by case basis. Not every experimental feature will be relevant to both cjs and ESM. For instance, would we consider blocking an experimental addition to import.meta simply because it isn't relevant to cjs? That wouldn't make sense. When a new experimental feature is proposed, it's perfectly fine to say "Don't put this in an actual release until ..." Which gives us a natural deadline every six months. Either the experimental thing has progressed to the point that we are ok with it rolling automatically into the next major or we decide whether to pull it out because it hasn't progressed. Either way we have to make a decision. Which is good. |
Beta Was this translation helpful? Give feedback.
-
I would say that as long as the feature makes sense in node core and the PR also has docs and tests prepared, it's good to land and release, regardless of ESM support. ESM support can be added later on by anyone who feels strongly about it incrementally. |
Beta Was this translation helpful? Give feedback.
-
IMO, these can form a minimum requirements for experimental:
It is perfectly alright to ask for specific enhancements, and it should be perfectly alright to propose it to be enhanced later; those may be subjected to the willingness of the contributor. This approach aligns with the philosophy of |
Beta Was this translation helpful? Give feedback.
-
Part of this problems arises from the async_hooks:
In all intent and purposes async_hooks a stable and proven API. We cannot ship a Node runtime without it and avoide a massive uproar from our production users. Unfortunately, async_hooks is a complex API that we do not like. |
Beta Was this translation helpful? Give feedback.
-
I would hardly constraints anything landing as experimental. The most riskier features could be behind a flag. Others emit a warning, or even nothing. It really depends on the perceived risk. I would rather abstract the discussion from ESM. In broad terms, for any feature to graduate from experimental should not have major bugs and design flaws that prevent it to work with other features of Node.js. In case of features with broad ecosystem reach, some real-world usage is recommended too. |
Beta Was this translation helpful? Give feedback.
-
In the case of SynchronousWorker, just as an example, there was no "kicking the can down the road" for ESM support. I wanted to do it incrementally over multiple PRs to make it easier to review and easier to iterate on. I wanted the first PR to be as close as possible to the thing being vendored in so that it would be easier to review and reason about. I was already working on the necessary improvements for ESM support as a separate PR, and was also working on a couple other fixes. The intent was not to ignore esm at all, but to make it easier to review the set of changes and the evolution of the impl over multiple steps. Any discussion of whether esm is preferred, or mature enough, or whether we like it or not, etc is immaterial in my opinion. It's a supported feature of Node.js and must be taken into consideration. I just don't think it should generally be a gating factor for landing and iterating on new experimental stuff. |
Beta Was this translation helpful? Give feedback.
-
I am uncomfortable with the way this has been brought up.
If you are concerned that an experimental feature will gain popularity, perhaps it would be more constructive to open a discussion about better ways of gating experimental features, rather than blocking individual prs. Especially since the authors of the PR in question were willing to iterate on the functionality you were requesting, which is a fantastic use case for experimental gates, and one of the reasons we have them in the first place. |
Beta Was this translation helpful? Give feedback.
-
@mcollina and I were discussing in #45018 a general question that I haven’t seen addressed before: what minimum requirements do we have or should we have before a new feature is made publicly available, even as experimental?
The particulars of #45018 are that:
My concern is that I don’t want this feature being released to the public, even experimentally, and becoming wildly popular before it has full ESM support. If that were to happen, we’ll have another case where we hear more user complaints of “I want to use ESM, but I can’t until this feature supports ESM.” This has been a source of great frustration for years, and has held back ESM adoption. I really don’t want more things trapping people in CommonJS, and I don’t think it’s good for the project generally if we provide a better user experience or more functionality in CommonJS than in ESM. It’s also not fair to the people working on modules to have to try to complete this work to make all features compatible with ESM, when arguably it should be the responsibility of the original authors/teams.
On the other hand, I see the point about merging in something small and iterating; that if the initial requirements for landing anything are too high, new features won’t land and grow. On the thread we discussed approaches to split the difference, such as landing on
main
only and attachingdont-land
flags to prevent the incomplete feature from being released; or gating the feature behind a build flag, or following the pattern of https://github.com/nodejs/ecmascript-modules where a big new feature is developed over many PRs in a forkednode
repo and merged in when it’s ready. Other ideas for solutions to this problem would be welcome.So my question for the group is basically, what minimum requirements should we have for landing new experimental features and for releasing new experimental features? Since things can be landed but held back from public availability. Is near-parity in ESM a fair requirement? Are there others? cc @nodejs/tsc @nodejs/loaders @nodejs/modules
Beta Was this translation helpful? Give feedback.
All reactions