Inline ES Modules
Mike Samuel
mikesamuel at gmail.com
Mon Jun 18 13:04:42 UTC 2018
How would an inline module be imported? Module descriptors are roughly
relative URLs so can refer to a JavaScript source file, but it sounds like
you'd need something more fine-grained to refer to an inline module. Using
fragments to refer to a passage within a document instead of a location
might have unintended effects.
Also, assuming that problem is solved, does the below mean anything
if (Math.random() < 0.5) {
module School {
export function getPersonType() {}
}
}
If not, if inline modules are defined eagerly, what advantages, besides
making life easier for transpiler writers, would inline modules have over
exporting frozen namespaces?
On Sun, Jun 17, 2018 at 10:34 AM Sultan <thysultan at gmail.com> wrote:
> Are there any open proposals/discussions related to creating ES modules
> inline? For example:
>
> ```
> import getPersonType from School
>
> module School {
> export function getPersonType (person) {
> switch (person) {
> case 'Teacher': return 'A teacher'
> case 'Director': return 'A director'
> }
> }
> }
> ```
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180618/dd466ebc/attachment.html>
More information about the es-discuss
mailing list