-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wildcardExports naming change #13
Conversation
README.md
Outdated
@@ -138,12 +138,12 @@ interface Import { | |||
|
|||
Returns a list of the explicit named exports of the module of the form `String[]`. | |||
|
|||
### `AbstractModuleSource.prototype.starExports()` | |||
### `AbstractModuleSource.prototype.namespaceReexports()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### `AbstractModuleSource.prototype.namespaceReexports()` | |
### `AbstractModuleSource.prototype.namespaceReExports()` |
what about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or, reExportAlls()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always wonder about the camelcasing of reexports
too. Strictly speaking, isn't the prefix part of the same word though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excepts camel casing, namespace reexports makes me think of export * as ns from ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. Maybe namespacedExports
or namespacedReexports
with a d
could help disambiguate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think? cc @nicolo-ribaudo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export * as ns from
would still be in this list, though, no? since it's statically creating an ns
named export?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export * as ns from
would still be in this list, though, no? since it's statically creating anns
named export?
No, I think? It only refers to all specifiers from export * from
.
export * as x from 'x'
export * from 'y'
only "y" appears in this list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way, I don't know if these two have observable differences in the language.
export * as x from 'x'
import * as <unique identifier> from 'x'
export { <unique identifier> as x }
To be honest i think "star" being inside the spec is irrelevant - the reason that name makes the most sense is because it uses a |
Another name that we could use here is "barrel export". So we could call the method In references I've found it's commonly used to refer directly to |
In my understanding, "barrel" is used to refer to the file that only contains a list of If a file looks like this: export function a() {
// a lot of logic
}
export function b() {
// a lot of logic
}
// ....
export * from './constants.js' I won't call it a "barrel" export |
Another name we might use that is used on MDN is the term "wildcard export", so |
I've updated this PR to use the term |
This changes
ModuleSource.prototype.starExports()
to instead be referred to asModuleSource.prototype.wildcardExports()
, since the term "star exports" is currently only an internal spec naming, which is not used outside of the spec itself.