From f7666d7f0e42a2d480357e26e5abbd70e38b0fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benny=20Powers=20-=20=D7=A2=D7=9D=20=D7=99=D7=A9=D7=A8?= =?UTF-8?q?=D7=90=D7=9C=20=D7=97=D7=99!?= Date: Tue, 14 Jan 2025 16:25:50 +0200 Subject: [PATCH] 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 --- docs/_includes/layouts/base.njk | 22 +- docs/_includes/layouts/pages/element.11ty.ts | 4 +- docs/_includes/layouts/pages/has-toc.njk | 3 + .../partials/javascript/dsd-init.html | 13 + .../_includes/partials/javascript/global.html | 27 -- docs/about/roadmap.md | 6 +- docs/accessibility/accessibility-tools.md | 6 +- docs/accessibility/content.md | 10 +- docs/accessibility/index.md | 6 +- docs/accessibility/screen-readers.md | 6 +- docs/assets/javascript/ssr-support.js | 5 + docs/elements/demo.html | 12 +- docs/get-started/developers/index.md | 8 +- docs/get-started/index.md | 6 +- docs/patterns/logo-wall/examples.md | 5 +- docs/release-notes/prerelease.md | 397 +++++------------- docs/tokens/search.html | 23 +- 17 files changed, 185 insertions(+), 374 deletions(-) create mode 100644 docs/_includes/partials/javascript/dsd-init.html delete mode 100644 docs/_includes/partials/javascript/global.html create mode 100644 docs/assets/javascript/ssr-support.js diff --git a/docs/_includes/layouts/base.njk b/docs/_includes/layouts/base.njk index 5128b1ebc4..28838d1ed3 100644 --- a/docs/_includes/layouts/base.njk +++ b/docs/_includes/layouts/base.njk @@ -31,7 +31,27 @@ - {% include "../partials/javascript/global.html" %} + + + {# ensure SSR support modules are loaded first #} + {% include 'partials/javascript/dsd-init.html' %} + + {# load all components #} + {% for tag in importElements %} + + {% endfor %} + + {# only load components that need hydrated (aka interactivity) #} + + + + + diff --git a/docs/_includes/layouts/pages/element.11ty.ts b/docs/_includes/layouts/pages/element.11ty.ts index f39bb287f5..405679ccdb 100644 --- a/docs/_includes/layouts/pages/element.11ty.ts +++ b/docs/_includes/layouts/pages/element.11ty.ts @@ -89,6 +89,9 @@ export default class ElementsPage extends Renderer { diff --git a/docs/_includes/partials/javascript/dsd-init.html b/docs/_includes/partials/javascript/dsd-init.html new file mode 100644 index 0000000000..cc227374fc --- /dev/null +++ b/docs/_includes/partials/javascript/dsd-init.html @@ -0,0 +1,13 @@ + diff --git a/docs/_includes/partials/javascript/global.html b/docs/_includes/partials/javascript/global.html deleted file mode 100644 index 28f7044e6c..0000000000 --- a/docs/_includes/partials/javascript/global.html +++ /dev/null @@ -1,27 +0,0 @@ - - - {# dsd polyfill needs to happen before hydration attempts #} - - - {# lit-element-hydrate-support needs to be included before lit is loaded #} - - - {# load all components #} - {% for tag in importElements %} - - {% endfor %} - - {# only load components that need hydrated (aka interactivity) #} - - - - - diff --git a/docs/about/roadmap.md b/docs/about/roadmap.md index 046f480dfd..27f4aad9bd 100644 --- a/docs/about/roadmap.md +++ b/docs/about/roadmap.md @@ -5,10 +5,12 @@ order: 20 bodyClasses: page-docs tags: - about -importElements: - - rh-tile --- + +