DrSensor / nusa

incremental runtime that bring both simplicity and power into webdev (buildless, cross-language, data-driven)
MIT License
4 stars 0 forks source link

`wait` attributes #6

Open DrSensor opened 2 years ago

DrSensor commented 2 years ago

Mitigate FOUC (Flash of Unstyled and/or Unscripted Content)

<render-scope>
  <link rel="modulepreload" href="fouc-script.js">
  <link rel="stylesheet" href="fouc-style.css">

  <link type="text/css" href="unfouc-style.css" wait>
  <link type="text/javascript" href="unfouc-script.js" wait="idle">
</render-scope>

In the future, this behavior will be automatic. It will wait when there is no inferred value #3.


It also serve as a way for conditional hydration when the attribute value is specified