Understanding the 'normalize' Loader hook

2014-08-12 Thread Ian Hickson
Assume my script is http://example.com/test.js, and assume that there is no extra information (nobody has registered any module names or anything like that). If I do: import a; import ./a; import /a; import //example.com/a; import http://example.com/a; ...am I supposed to end

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread John Barton
See the implemention in es6-module-loader: https://github.com/ModuleLoader/es6-module-loader/blob/master/lib/system.js#L117 In traceur we have different code that passes the same tests. The tests: https://github.com/google/traceur-compiler/blob/master/test/unit/runtime/System.js We would map

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread David Herman
On Aug 12, 2014, at 2:05 PM, Ian Hickson i...@hixie.ch wrote: Assume my script is http://example.com/test.js, and assume that there is no extra information (nobody has registered any module names or anything like that). If I do: import a; import ./a; import /a; import

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread Ian Hickson
On Tue, 12 Aug 2014, John Barton wrote: See the implemention in es6-module-loader: https://github.com/ModuleLoader/es6-module-loader/blob/master/lib/system.js#L117 Ah, fascinating. So basically: - normalize does relative URL logic based on the current base URL and the referrer (i.e. the

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread Ian Hickson
On Tue, 12 Aug 2014, David Herman wrote: This is part of the design work we're actively working on. I'd ask you to hold off until we have some more information for you. I'll keep you posted -- we should have some more details for you soon. Where is the design work happening? I'd love to be

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread John Barton
On Tue, Aug 12, 2014 at 2:45 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 12 Aug 2014, John Barton wrote: See the implemention in es6-module-loader: https://github.com/ModuleLoader/es6-module-loader/blob/master/lib/system.js#L117 Ah, fascinating. So basically: - normalize does

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread Kevin Smith
Ah, fascinating. So basically: - normalize does relative URL logic based on the current base URL and the referrer (i.e. the URL of the script doing the importing). - locate resolves that URL and adds .js (only if the last segment is part of the path part of the URL and doesn't

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread Ian Hickson
On Tue, 12 Aug 2014, John Barton wrote: On Tue, Aug 12, 2014 at 2:45 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 12 Aug 2014, John Barton wrote: See the implemention in es6-module-loader: https://github.com/ModuleLoader/es6-module-loader/blob/master/lib/system.js#L117 Ah,

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread John Barton
On Tue, Aug 12, 2014 at 3:26 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 12 Aug 2014, John Barton wrote:... (only if the last segment is part of the path part of the URL and doesn't contain a .?). No such restriction is applied in our code. Sure. What do we want for the default Web

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread David Herman
On Aug 12, 2014, at 2:46 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 12 Aug 2014, David Herman wrote: This is part of the design work we're actively working on. I'd ask you to hold off until we have some more information for you. I'll keep you posted -- we should have some more details

Re: Understanding the 'normalize' Loader hook

2014-08-12 Thread Ian Hickson
On Tue, 12 Aug 2014, David Herman wrote: On Aug 12, 2014, at 2:46 PM, Ian Hickson i...@hixie.ch wrote: On Tue, 12 Aug 2014, David Herman wrote: This is part of the design work we're actively working on. I'd ask you to hold off until we have some more information for you. I'll keep