Re: Extensibility of JavaScript modules

2013-10-15 Thread Philipp Kewisch
In general I am also against monkeypatching, but especially for products that don't have releases quite as often I think it has its valid use cases. Especially in the enterprise environment, where a client wants a fix now, its not an option to say "well, we've submitted this patch for the next

Re: Extensibility of JavaScript modules

2013-10-10 Thread David Rajchenbach-Teller
Don't hesitate to ping me when it's time. Cheers, David On 10/10/13 12:04 AM, Jason Orendorff wrote: > On 10/9/13 12:56 PM, David Rajchenbach-Teller wrote: >> I am interested, although my buglist is rather full. What kind of help >> would be useful? > > When it's time, we'll need to: > > 1. wr

Re: Extensibility of JavaScript modules

2013-10-09 Thread Jason Orendorff
On 10/9/13 12:56 PM, David Rajchenbach-Teller wrote: I am interested, although my buglist is rather full. What kind of help would be useful? When it's time, we'll need to: 1. write Loader hooks to make the `import` keyword behave like Cu.import 2. somehow have those hooks installed by default

Re: Extensibility of JavaScript modules

2013-10-09 Thread David Rajchenbach-Teller
I am interested, although my buglist is rather full. What kind of help would be useful? On Wed Oct 9 19:03:06 2013, Jason Orendorff wrote: > No plans yet. Want to work on it with us? We're not ready to start > just now, but parser support for ES6 modules is being added, and the > self-hosted imp

Re: Extensibility of JavaScript modules

2013-10-09 Thread Jason Orendorff
On 10/8/13 4:27 PM, David Rajchenbach-Teller wrote: That sounds quite sufficient for me. Do we have plans to backport Cu.import to ES6 modules? No plans yet. Want to work on it with us? We're not ready to start just now, but parser support for ES6 modules is being added, and the self-hosted i

Re: Extensibility of JavaScript modules

2013-10-08 Thread David Rajchenbach-Teller
That sounds quite sufficient for me. Do we have plans to backport Cu.import to ES6 modules? Cheers, David On 10/8/13 10:24 PM, Jason Orendorff wrote: > Here's the simplest way to monkeypatch an ES6 module: > > 1. Use System.get("x") or System.import("x", callback) to get the > Module object

Re: Extensibility of JavaScript modules

2013-10-08 Thread Jason Orendorff
On Tue, Oct 8, 2013 at 8:24 AM, Till Schneidereit wrote: > Interesting. I wonder if the monkey patching will even still work once we > have es6 modules and use them in the platform. > > Jason and Eddy, you probably know, but I'm under the impression that monkey > patching an es6 module requires

Re: Extensibility of JavaScript modules

2013-10-08 Thread Jorge Villalobos
On 10/8/13 10:09 AM, Benjamin Smedberg wrote: > On 10/8/2013 11:06 AM, Bobby Holley wrote: >> In general, I'm pretty against this kind of monkey-patching if it's made >> available to out-of-tree consumers. We should learn our lesson from XPCOM >> and recognize what a royal PITA it can be when exten

Re: Extensibility of JavaScript modules

2013-10-08 Thread Benjamin Smedberg
On 10/8/2013 11:06 AM, Bobby Holley wrote: In general, I'm pretty against this kind of monkey-patching if it's made available to out-of-tree consumers. We should learn our lesson from XPCOM and recognize what a royal PITA it can be when extensions start to depend on implementation details. Allowi

Re: Extensibility of JavaScript modules

2013-10-08 Thread Gregory Szorc
On 10/8/13 1:16 PM, David Rajchenbach-Teller wrote: A (not very) long time ago, our extension model was based on XPCOM – if you didn't like a component, you could just replace it in an add-on. These days, we have shifted to providing JavaScript modules and suggesting JavaScript add-ons. Now, by

Re: Extensibility of JavaScript modules

2013-10-08 Thread Dave Townsend
Frankly I wish the JSM import code didn't do what it does now, returning the entire global scope of the module to allow anyone outside to change it. Modules should be well contained and immutable, one piece of code shouldn't be able to make changes that breaks other code. If we need to allow extens

Re: Extensibility of JavaScript modules

2013-10-08 Thread Bobby Holley
In general, I'm pretty against this kind of monkey-patching if it's made available to out-of-tree consumers. We should learn our lesson from XPCOM and recognize what a royal PITA it can be when extensions start to depend on implementation details. Allowing something to be modified/overridden by emb

Re: Extensibility of JavaScript modules

2013-10-08 Thread Till Schneidereit
Interesting. I wonder if the monkey patching will even still work once we have es6 modules and use them in the platform. Jason and Eddy, you probably know, but I'm under the impression that monkey patching an es6 module requires funneling it through a custom module loader. Maybe the platform shoul

Extensibility of JavaScript modules

2013-10-08 Thread David Rajchenbach-Teller
A (not very) long time ago, our extension model was based on XPCOM – if you didn't like a component, you could just replace it in an add-on. These days, we have shifted to providing JavaScript modules and suggesting JavaScript add-ons. Now, by default, any JavaScript module can be monkey-patched.