Re: nodejs for extensions ?

2017-08-02 Thread Enrico Weigelt, metux IT consult

On 31.07.2017 20:30, David Teller wrote:

Node dependency trees tend to be pretty large, so I'm a little concerned
here. Has the memory footprint be measured?


That would also concern me (OTOH, moz's footprint already is as large as
a small skyscraper anyways ;-)).

We also have similar problems jscript-intensive websites.
Maybe there could be a way of sharing node modules between extensions ?

In the optional case, I'd like to have an extension actually being a
node modules, managed via npm or distro's package manager.

But I've got the feeling, that would require a fresh start w/ moving
that completely out to separate server processes: gecko exports some
IPC interface which extensions can call into, eg. request becoming a
filter for url pattern, retrieve and change a DOM subtree, trigger
certan actions, etc. When we even add docking windows to a dom element,
we'd also have the most vital parts for generic plugins.
This approach isn't even bound to javascript or nodejs - these
extensions could be written in any language.


--mtx

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nodejs for extensions ?

2017-07-31 Thread David Teller
Node dependency trees tend to be pretty large, so I'm a little concerned
here. Has the memory footprint be measured?

Cheers,
 David

On 31/07/17 19:45, Michael Cooper wrote:
> If you mean using modules from NPM in a browser add-on, the Shield client
> extension recently started doing this <
> https://github.com/mozilla/normandy/tree/master/recipe-client-addon>
> 
> We do this by using webpack to process the node modules, bundling the
> entire dependency tree of a library into a single file. We then add a few
> more bits to make the resulting file compatible with `Chrome.utils.import`.
> You can see the webpack config file here <
> https://github.com/mozilla/normandy/blob/master/recipe-client-addon/webpack.config.js>
> and the way we use the resulting files here <
> https://github.com/mozilla/normandy/blob/48a446cab33d3b261b87c3d509964987e044289d/recipe-client-addon/lib/FilterExpressions.jsm#L12
>>
> 
> We suspect that this approach won't be compatible with all Node libraries,
> because it is fairly naive. But it has worked well for the ones we've used
> (React, ReactDOM, ajv, and mozjexl, so far).
> 
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nodejs for extensions ?

2017-07-31 Thread Michael Cooper
If you mean using modules from NPM in a browser add-on, the Shield client
extension recently started doing this <
https://github.com/mozilla/normandy/tree/master/recipe-client-addon>

We do this by using webpack to process the node modules, bundling the
entire dependency tree of a library into a single file. We then add a few
more bits to make the resulting file compatible with `Chrome.utils.import`.
You can see the webpack config file here <
https://github.com/mozilla/normandy/blob/master/recipe-client-addon/webpack.config.js>
and the way we use the resulting files here <
https://github.com/mozilla/normandy/blob/48a446cab33d3b261b87c3d509964987e044289d/recipe-client-addon/lib/FilterExpressions.jsm#L12
>

We suspect that this approach won't be compatible with all Node libraries,
because it is fairly naive. But it has worked well for the ones we've used
(React, ReactDOM, ajv, and mozjexl, so far).

On Fri, Jul 28, 2017 at 10:13 PM Myk Melez  wrote:

> > Enrico Weigelt, metux IT consult 
> > 2017 July 28 at 21:33
> > Hi folks,
> >
> >
> > just curious: did anyone already try nodejs modules
> > for (javascript-only) extensions ?
> There was some discussion of this in the dev-addons thread "Node and Web
> Extensions Experiment"
> .
> We also discussed a related idea in the firefox-dev thread "SpiderNode
> for Firefox chrome code"
> <
> https://groups.google.com/forum/#!topic/firefox-dev/MWE-_1xkokk/discussion
> >.
>
> -myk
>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nodejs for extensions ?

2017-07-28 Thread Myk Melez

Enrico Weigelt, metux IT consult 
2017 July 28 at 21:33
Hi folks,


just curious: did anyone already try nodejs modules
for (javascript-only) extensions ?
There was some discussion of this in the dev-addons thread "Node and Web 
Extensions Experiment" 
. 
We also discussed a related idea in the firefox-dev thread "SpiderNode 
for Firefox chrome code" 
.


-myk

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


nodejs for extensions ?

2017-07-28 Thread Enrico Weigelt, metux IT consult

Hi folks,


just curious: did anyone already try nodejs modules
for (javascript-only) extensions ?


--mtx
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform