jitar icon indicating copy to clipboard operation
jitar copied to clipboard

Add template with SolidStart + SSR

Open Mrcavas opened this issue 1 year ago • 2 comments

Currently there is a template using SolidJS, however it's only CSR. Using jitar with SSR isn't very documented, so having an example for people to go off of would help.

Mrcavas avatar Aug 10 '24 09:08 Mrcavas

After some research and experimentation, it appears that it isn't currently possible to get SSR working with Jitar. However, we are actively working on a solution. Details are provided below.

The problem All imports controlled by Jitar fail in SSR mode. This issue is caused by Jitar's current segmentation strategy, which requires remote module loading. This is prohibited by default in SolidJS, and for good reasons. I haven't found any configuration options to override this behavior (such as the --experimental-network-imports option for Node.js).

The solution We are aware of the risks associated with remote module loading, and we're already working on a solution. In issue #296, we're developing a new caching strategy that relies exclusively on static imports. This approach will eliminate the need for remote module loading, making it easier to enable SSR.

Conclusion We don't have a short-term solution at the moment, but we're actively working on a long-term fix.

petermasking avatar Aug 12 '24 12:08 petermasking

UPDATE

Jitar's segmentation strategy has been refactored so that it no longer depends on remote module loading. I’ve just published an example project showcasing SSR with Solid: https://github.com/petermasking/solid-jitar.

Currently, getting the application running is a tedious process because it requires some manual steps after every build. Therefore, we need to create a Solid plugin to automate these steps.

petermasking avatar Jul 28 '25 13:07 petermasking