Juraj Vitko wrote:

> Wondering how much is Node.js (or server-side JS for that matter) 
> represented in the ES6 process - a couple of Google searches reveal 
> that perhaps not very much:

I'm on Ecma TC39 and I care a lot about Node. We've explicitly approached 
modules with both the browser and Node in mind.

khs4473 wrote:

> module.exports = ? is an idiom that a large chunk of Node modules use.  I'll 
> disagree with Dean and opine that this usage is indeed common, but I have no 
> data to back that up.  "module" as a function is also used in the jquery unit 
> tests.
> 
> If it's a "context-sensitive keyword", should these forms work as before?
> 
> module(...)
> module.someName

Yes. I've been pushing since New Years for ES6 not to require any kind of 
opt-in at all, and to be backwards-compatible with ES5:

    https://mail.mozilla.org/pipermail/es-discuss/2011-December/019112.html

Part of that means that any existing code that uses `module` as an identifier 
will continue to work as before. I believe this approach has come pretty close 
to consensus on TC39.

> In order to have unambiguous syntax it looks like '{' will have to be on the 
> same line, ala return?
> 
> module [no line terminator here] {
> 
> The double-use of such an important keyword is unfortunate, but it looks 
> doable.

That's right.

> It seems likely that for a certain period, ES6 Node modules will need to 
> interoperate with pre-ES6 modules.  How will that work?

Both directions should be possible. ES6 modules will be usable as modules out 
of the box; for using objects as modules, the loaders API allows for installing 
ordinary objects as modules. This has to be done before loading code that 
statically requires it, but this could possibly be done automatically by Node 
at startup. Finally, the ES6 API for dynamic loading is async, but there's 
nothing preventing Node from adding an extra synchronous API for loading 
modules, à la require().

Dave

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to