-
Notifications
You must be signed in to change notification settings - Fork 891
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
State of SSR? #4245
Comments
Not officially planned* for 1.0, but lit-ssr support may come out of the box :) |
Hello, update: he components should be SSRable via For NextJS integration see https://www.npmjs.com/package/@lit-labs/nextjs for React sans next see https://www.npmjs.com/package/@lit-labs/ssr-react Nuxt lit implementation is in progress. I am going to close this issue because this component set complies with lit-ssr requirements. Future issues for integrations of lit-ssr should be filed on the Lit project over at https://github.com/lit/lit |
Here is a NextJS example using button and textfield: |
@e111077 Why do the labels of both of these show up as some default Serif font in Chrome? Kind of looks like Times to me. Shouldn't these appear as Roboto or something? Selecting the button and inspecting, it seems there are no values for var(--_label-text-type). |
You need to load the actual Roboto font (or whatever font you change the label type to) |
@e111077 I don't seem to have edit privileges on your StackBlitz |
Heya I've updated the link with an external link import of Roboto. Please let me know if there are other issues |
@e111077 Looks perfect now - thanks much! |
@e111077 Hmmm... any idea why there is a FOUC effect? Is it somehow because the components load their CSS via Javascript? |
If you mean a fouc from the fonts it's likely because font has font-display swap. Personally I'd recommend hosting the font locally and setting swap to not block render as well as keep the FOUC time low since you don't have to open a new network connection Edit: would also like to clarify. In SSR the styles are inlined into the template and not loaded via JS which should gzip incredibly well until declarative constructable stylesheets become a thing. |
@e111077 please resolve an issue in Astro, see https://stackblitz.com/edit/github-uiraud?file=src%2Fpages%2Findex.astro |
I created issue withastro/astro#8216 |
Heya @JosefJezek. I'm sorry but we're really crunching right now to release Material web 1.0 and I currently do not have time to implement a fix for Astro. I've tried before but I couldn't find how they were managing hydration script injection timing without spending more time on it. I have diagnosed the issue, and I hope the astro team or an open source contributor can chime in with a fix. Otherwise, I'll have to take a look after we successfully land Material web 1.0 |
Hello, is the "SSR" compatibility planned for 1.0 or even later?
There are now many fullstack frameworks like Next, Nuxt, Sveltekit, is a compatibility planned?
Currently using Material Web in one of these frameworks creates a delay of one second during which the components are not visible.
The text was updated successfully, but these errors were encountered: