-
Notifications
You must be signed in to change notification settings - Fork 44
Package & Module sub-terms for Agnostic Consumers #164
Conversation
Add sub-terms of Agnostic Consumers: - Agnostic Module Consumers - Agnostic Package Consumers
This issue is about the different possible import specifiers. Following the various discussions and proposals, I think that clarifying it is important but it may more complicated. Here are the different cases where the proposals can diverge:
I had a comment somewhere else that I find "agnostic import" more fitting than "agnostic consumer" because the "lack of knowledge of the dependency implementation" is defined for each individual import (static ES import / dynamic ES import / CJS require), not at the module level (and to me "consumer" strongly implies the "consumer module"). A consumer module can mix agnostic or not imports. At the moment, Node has no concept of package boundaries (there was a module-related PR to introduce it). It seems that the most relevant distinction is if the specifier points to a file, a directory with "package.json" or a directory without "package.json". The relative/bare distinction just decides if we walk the parent directories looking inside "node_modules" or not. Since the most common use case for specifiers pointing to a file are "intra-package" imports and for specifiers pointing to directories with "package.json" are "inter-package" imports, I'm fine with using it as a shortcut, but it must be clearly understood as so. Maybe something like:
Edit: So overall I got confused while thinking about the issue but agree with this PR. Sorry for causing noise about import/consumer. |
Please let’s not use the word “import” to mean anything except “the keyword used inside ESM” |
We can use "loading" maybe?
|
All the more reason to avoid overloading the word. Loading is fine but connotes loaders specifically; i think “consuming” might work. |
Edit: Sorry, this message is just causing noise about another terminology point. I definitely agree with the
I agree with you that it's also a point causing confusion, but I don't feel "loading" or "consuming" are the best terms to mean "any kind of import mechanism". It probably deserves a separate issue, but in the context of my previous comment I used "import" to mean "any kind of import mechanism". I prefer people to clearly say "ES import" or "CJS require" when the difference matters, and just "import" when the difference does not matter. This is consistent with other cases where a term alone has the broader meaning and you use qualifiers to reduce its scope. I also think this fits better with the terminology I propose:
|
My summary so far on the feedback from @demurgos @ljharb @bmeck is that:
So far I agree with @ljharb that using import in this context is misleading because it falsely implies we're talking exclusively about the Whilst I don't think we need to reserve the term Hence I come back to the original agnostic consumer as the best way to talk about something that loads things agnostically. |
This has conflicts, but I’m not sure we need this PR at this point. Can this be closed? |
@GeoffreyBooth At this point I think the conversation has moved onto concrete proposals so this refinement of terminology is no longer needed. |
Add sub-terms of Agnostic Consumers:
The immediate reason for adding these terms is to help separate the debates around:
I'd welcome feedback on whether different terms would be clearer, e.g. perhaps inter-package interop vs intra-package interop