Remove blocking JavaScript from AudioVideo integration #2389
Labels
articles-av-epic
Current focus for the articles features stream
bug
Something isn't working
high-priority
ws-articles
Tasks for the WS Articles Team
Describe the bug
The initial implementation for integrating audio and video in #2151 loads RequireJS via a blocking external
script
tag added to thehead
.This is very bad for performance because as soon as the browser encounters this tag it will block all further parsing of the page till the RequireJS library has been loaded over the network and evaluated.
This issue should take the existing implementation as it stands, to make it load lazily. This shouldn't be a massive issue that refactors a lot of code, and doesn't need to be best technical implementation, that will come in a future issue. This is just to stop blocking JS.
There should be a future ticket to carry out a more in-depth investigation on the best technical solution to lazy load entire react components.
Testing Notes
requirejs
is loaded asynchronouslyTo Reproduce
Steps to reproduce the behavior:
Either examine page source or to observe performance effect:
Expected behavior
All external scripts should be loaded asynchronously.
Screenshots

Additional context
Good overview from Ilya Grigorik at Google
The text was updated successfully, but these errors were encountered: