Skip to content

Commit

Permalink
fix(css): load css before js
Browse files Browse the repository at this point in the history
Currently all.css is loaded after app.js. This means there may
not be a guarantee that the css is loaded before the js, which
is bad because the js does dom querying for sizes on elements,
but some element sizes will be affected by js. So instead load
css upfront and let the browser block as needed or at least
give the css a head start in racing javascript to load.
  • Loading branch information
virtuacoplenny authored and yanas committed Dec 5, 2017
1 parent b258a9f commit b74b29e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--#include virtual="base.html" -->

<link rel="stylesheet" href="css/all.css">

<script>
window.indexLoadedTime = window.performance.now();
console.log("(TIME) index.html loaded:\t", indexLoadedTime);
Expand Down Expand Up @@ -134,7 +137,6 @@
<script src="libs/lib-jitsi-meet.min.js?v=139"></script>
<script src="libs/app.bundle.min.js?v=139"></script>
<!--#include virtual="title.html" -->
<link rel="stylesheet" href="css/all.css">
<!--#include virtual="plugin.head.html" -->
</head>
<body>
Expand Down
4 changes: 3 additions & 1 deletion static/deviceSelectionPopup.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<base href="../" />

<link rel="stylesheet" href="css/all.css">

<!--#include virtual="/title.html" -->
<script><!--#include virtual="/interface_config.js" --></script>
<script>
window.config = {};
</script>
<script src="libs/lib-jitsi-meet.min.js?v=139"></script>
<script src="libs/device_selection_popup_bundle.min.js?v=1"></script>
<link rel="stylesheet" href="css/all.css">
</head>
<body>
<div id="react"></div>
Expand Down

0 comments on commit b74b29e

Please sign in to comment.