You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
First thing: I realize this is somewhat hijacking the proposal's repo, so will close immediately if you feel it's too off-topic, but it seems a directly related extension (symmetry/completeness of the export syntax) and I wish to research it without pitching a proposal.
This (now accepted) proposal (export * as ns from "x") gives us the ability to easily re-export and aggregate multiple child modules as named exports of a parent module. Specifically, it allows doing so without needing to know or specify the exports contained in those child modules, by virtue of using namespaces. It permits bundling/multiplexing, in a sense. Where the child module names are explicit but the exports they contain are implicit.
// parent-aggregator.js
export * as child1ns from "child1.js"
export * as child2ns from "child2.js"
There is currently no way of performing the inverse operation: destructuring those aggregated modules from the parent module back out to individually named modules. It can only be done if you explicitly name the exports inside the child modules. I'm thinking of something that would allow:
// child1-proxy.js
export { child1ns as * } from "parent-aggregator.js"
// child2-proxy.js
export { child2ns as * } from "parent-aggregator.js"
Has there been any discussion or ideas on this? Do you think it has merit pursuing?
The text was updated successfully, but these errors were encountered:
First thing: I realize this is somewhat hijacking the proposal's repo, so will close immediately if you feel it's too off-topic, but it seems a directly related extension (symmetry/completeness of the export syntax) and I wish to research it without pitching a proposal.
This (now accepted) proposal (
export * as ns from "x"
) gives us the ability to easily re-export and aggregate multiple child modules as named exports of a parent module. Specifically, it allows doing so without needing to know or specify the exports contained in those child modules, by virtue of using namespaces. It permits bundling/multiplexing, in a sense. Where the child module names are explicit but the exports they contain are implicit.There is currently no way of performing the inverse operation: destructuring those aggregated modules from the parent module back out to individually named modules. It can only be done if you explicitly name the exports inside the child modules. I'm thinking of something that would allow:
Has there been any discussion or ideas on this? Do you think it has merit pursuing?
The text was updated successfully, but these errors were encountered: