On Wed, Jul 5, 2017 at 6:36 PM, Kris Maglione <kmagli...@mozilla.com> wrote:
> It's possible to use the preprocessor to join multiple JS files, but we've > been moving away from that as much as possible recently. > It is worth mentioning that we don't like to use the Python preprocessor because preprocessor syntax makes the file invalid JavaScript, thus undermining the utility of tools like editors and linters. Before the movement towards standard syntax, our JavaScript developers couldn't have nice things like eslint. > > With the script precompiler enabled, though, there isn't very much > per-script overhead for scripts loaded via the subscript loader at startup. > And if the new code isn't likely to be needed during startup, you can use > the subscript loader to lazily load it the first time it's needed, rather > than at startup. So I'd recommend you go one of those two routes. > > On Wed, Jul 05, 2017 at 06:30:02PM -0700, zbranie...@mozilla.com wrote: > >> I'm working on a new feature which will add a new JS class. >> >> I can grow the main file (mozIntl.js) or add it in a separate file >> (mozIntlLocale.js). >> >> For readability, I think it would be nicer if I could add it as a >> separate file (I like to keep my files under 500 lines), but I don't want >> us to pay the runtime price of loading the file via JSM or XPCOM interfaces. >> >> Is there anything like a RollupJS in our build system? Or is there any >> plan to add it? >> > > -- > Kris Maglione > Senior Firefox Add-ons Engineer > Mozilla Corporation > > Of all the preposterous assumptions of humanity over humanity, nothing > exceeds most of the criticisms made on the habits of the poor by the > well-housed, well-warmed, and well-fed. > --Herman Melville > > > _______________________________________________ > 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