-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
@WebReflection |
well, This is at least the meaning of dynamic Are we going to ignore this? If not, there should be some goal around it, maybe not at the first iteration? |
@WebReflection I'm not sure I understand. By JS spec, CJS has access to |
it should also be noted that node already supports |
which version? or it needs the flag? All I am saying is that on the Web dynamic It looks like node here already decided to break that Web contract. |
In what way? In node the only way to import ESM is via P.S.: Support for dynamic import is only in node nightly and did require additional flags until very recently. |
@jkrems on the Web you cannot However, you can always Using TL;DR Maybe we could clarify this difference, if needed to exist, somewhere? |
Would you say using
because there may be Module formats that Node and the browser end up supporting that the other does not. Should we remove that non-goal and add something else? |
Well, importing any kind of non-ESM using any kind of |
you are comparing apple to oranges.
that's OK, there's no ambiguity or ESM to enforce in We can discuss forever if it makes sense or not, all I am saying is that current nightly behavior is not congruent with the Web and we should probably declare the difference somewhere and also eventually agree it's a non goal to have 1:1 |
By your definition what makes it JS instead of WASM. |
this is a live demo of the equivalent of a sloppy/CJS that <!doctype html>
<script src="sloppy.js"><!-- not a module --></script> // sloppy.js ... it uses import for a js file, same MIME
// import(...) is the disambiguation to bring in ESM
// when the MIME is text/javascript (or others)
import('./esm.js').then(module => {
console.log(module.default);
}); // esm.js
import random from './random.js';
export default random; // random.js
export default Math.random(); |
@WebReflection What is unclear is the mechanism you are asking Node to use to determine which format a file is in when encountering your file. Your example is using |
@WebReflection I feel you are comparing apples to oranges. Whether the script is executed sloppily or not is an implementation detail. |
no,
I've just explained this is not true. Same Nodejs has CJS and ESM that could be on The Web has also the same MIME, and |
CJS is different from web's non-module. Do you disagree? |
CJS is a sloppy, non ESM, program. It is strict only if opted in. // this is spider.js
with({greatPowers: 'comes great responsibility'})
console.log(greatPowers); Now go in |
What I see is that you have a different definition of CJS than My definition of CJS:
Your definition of CJS:
Am I correct in this description of your definition of CJS? |
it's one point only to me: a sloppy module point here is that the same extension disambiguation could be provided by dynamic import same exact way it does already on the Web. Then again, I am saying that static Either ways work for me (I lie, I prefer the second option: the opt-in), but ignoring it will bite someone at some point. Just my 2 cents. No intention to discuss this further 'cause I think we all perfectly understood each other. |
…e instrumentation / transformation as well
No. You seem to value the sloppiness over the moduleness (i.e., importability) of CJS. And I don't think it's right.
Browser folks and TC39 say no.
Unfortunately ESM semantics can be pretty different from CJS semantics people are used to, either because they have been writing CJS or they have been using Babel's 'ESM', so this kind of issues biting someone is unavoidable. I don't think we should try to be perfect and provide a solution that will bite no one, because that does not exist. Actually it does, and it's called CJS. Oh wait, never mind. |
can we please link sources to these statements? As example, here's one.
That's because:
We can keep ignoring this difference, but saying that those are the same is not very wise, IMO.
|
Maybe re-title the section from "Direction" to "Current Direction" if we're
emphasizing it may change?
…On Tue, 20 Feb 2018, 18:13 Bradley Meck, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In GOALS.md
<#23 (comment)>:
> +9. Modification of existing `require` behavior
+ * Modification of implementation details is allowed only if it would be backwards compatible
+
+# Goals that are not expected for the first iteration
+
+1. 100% stable Loader APIs
+ * Any Loader APIs shipped must have a forward compatible approach towards their usage, such as providing a feature dection mechanism or versioned API.
+2. Treatment of `.js` file extension as ESM by default
+3. Support for the following URL schemes: `data:`, `blob:`, and `https:`
+
+# Direction
+
+* Build upon the existing work in Node that has designs around using `.mjs`
+* Enable usage of `.js` for ESM through compatible means of out of band data
+* Build upon the existing Loader hooks to aid usability
+ * Creation of in memory Module records
@jdalton <https://github.com/jdalton> we can replace the status quo, but
this section is basically documenting the status quo. The intent of this
section is to allow progress to continue and not completely halt all
development of ESM in Node while this group works.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#23 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AGni9SaKMgRpHf7hUftokzyuUq7N2CYxks5tWwtSgaJpZM4R-08k>
.
|
@robpalme done, though this doesn't really reflect that it would be hard to change direction it seems fine. |
FWIW, from this comment on, I share the exact same opinion/concerns of @jdalton . If the direction is set in stones and unchangeable, I don't see any value in having this group 'cause there's nothing most of us can do, or better, nothing would be happy to do. I'm not the best candidate for English specs wording, but if this document is meant to represent the foundation of the group, let's please try to not lock it into a direction majority of people here don't really like. Thanks. |
As a balance, while I am respectful of the opinions of @jdalton and @WebReflection, I want to advocate @bmeck's (and probably others) way—let's take what we have and make it better. I believe the two proposals currently on the table, the "esm" mode and loader hooks, will enable us to do exactly that: move forward while making everyone happy. Let's not throw away all the work that happened after literally years of discussion, and restart those discussions again. Instead, let's take what we have, and try to figure out how to make the opponents of the current direction happy. Can we take what we have today, tweak it with things like esm mode, and have everybody satisfied with the result? I believe we can. My concern is that if we throw away all the current hard work, and start discussing ESM from scratch, we will just be regurgitating and repeating the discussions people already had. Yes, we might arrive at different conclusions, but it will again take years. Instead, let's take what we have, and figure out ways to resolve the problems that have surfaced and will surface. Suggestion@WebReflection and @jdalton: can you (and others in this group) add a "Concerns" section which enumerates the problems that you have with the current direction? That way we can continue building on the work already done, and addressing your concerns with it. |
me too, or I wouldn't be here. My point wasn't to throw away everything, rather to not keep doing everything around the
It's a matter of mindset. If people writing the foundation believe Not sure that needs a counter section. |
@WebReflection - everybody wanted But now there is a PR that "returns" |
I know there is an ESM mode and I'm happy. All I'm saying is that the foundation should be willing to move forward both cases instead of promoting Again, I just agree with @jdalton and I'd like to know we're here to always keep both directions in mind. What will be the future, let users/adoption decide that. Thanks. |
@WebReflection we can work on wording and promoting them as equals if/when we land that PR :). That seems like something that should probably be done since it is a major change to the state of things. |
people mentioned that some of these goals were leaking implementation detail expectations at the meeting, if we could isolate though and list them again I would like to try and remove implementation details from goals. |
This document was drafted before we had started work on use cases and features. As such I don't believe it is an accurate reflection of the current state of the working group. @bmeck are you open to closing this? |
@MylesBorins seems fine since we are going back to use cases but we need to revisit this sometime in the future. |
No description provided.