You are right, I wrote RequireJS but I was thinking CommonJS, much as is used currently in DevTools and Jetpack.
According to their documentation, Facebook's Flow analysis already supports CommonJS modules [1]. Of course, they prefer ES6 modules. It just remains to be seen whether we can migrate to these. Cheers, David [1] https://flowtype.org/docs/modules.html#_ On 27/09/16 17:00, David Bruant wrote: > Le mardi 27 septembre 2016 14:49:36 UTC+2, David Teller a écrit : >> I have opened bug 1305669 with one possible strategy for migrating >> towards RequireJS. > > RequireJS [1] is a peculiar choice for chrome code especially if your goal is > static analysis. [...] > On the topic of transitioning, I don't maintain the Firefox codebase, so feel > free to ignore anything I say below. > But for one-time top-level imports, the ES6 syntax seems like a better bet > given from what I've read that they're supported in chrome and are the > end-game. > As far as dynamic/conditional imports, there doesn't seem to be much value to > move from Cu.import() to require() given it's unlikely static analysis tools > will do anything with either anyway (I'm interested in being proven wrong > here though) and the standard module loader [2] will beg for another rewrite > eventually. > > hope that helps, > > David > > [1] http://requirejs.org/ > [2] https://whatwg.github.io/loader/ & > https://github.com/whatwg/loader/pull/152/files > _______________________________________________ > 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