Re:Enhance WASM: Back End Agnostic SSR for Web Components
by nobleach on Thursday April 11, 2024 @05:12PM
(#40006862)
You can, and that is effectively doing something similar to putting a style tag in the head of your document. It'll block until the styles are parsed and applied. If you have a ton of styles, your Lighthouse score will suffer because your first contentful paint will take longer.
[ Parent
| on HN ]
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by throwitaway1123 on Thursday April 11, 2024 @05:29PM
(#40007019)
Well yeah if you want to avoid a flash of unstyled content then you have to wait for the browser to style the content. The main problem is the style duplication issue which someone else pointed out elsewhere in this thread.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by niutech on Friday April 12, 2024 @07:43PM
(#40018800)
Unless you link the same cached CSS file in every web component.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by throwitaway1123 on Friday April 12, 2024 @09:11PM
(#40019436)
That adds an additional network request.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by niutech on Monday April 15, 2024 @04:43PM
(#40045314)
No, the CSS is being requested only once and cached in the browser, subsequent requests are being served from browser cache.
Re:Enhance WASM: Back End Agnostic SSR for Web Components
by throwitaway1123 on Monday April 15, 2024 @11:44PM
(#40048154)
The browser cache doesn't help on the first visit when the cache is empty, and the cache will also have to be invalidated whenever the component's CSS changes.