You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 11 (#175), we lost support for server-side rendering (mostly an artifact of removing domino from nanohtml - Tram-One/nanohtml#20)
Ideally, we'd like to add this back in, with the support of the mutation observers that didn't quite exist before. This should be possible, but needs investigation.
The text was updated successfully, but these errors were encountered:
Without changing Tram-One, we could also scaffold runkit with jsdom (similarly, it might be possible to support server-side-rendering with jsdom). The following example works but could potentially be cleaned up:
const{JSDOM}=require("jsdom");const{ registerHtml }=require('tram-one');constdom=newJSDOM();global.document=dom.window.document;consthtml=registerHtml();consthome=()=>{returnhtml`<main><h1>Tram-One</h1><h2>A Modern View Framework for Vanilla Javascript</h2></main> `;};home().outerHTML
Note, simply making Tram-One work on the server will not be enough to make SSR work - we need to figure out how we want to do hydration of elements, and since so much of Tram-One is about embedding the state of elements in their nodes, decorating existing HTML may be difficult.
We may need to serve a minimal amount of JS that just adds attributes to a served HTML template 🤔
Summary
In version 11 (#175), we lost support for server-side rendering (mostly an artifact of removing domino from nanohtml - Tram-One/nanohtml#20)
Ideally, we'd like to add this back in, with the support of the mutation observers that didn't quite exist before. This should be possible, but needs investigation.
The text was updated successfully, but these errors were encountered: