HomePhabricator

resourceloader: Fold legacy modules into base modules request

Authored by Krinkle on Apr 10 2016, 2:05 AM.

Description

resourceloader: Fold legacy modules into base modules request

Follows-up 0ac4f998 (restore "blocking" legacy modules).

After d790562, legacy modules in the top queue were no longer consistently
loaded before the bottom queue due to the top queue being async.

The implied dependency was made explicit by 0ac4f998 by forcing all modules
to wait for legacy modules before executing.

This had the negative side-effect of putting an extra HTTP request between
the startup module request, base modules request, and actual execution
of page modules.

(Indentation aligns with when a request is triggered.)

Before:

  1. Request: Startup module.
    1. Request: Base modules
    2. Request: Legacy modules
      1. Page module request (or local store hit) and execution

After:

  1. Request: Startup module.
    1. Request: Base+legacy modules
      1. Page module request (or local store hit) and execution

This could alternatively be fixed by moving the top queue to be before
the embedded modules and enforcing the embed in a different way.
It could also be fixed by debouncing module load calls so they naturally
end up in the same request as page modules.

However for now I'm addressing this by adding legacy modules to the
list of modules in the initial load request from the startup module.

This was not possible before because the legacy wikibits had dependencies
and base modules cannot have dependencies. Fixed in I7f9f61ea81ad1ef.

Bug: T159911
Change-Id: I54f087655e1cde1b8ff1ca5fe56e82f7f7d80965