Created
December 4, 2017 20:34
-
-
Save DylanPiercey/cdac8bc8c9a3e9ee1b29d285575336c6 to your computer and use it in GitHub Desktop.
Potential async flushing syntax for 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
<script> | |
// Prolyfill for watching for loading tags and shuffeling around dom. | |
// Could potentially come on first flush. | |
</script> | |
<body> | |
<header> | |
<h1>Hello world!</h1> | |
</header> | |
<main> | |
<!-- Will eventually insert any matching id that is flushed before this element. --> | |
<loading for="my-async-element"> | |
<p>loading...</p> | |
</loading> | |
</main> | |
<footer> | |
copyright 2017 this guy | |
</footer> | |
</body> | |
<!-- Flushes Later --> | |
<div id="my-async-element"> | |
My data | |
</div> | |
<!-- Final Result --> | |
<body> | |
<header> | |
<h1>Hello world!</h1> | |
</header> | |
<main> | |
<div id="my-async-element"> | |
My data | |
</div> | |
<loading for="my-async-element"> | |
<p>loading...</p> | |
</loading> | |
</main> | |
<footer> | |
copyright 2017 this guy | |
</footer> | |
</body> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment