Server Side Rendering

Nijor provides a rendering mode labeled as Server Side Rendering (SSR), but its behavior is closer to Static Site Generation (SSG).

Instead of rendering components on the server for every request, Nijor prebuilds pages into HTML files during the build process and serves them directly.

You can enable this mode by changing the build configuration in nijor.config.js:


        export const build = {
            mode: "ssr"
        }
    

This approach is intentional. Rendering components on every request can be computationally expensive, so Nijor avoids unnecessary server work by generating static HTML ahead of time.

Note: SSR/SSG in Nijor only works during the production build using nijor build. It is not available in nijor dev, since prebuilding pages is computationally expensive and would slow down development.

This limitation is temporary and will be improved in the future as the rendering system becomes more optimized.

Dynamic behavior is still supported on the client after the page loads, allowing applications to remain interactive while benefiting from fast initial load times.

Currently, hydration is still evolving. While the prebuilt HTML is served correctly, client-side hydration may not work reliably in all cases. As a temporary workaround, components may re-run on page load, which can lead to redundant rendering.

This limitation is known and will be improved as Nijor’s rendering system matures.