-
Notifications
You must be signed in to change notification settings - Fork 43
Feature: Multi-mode packages #94
Comments
I'd like to propose merging feature #93 into this one, under this name, as multi-mode seems like a clearer term to me than dual-goal (which I would associate with source texts over packages). |
Could you define "multi-mode"? Base on #93, "dual goal" would be:
(I believe it could also be reduced to "a module that can...." depending on the implementation) This can work in two ways:
The first message in #93 is not that clear about the interpretation, but the discussion below seems to be about the second interpretation ("consumer-based resolution": the actually resolved file depends on the kind of import mechanism used by the consumer). My understanding of "multi-mode" is that it's about supporting new JS parse goal or different file types for module implementations, but once it's part of the dependency graph it behaves either like an ES modules or a commonJS module. The effect is "local". A solution to the multi-mode use-case may also solve the dual-goal use case, but these use cases feel different to me. |
I don't understand what multi-mode means, but in my own usage of this terminology I've used it to exactly refer to "dual-goal" packages. From a terminology perspective it seems important to be very clear here on meaning, and pick a term here so we can all be on the same page. In terms of understanding this feature, the first point sounds like it is covered by the "support importing WASM" feature, and the second point seems like it is covered by "allow code to run in Node.js and the browser". That leaves "I want to be able to gradually convert my package from CommonJS to ESM", which seems like it is covered by "gradual migration from CommonJS to ESM (#99)". |
(In terms of terminology, I could happily go with either "dual-goal packages" or "multi-mode packages" to refer to this feature, I just think it's important to pick one!) |
In fact, #99 even seems like a duplicate of this same issue to me. Perhaps the two features are:
(1) seems like it is covered by #99. Further suggestions re clarity here are welcome. |
I definitely agree that there is an ambiguity here and that we need clear definitions: I also don't know what "multi-mode" means. At the moment, I consider the "dual-goal" feature to be better defined. The feature in this use case mixes many things: WASM support, browser compat and progressive migration. Here is how I see it:
Now, going from a blob to a module is a distinct problem. There are many file types: "dual-goal" seems to be relatively wide-spread but I am not convinced this is the best term because the "goal" only makes sense for JS files but the use case also covers a consumer importing a library implemented either as a "multi-mode" seems more fuzzy and unless we define it clearly somewhere, I also consider it confusing and would prefer to use "support WASM and additional JS goals", and qualifying it as needed ("such that it works out of the box in browsers", "such that it is an implementation detail", etc.)
Agreed for |
Agree with the previous post.
Reading terms like consumer agnostic import, I think to myself, of what? I almost feel like uses of the word “import” should be followed by “of X into Y,” like “consumer agnostic import of CommonJS into ESM.” |
import
s WASM.Use cases 19, 39.
The text was updated successfully, but these errors were encountered: