-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: load demo deps early on (#2119)
* docs: load demo deps early on Closes #2097 * docs: eagerly load tag definition * docs: streamline module loading try to load ssr support modules in one place only, see if that still works with webkit * docs: markdown tables ftw this commit is especially for @zeroedin's benefit
- Loading branch information
1 parent
04fc9a5
commit f7666d7
Showing
17 changed files
with
185 additions
and
374 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,27 @@ | |
</style> | ||
</noscript> | ||
|
||
{% include "../partials/javascript/global.html" %} | ||
<script type="importmap">{{ importMap | dump(2) | safe }}</script> | ||
|
||
{# ensure SSR support modules are loaded first #} | ||
{% include 'partials/javascript/dsd-init.html' %} | ||
|
||
{# load all components #} | ||
{% for tag in importElements %} | ||
<script type="module">import '@rhds/elements/{{tag}}/{{tag}}.js';</script> | ||
{% endfor %} | ||
|
||
{# only load components that need hydrated (aka interactivity) #} | ||
<script type="module"> | ||
import '@rhds/elements/rh-button/rh-button.js'; | ||
import '@uxdot/elements/uxdot-copy-permalink.js'; | ||
import '@uxdot/elements/uxdot-sidenav.js'; | ||
import '@uxdot/elements/uxdot-example.js'; | ||
</script> | ||
|
||
<script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js"></script> | ||
|
||
|
||
</head> | ||
|
||
<body dsd-pending class="{{ extraPageClasses }}"> | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<script type="module"> | ||
// although we load these ssr support modules elsewhere, we still | ||
// need them here to ensure no double-rendering on webkit | ||
import '/assets/javascript/ssr-support.js'; | ||
// include these, which are often internal to elements, | ||
// and are definitely required by context-picker and context-demo | ||
// to avoid SSR defer-hydration bugs and SSR double-rendering bugs | ||
import '@rhds/elements/rh-icon/rh-icon.js'; | ||
import '@rhds/elements/rh-surface/rh-surface.js'; | ||
import '@rhds/elements/rh-button/rh-button.js'; | ||
import '@rhds/elements/rh-tooltip/rh-tooltip.js'; | ||
import '@rhds/elements/rh-tag/rh-tag.js'; | ||
</script> |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// dsd polyfill needs to happen before hydration attempts | ||
// lit-element-hydrate-support needs to be included before lit is loaded | ||
import '/assets/javascript/dsd-polyfill.js'; | ||
import '@lit-labs/ssr-client/lit-element-hydrate-support.js'; | ||
import 'element-internals-polyfill'; |
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
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
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
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
Oops, something went wrong.