4 ms·
I appreciate that in JSX, functions can be used as if they were first-class elements. In this case that would be accomplished by supporting the following inste
by eterps 3y ago
I appreciate that in JSX, functions can be used as if they were first-class elements.
In this case that would be accomplished by supporting the following instead:
@hmlt HomePage() {
%SiteLayout
%p This is the home page for Hamlet.
}
Which is much cleaner IMO.
- gloryjulio 3y agoBecause JSX is just document.createElement() with syntax sugar. If Haml has an equivalent api, there should be a way to implement something similar.
- eterps 3y agoI don't understand, I thought document.createElement() is independent of JSX. JSX works just as well in Deno/Bun/Node.js without DOM functions.
- deleted 3y ago[deleted]
- gloryjulio 3y agoI haven't looked into the details about how server side rendering is done. It should have something equivalent to generate HTML. But the point still stands, it should be possible to follow the same pattern to create a JSXesque template for HAML