Module Loaders - module declarations in builds

2013-07-31 Thread Guy Bedford
I'm in the process of matching up an ES6 module loader with AMD support to the RequireJS tests, and have a question on concatenated module files. If I have a module, foo.js, which defines its own name and its dependencies: foo.js: module 'foo' { export var p = 'value'; } module

Re: Module Loaders - module declarations in builds

2013-07-31 Thread Sam Tobin-Hochstadt
I think one of us is confused here. How are you importing from 'foo.js'? If you're importing from it, expecting that it's the body of a module, then you'll get a syntax error -- modules don't nest. You could configure the loader so that it treats 'foo.js' as containing the definition of the 'foo'

Re: Module Loaders - module declarations in builds

2013-07-31 Thread Guy Bedford
Ok sure, while I understand nesting is no longer supported, it could potentially still make sense in terms of defining the module being an operation. Consider as an equivalent to the example the following: foo.js: System.set('foo', new Module({ p: 'value' })); System.set('foo/dependency', new

Re: Module Loaders - module declarations in builds

2013-07-31 Thread Guy Bedford
Actually, if module statements are not allowed at all within imported modules, this invalidates the example, which is the most important use case for module statements. Basically it would be impossible to load the module declarations for a modules dependencies in the same request as an import