Closed Bug 1421843 Opened 2 years ago Closed 2 years ago

investigate using Webpack 3 "scope hoisting" for faster JS loading

Categories

(Firefox :: New Tab Page, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 59
Iteration:
1.25
Tracking Status
firefox58 --- wontfix
firefox59 --- fixed

People

(Reporter: dmose, Assigned: k88hudson)

References

(Blocks 1 open bug, )

Details

(Keywords: perf)

Attachments

(2 files)

Now that we've updated to Webpack 3, scope-hoisting looks like, on the surface, that it's likely to be an easy perf win for JS loading time.  So we should give it a try...
Note that the most interesting wins from this would likely be:

a) startup
b) un-preloaded newtabs (eg the first one per window, at least for now)
This would also free up some time in the content-processes doing preloading, which might mean less jank for simultaneously loaded pages from the web.
Blocks: 1401155
Assignee: nobody → khudson
Iteration: --- → 1.25
Priority: -- → P1
Based on the documentation and some preliminary investigation, it appears that scope hoisting is only avaiable for ES modules and not common-js as we have implemented. There are a number of possible benefits to switching to ES modules but I'm not sure we want to go down that path as it would be a fairly major change? What do you think?
Flags: needinfo?(dmose)
Doh!  I think we likely want to go down that path at some point, since, in addition to this possible win, it will give us the option of having this stuff (someday, when Spidermonkey modules are more solid) loaded lazily at run-time.  That said, it's hard to figure out what the ROI is here.  Imagine whether or not it's worth doing now depends on how much of a win we think it might be.  Perhaps there's some easy machine-translation of commonjs-es6 module stuff that would allow us to at least get a ballpark figure?
Flags: needinfo?(dmose)
Depends on: 1424352
No longer depends on: 1424352
Depends on: 1424352
Commit pushed to master at https://github.com/mozilla/activity-stream

https://github.com/mozilla/activity-stream/commit/00d79b976227df0d08589dd6a6edc80265843aad
feat(webpack): Enable scope hoisting optimization (#3910)

Fix Bug 1421843 - Add scope hoisting to webpack config
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Blocks: 1426203
Blocks: 1426520
Component: Activity Streams: Newtab → New Tab Page
You need to log in before you can comment on or make changes to this bug.