Last active
June 16, 2022 22:25
-
-
Save nolanlawson/871eced59d144dbe4bec242c1e45c8f1 to your computer and use it in GitHub Desktop.
Speculative preparser test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS preparser: imports</title> | |
</head> | |
<body> | |
<h1>CSS preparser: imports</h1> | |
<pre id="display"></pre> | |
<script> | |
const start = Date.now() | |
while (Date.now() - start < 2000) { | |
// block rendering | |
} | |
</script> | |
<style> | |
@import './one.css'; | |
@import './two.css'; | |
</style> | |
<div>Hello world</div> | |
<script> | |
display.innerHTML = performance | |
.getEntriesByType('resource') | |
.map(({ startTime, name }) => `${name.split('/').at(-1)} - startTime: ${startTime}ms`) | |
.join('\n') | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Preparser tests</title> | |
</head> | |
<body> | |
<h1>Preparser tests</h1> | |
<ul> | |
<li> | |
<a href="./links.html">Links</a> | |
</li> | |
<li> | |
<a href="./imports.html">Imports</a> | |
</li> | |
</ul> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS preparser: links</title> | |
</head> | |
<body> | |
<h1>CSS preparser: links</h1> | |
<pre id="display"></pre> | |
<script> | |
const start = Date.now() | |
while (Date.now() - start < 2000) { | |
// block rendering | |
} | |
</script> | |
<link rel="stylesheet" href="./one.css"> | |
<link rel="stylesheet" href="./two.css"> | |
<div>Hello world</div> | |
<script> | |
display.innerHTML = performance | |
.getEntriesByType('resource') | |
.map(({ startTime, name }) => `${name.split('/').at(-1)} - startTime: ${startTime}ms`) | |
.join('\n') | |
</script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
background: darkorange; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
color: white; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment