Build the gaiabuild runtime using bundler not webpack

RESOLVED DUPLICATE of bug 1211938

Status

Firefox OS
Gaia::L10n
RESOLVED DUPLICATE of bug 1211938
3 years ago
3 years ago

People

(Reporter: stas, Assigned: stas)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

39 bytes, text/x-github-pull-request
gandalf
: review+
Details | Review | Splinter Review
(Assignee)

Description

3 years ago
If code in build/l10n/l20n.js is only run and required from xpcshell, we should be able to use the es6 version of l20n and benefit from the babel bundler that Zibi wrote.
Note, that since we are using pure es6, node is catching up really quick and they're currently one feature away from supporting our es6 code.

So even if in the future we will want to use node for this, there's a very high chance that it'll just work out of the box, and for us ability to remove the transpiler is a huge improvement.
(Assignee)

Comment 2

3 years ago
Ricky, I'd like to replace build/l10n/l20n with the same code written in es6.  Currently it's transpiled to es5 using babel+webpack.  Perhaps that's not needed?  What is the current plan regarding running the Gaia build system in node?  The localization logic makes use of XPCShell features like processEvents and DOMParser anyways which makes me think that it would be safe to use the es6 version.  It would make working with some corner-cases easier and would also make the diffs prettier.  What do you think?
Flags: needinfo?(rchien)
(Assignee)

Comment 3

3 years ago
Created attachment 8669916 [details] [review]
Pull request
Assignee: nobody → stas
Status: NEW → ASSIGNED
Attachment #8669916 - Flags: review?(gandalf)
Comment on attachment 8669916 [details] [review]
Pull request

yes pls!

Not only the code in this file: https://github.com/mozilla-b2g/gaia/blob/master/build/l10n/l20n.js makes no sense, but also its history is unreadable.
Attachment #8669916 - Flags: review?(gandalf) → review+
Hey, build system is going to continue node refactoring plan and adopt latest node 4.x for building gaia. for integration part, we'll introduce nvm or n or node version switch in order to fallback to 0.12.x for running marionette.

So yes, we're working on node migration and want to get rid of xpcshell stuffs (b2g_sdk) in the future. I think we should use babel + webpack solution until node 4.x fully support es6.
Flags: needinfo?(rchien)
(Assignee)

Comment 6

3 years ago
OK, I see, thanks Ricky.  Here's an alternative proposal:  let's use babel to transpile our bundle down to es5, and let's drop webpack which mangles and reorders parts of the file.
(Assignee)

Comment 7

3 years ago
Bug 1211938 removes webpack.  build/l10n/l20n.js will be now built with our babel bundler and transpiled to es5.  I'll land the file in Gaia on the next update of l20n.
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1211938
You need to log in before you can comment on or make changes to this bug.