Feature request summary
It would be good if swirl components supported Server Side Rendering (SSR), to reduce loading times.
As most of the components are static, it does not make a lot of sense to render them on the client when using SSR anyway.
Rationale
As of now, these components cannot be rendered on the server. (At least I haven't found a way to do that). This leads to huge JS bundles being shipped to the client. I made a little test to confirm that. Here is a screenshot of the Network tab when just using one SwirlButton:
If the SwirlButton is removed, the network tab looks like this:
If react is used without swirl on the client, it looks like this:
So above the ~100kB of react, swirl adds another ~150kB for components that are mostly static.
It seems to be possible to export Stencil components for SSR, see https://stenciljs.com/docs/hydrate-app
For static views, this could save ~250kB, which is quite significant on slower networks (>1s on 3g).
For dynamic views, it would still save ~150kB (>600ms on 3g).
edit: The above screenshots are from an astro build (SSR mode), but I also got similar results using Next.js earlier
Feature request summary
It would be good if swirl components supported Server Side Rendering (SSR), to reduce loading times.
As most of the components are static, it does not make a lot of sense to render them on the client when using SSR anyway.
Rationale
As of now, these components cannot be rendered on the server. (At least I haven't found a way to do that). This leads to huge JS bundles being shipped to the client. I made a little test to confirm that. Here is a screenshot of the Network tab when just using one SwirlButton:
If the SwirlButton is removed, the network tab looks like this:
If react is used without swirl on the client, it looks like this:
So above the ~100kB of react, swirl adds another ~150kB for components that are mostly static.
It seems to be possible to export Stencil components for SSR, see https://stenciljs.com/docs/hydrate-app
For static views, this could save ~250kB, which is quite significant on slower networks (>1s on 3g).
For dynamic views, it would still save ~150kB (>600ms on 3g).
edit: The above screenshots are from an astro build (SSR mode), but I also got similar results using Next.js earlier