On Tuesday, October 27, 2015 at 10:37:18 AM UTC-7, Staś Małolepszy wrote:
> Aren't we still limited to what the platform gives us?

Currently we are.

>  It seems like we only have three options: sync, defer, async -- how is 
>splitting the files into arbitrary buckets named after the perf marks work 
>around that?

First, I want to make it clear that they are not named after perf marks. Perf 
marks represent bootstrap stages. I want to tie JS buckets to bootstrap stages.
That's very different goal :)

Second, it allows us to start playing with more meaningful tests - imagine A/B 
testing with navigationLoaded group loaded sync/async/defer.
Or imagine memory testing where we load only until visuallyLoaded and nothing 
more and then perform heap memory tests.

I can also imagine ability to load JS but delay execution until we need the 
group.

Or maybe in the future we will bind firstPaint to navigationLoaded which will 
load its JS first, and then delay execution of navigationInteractive until 
after firstPaint.
It allows us to play with granular code loading to hit the right stages as fast 
as possible.

As I said, in the current scenario, the change is just to provide more meta 
information and more explicitly state which JS is needed for which state. In 
the future we may want and be able to do more.

> My fear is that you're trying to clean this up by introducing another layer 
> of entanglement. It's worth a try to see if it helps, but let's be careful 
> not to increase the complexity of the build system by too much.

I guess I'm aiming at stage-based WebAPP bootstrap process [0] and this is just 
a step in that direction :)

Fun fact - our current build system de-facto creates two groups already. It 
just names them "defer" and "normal". I suggest to separate semantics from 
heuristics and allow for more groups.

Thanks for the feedback! I'll keep in mind to keep it simple and I believe we 
can actually make it very webby thanks to declarative API and more semantic 
bootstrap.

zb.

[0] 
https://groups.google.com/forum/#!searchin/mozilla.dev.gaia/bootstrap/mozilla.dev.gaia/OBiGuysU_uM/JU-vFK_MW9oJ
_______________________________________________
dev-fxos mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-fxos

Reply via email to