Re: ES6 module syntax – done?

2015-03-22 Thread Caridy Patino
yes, we just don't know yet, we have to think about it. there is already a good discussion happening about the loader shim we plan to provide, etc. look into the loader repo. Sent from my iPhone > On Mar 21, 2015, at 6:14 PM, James Kyle wrote: > > > > > There was then discussion of how to ge

Re: ES6 module syntax – done?

2015-03-22 Thread Caridy Patino
that is correct. Sent from my iPhone > On Mar 21, 2015, at 3:52 PM, Kyle Simpson wrote: > > Just for posterity sake, since I got tripped up here… > > `import .. from this module` did not make it into ES6. It may come in later, > in that form or some other. > __

Re: ES6 module syntax – done?

2015-03-21 Thread James Kyle
> > There was then discussion of how to get module metadata, with Dave's initial > proposal per his slides being this (as Juan shows). However, we eventually > arrived at the idea of >  > import { name, url } from this module; > Would it make more sense to add additional meta propertie

Re: ES6 module syntax – done?

2015-03-21 Thread Kyle Simpson
Just for posterity sake, since I got tripped up here… `import .. from this module` did not make it into ES6. It may come in later, in that form or some other. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discus

Re: ES6 module syntax – done?

2014-08-15 Thread Kevin Smith
Thanks, Domenic. Very helpful!​ ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

RE: ES6 module syntax – done?

2014-08-15 Thread Domenic Denicola
Was just going through updating @esdiscuss when I noticed nobody really answered this thread. Which is lame. The meeting notes at [1] are hard to interpret given that the slides are still MIA (Dave?). But essentially, import-into-namespace syntax is now `import * as x from "y"`, replacing the p

Re: ES6 module syntax – done?

2014-08-06 Thread Juan Ignacio Dopazo
// maybe? reference to the loader that actually loaded this module -Juan On Wednesday, August 6, 2014 3:31 PM, Axel Rauschmayer wrote: I haven’t seen any mention of `import * as foo` in the meeting notes, so I’m assuming that the ES6 module syntax is basically done. Right? Except for the

ES6 module syntax – done?

2014-08-06 Thread Axel Rauschmayer
I haven’t seen any mention of `import * as foo` in the meeting notes, so I’m assuming that the ES6 module syntax is basically done. Right? Except for the “import-into-namespace syntax” [1], of course. As an aside, I’m really glad that `this` won’t be used here (which would have resulted in yet

Re: Module syntax

2013-06-06 Thread Kevin Smith
> > export let default = 17; > export default = 17; > export default = function f() { ... }; > export default = class { ... }; > export function default(...) { ... } > export class default { ... } > > Interesting, but whether we go the other forms or not, I'm sold on this si

Re: Module syntax

2013-06-06 Thread David Herman
On Jun 6, 2013, at 11:05 AM, Axel Rauschmayer wrote: > OK, so you don’t want to replace > > import foo from "single_export_module"; > > with (braceless!) > > import default as foo from "single_export_module"; That's correct, I don't want to use `import default`. Dave ___

Re: Module syntax

2013-06-06 Thread Axel Rauschmayer
On Jun 6, 2013, at 19:42 , David Herman wrote: > On Jun 5, 2013, at 3:59 PM, Axel Rauschmayer wrote: > >> This makes a lot of sense. It would obviate the need for braces, right? > > No, at least not for imports. This is only about exports. I'd argue we should > keep the braces on export { x,

Re: Module syntax

2013-06-06 Thread David Herman
On Jun 5, 2013, at 2:58 PM, Domenic Denicola wrote: > From: David Herman [dher...@mozilla.com] > >> Moreover, Yehuda has urged me to consider >> >> export x = 17; >> >> as sugar for >> >> export let x = 17; > > I'd urge `const` instead of `let`, as `const` discourages the footgun of >

Re: Module syntax

2013-06-06 Thread David Herman
On Jun 5, 2013, at 3:59 PM, Axel Rauschmayer wrote: > This makes a lot of sense. It would obviate the need for braces, right? No, at least not for imports. This is only about exports. I'd argue we should keep the braces on export { x, y, z } for symmetry with imports. Dave ___

Re: Module syntax

2013-06-05 Thread Axel Rauschmayer
This makes a lot of sense. It would obviate the need for braces, right? > Yes, this is actually the direction I've been going in my thinking, based on > the critique that export default is the only export form that isn't a binding > form, especially when combined with a named function literal (`

RE: Module syntax

2013-06-05 Thread Domenic Denicola
From: David Herman [dher...@mozilla.com] > Moreover, Yehuda has urged me to consider > >export x = 17; > > as sugar for > >export let x = 17; I'd urge `const` instead of `let`, as `const` discourages the footgun of action-at-a-distance mutable `with`/global-like bindings that I keep talk

Re: Module syntax

2013-06-05 Thread Matthew Robb
I really like the way this sounds, just wanted to submit my approval :D On Wed, Jun 5, 2013 at 12:37 PM, David Herman wrote: > On Jun 5, 2013, at 11:51 AM, Kevin Smith wrote: > > > It occurs to me that this is valid under the current grammar: > > > > import { default as foo } from "foo"; >

Re: Module syntax

2013-06-05 Thread David Herman
On Jun 5, 2013, at 11:51 AM, Kevin Smith wrote: > It occurs to me that this is valid under the current grammar: > > import { default as foo } from "foo"; > export { foo as default }; > > We've discussed using a well-known symbol for the default export, but this > simple desugaring migh

Re: Module syntax

2013-06-05 Thread Kevin Smith
It occurs to me that this is valid under the current grammar: import { default as foo } from "foo"; export { foo as default }; We've discussed using a well-known symbol for the default export, but this simple desugaring might be another option: import foo as "foo"; // => import {

Re: Module syntax

2013-06-05 Thread Kevin Smith
Sorry - corrections to examples: import foo from "foo"; // => import { default as foo } from "foo"; export default = expr; // => let __genident__ = expr; export { __genident__ as default }; module Foo from "foo"; Foo.default(); Thanks, { Kevin }

Re: Module syntax

2013-06-03 Thread Jeff Morrison
`import foo from "foo";` reads to the quick eye as "import the symbol named foo from the module named 'foo'" -- but that's not actually what it means (wrapped curlies be damned!). I think the syntax would read much less confusingly if we made use of a `default` keyword to signify better what's h

Re: Module syntax

2013-06-03 Thread Kevin Smith
> > > Bikeshedding: > > Well, here comes a fun thread... > > Bikeshedding *is* fun : ) FWIW, I've implemented a parser for curly-free syntax and it does introduce some minor parsing difficulties on the export side. If we had lexical modules, then this: export module as ... could be a valid

Re: Module syntax

2013-06-03 Thread Dmitry Soshnikov
On Mon, Jun 3, 2013 at 1:55 PM, Juan Ignacio Dopazo wrote: > Now that it's been decided that braces are not a form of destructuring and > the colon replaced with `as`, what's the benefit of using braces? Why not > this previous proposal? > > import foo as foofoo from "foo"; > > import "bar" as bar

Re: Module syntax

2013-06-03 Thread David Herman
On Jun 3, 2013, at 10:29 AM, Axel Rauschmayer wrote: > Bikeshedding: Well, here comes a fun thread... > Rationale: > – Reducing the grawlix factor. > – Making non-default imports more convenient – which I assume will happen > more often(?) That's what this comes down to: do you expect the com

Re: Module syntax

2013-06-03 Thread David Herman
On Jun 3, 2013, at 1:55 PM, Juan Ignacio Dopazo wrote: > Now that it's been decided that braces are not a form of destructuring and > the colon replaced with `as`, what's the benefit of using braces? Why not > this previous proposal? > > import foo as foofoo from "foo"; > > import "bar" as ba

Re: Module syntax

2013-06-03 Thread Juan Ignacio Dopazo
Now that it's been decided that braces are not a form of destructuring and the colon replaced with `as`, what's the benefit of using braces? Why not this previous proposal? import foo as foofoo from "foo"; import "bar" as bar; Juan ___ es-discuss maili

Re: Module syntax

2013-06-03 Thread Andrea Giammarchi
if ``` function x() {} export default x; ``` works thought, that ain't any different from returning function expression where you cannot reuse that function if not inside the function itself. It does not look like a big lost but more similar to expression logic we are use to with JS ... or, is i

Re: Module syntax

2013-06-03 Thread Andrea Giammarchi
+1 as soon as the syntax is slightly different from NPM/AMD makes sense to have less ambiguity and a better definition. export default looks good here too On Mon, Jun 3, 2013 at 12:57 PM, Domenic Denicola < dome...@domenicdenicola.com> wrote: > I really dislike `export =`. It looks like it sho

Re: Module syntax

2013-06-03 Thread Kevin Smith
> `export default` is perfect IMO. It also conceptually fits better with how > default exports work. (I.e., they're *default* exports, they're not the > entirety of the exports. They don't overwrite the module instance object, > in the fashion that `module.exports =` does.) > > A potential problem

Re: Module syntax

2013-06-03 Thread Rick Waldron
On Mon, Jun 3, 2013 at 3:57 PM, Domenic Denicola < dome...@domenicdenicola.com> wrote: > I really dislike `export =`. It looks like it should be creating a global > variable named `export`. > > `export default` is perfect IMO. It also conceptually fits better with how > default exports work. (I.e.

Re: Module syntax

2013-06-03 Thread Axel Rauschmayer
We may be able to have both: convenient default imports and convenient non-default imports, if we bring back `export =` (which, IIRC, has been proposed a while ago) and introduce `import =` as an analog. Example: module "jquery" { export = { ... }; } import $ = "jquery"; Not co

Re: Module syntax

2013-06-03 Thread Brendan Eich
I was corresponding with Axel about what's possible without ambiguity, and he pushed for brace elimination noting that 'default' is a reserved word. This led to me remembering the export = ... form, more concise than export default ... -- not that "more concise" must win, but it seems worth a b

RE: Module syntax

2013-06-03 Thread Domenic Denicola
I really dislike `export =`. It looks like it should be creating a global variable named `export`. `export default` is perfect IMO. It also conceptually fits better with how default exports work. (I.e., they're *default* exports, they're not the entirety of the exports. They don't overwrite the

Re: Module syntax

2013-06-03 Thread Axel Rauschmayer
On Jun 3, 2013, at 20:41 , Rick Waldron wrote: > On Mon, Jun 3, 2013 at 2:40 PM, Axel Rauschmayer wrote: >> On Mon, Jun 3, 2013 at 1:29 PM, Axel Rauschmayer wrote: >> Bikeshedding: I generally like the module syntax, but I’d always omit the >> braces and use `import defau

Re: Module syntax

2013-06-03 Thread Rick Waldron
On Mon, Jun 3, 2013 at 1:29 PM, Axel Rauschmayer wrote: > Bikeshedding: I generally like the module syntax, but I’d always omit the > braces and use `import default` for importing the default export of a > module. > >From the wiki: module "foo" { export default

Re: Module syntax

2013-06-03 Thread Rick Waldron
On Mon, Jun 3, 2013 at 2:40 PM, Axel Rauschmayer wrote: > On Mon, Jun 3, 2013 at 1:29 PM, Axel Rauschmayer wrote: > >> Bikeshedding: I generally like the module syntax, but I’d always omit the >> braces and use `import default` for importing the default export of a >>

Re: Module syntax

2013-06-03 Thread Axel Rauschmayer
> On Mon, Jun 3, 2013 at 1:29 PM, Axel Rauschmayer wrote: > Bikeshedding: I generally like the module syntax, but I’d always omit the > braces and use `import default` for importing the default export of a module. > > From the wiki: > > module "foo"

Module syntax

2013-06-03 Thread Axel Rauschmayer
Bikeshedding: I generally like the module syntax, but I’d always omit the braces and use `import default` for importing the default export of a module. Rationale: – Reducing the grawlix factor. – Making non-default imports more convenient – which I assume will happen more often(?) -- Dr. Axel

Import Module Syntax Bikeshed

2012-09-05 Thread Kevin Smith
Apologies if the "import module" syntax has already been agreed upon (in which case I'll be happy to use whatever it is), but in converting over some code to ES6 modules, I've found myself dissatisfied with both "variant A" and "variant B". I've cr