Page MenuHomePhabricator

[Spike] Evaluate whether JavaScript RL modules without side effects loaded on startup should be bundled into a single resource
Closed, DuplicatePublic

Description

Currently we load the following non ResourceLoaderImage modules on startup.
Given they are loaded by default it's possible it may be advantageous to package these in a single module (size of startup module/size of resulting JS may be smaller/remove fragmentation of JS files used across pages). We should investigate.

Modules:

  • mobile.betaoptin
  • mobile.editor.api
  • mobile.issues
  • mobile.mainMenu
  • mobile.pagelist.scripts
  • mobile.references
  • mobile.references.gateway
  • mobile.search
  • mobile.search.util
  • mobile.startup
  • mobile.toc
  • mobile.toggle
  • mobile.watchstar

Note that on startup we also load the following modules:

  • skins.minerva.editor
  • skins.minerva.fontchanger
  • skins.minerva.notifications
  • skins.minerva.scripts
  • skins.minerva.scripts.top
  • skins.minerva.tablet.scripts
  • skins.minerva.talk
  • skins.minerva.toggling
  • skins.minerva.watchstar

Questions to answer:

  • Which modules have side effects (e.g. when loaded make changes to the current page)
  • Which modules are used by 2 or more features?
  • What are the advantages to merging modules?
  • Should modules define features or components?
  • What code is used outside MobileFrontend? Is there justification for sharing it via its own ResourceLoader module?
  • Can skins.minerva.scripts.top and skins.minerva.scripts be merged after recent RL changes? Is there any advantage to having them separate?
  • On what pages does the script url differ (e.g. where do we load different JavaScript based on context.. do we only load toggling code on main namespace - if so what disadvantage does that have on client side caching/load time of subsequent page loads?

Event Timeline

You've hinted at some criteria for evaluating this idea. Could you write 'em out as questions?

Jdlrobson triaged this task as Normal priority.Jan 25 2017, 7:25 PM

Seen, but haven't had time to respond yet. Will soon.

Jdlrobson updated the task description. (Show Details)Jan 27 2017, 5:27 PM
Jdlrobson updated the task description. (Show Details)
ovasileva renamed this task from Evaluate whether JavaScript RL modules without side effects loaded on startup should be bundled into a single resource to [Spike] Evaluate whether JavaScript RL modules without side effects loaded on startup should be bundled into a single resource.Mar 6 2017, 3:42 PM