-
Notifications
You must be signed in to change notification settings - Fork 5
Doesn't work in SSR/Solid-Start #1
Description
I'm trying to use this in a Solid-Start project, but looks like it only works at client side?
For example, this createEffect doesn't run in SSR, so this onCleanup will throw an error (and crash the whole dev server, although this is an issue of Solid Start itself).
Also, the formatElements method only works in DOM environment.
Because Solid SSR works on strings, it's more difficult to add children to already created "elements" (I made a library that parses the returned HTML string, transforms it, and serialize back to HTML, but obviously it's not the correct way). So, to support SSR, I think the macro processor should transform inline components to factory methods (<Trans id="xxx" components={{ 0: children => <a>{children}</a>, 1: children => <b>{children}</b> }} instead of <Trans id="xxx" components={{ 0: <a/>, 1: <b/> }} />), so Solid plugin can generate server side components of them with interpolated children.