Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate SSG/SSR possibilities for custom elements #3

Open
heymatthenry opened this issue May 13, 2024 · 0 comments
Open

Evaluate SSG/SSR possibilities for custom elements #3

heymatthenry opened this issue May 13, 2024 · 0 comments

Comments

@heymatthenry
Copy link
Collaborator

heymatthenry commented May 13, 2024

The next version of the Design System should have a story about fully static and/or server-generated markup. This issue will track how various web component frameworks and tools help to write that story.

Lit provides a SSR plugin, though it remains in "Lit Labs," so its documentation warns of potential breaking changes. Hopefully, now that Declarative Shadow DOM has shipped in the main evergreen browsers, that will cut down on the risk of that happening.

Despite the "Labs" status, eleventy and Astro have both have plugins using lit-ssr to support SSG/SSR of Lit-based components:

There are very basic "hello, world" style minimal test sites built with lit-ssr in these branches:

Both support zero client-side JavaScript builds of a minimal page with a usa-link component, while still providing the benefits of scoped styles via shadow DOM:

Screen.Recording.2024-05-13.at.6.37.40.PM.mov

The recording just shows that the focus styles are correctly scoped to the one link that uses the usa-link component, and don't affect the other link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant