Comments (2)
I thought about this yesterday. I'm not going to get into the business of writing another implementation that outputs the string. IMO the best/fastest server side render is rum. So I just landed support for this with a new config option:
(rum-render/render-html
(hicada/compile [:div {:style {:color "blue"}} "x"
[:span "foo"]]
{:server-render? true
:emit-fn (fn [tag attr children]
(into [tag attr] children))}))
Outputs:
"<div style=\"color:blue;\" data-reactroot=\"\" data-reactid=\"1\" data-react-checksum=\"282865149\"><!-- react-text: 2 -->x<!-- /react-text --><span data-reactid=\"3\">foo</span></div>"
Not really tested all that much so expect some rough edges.
from hicada.
Makes sense, even if nothing prevents you to "steal" rum code if you really wanted to, haha.
Keep up the good work !
from hicada.
Related Issues (13)
- Attrs type hint HOT 10
- trouble compiling project HOT 3
- Should `compile-html` walk everything? HOT 1
- Use with Rum? HOT 4
- Private discussion HOT 1
- Isomorphic rendering? HOT 8
- Optional props for :> HOT 1
- Preserve clojurescript objects in props HOT 3
- Incorrect result on compiling `cond` with more than 4 conditions. HOT 2
- Server side rendering HOT 1
- Deploy a new version (> 0.1.8) HOT 1
- The 0.1.9 causes regression HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hicada.