4 ms·
Can you expand on what you mean by "what can be done with ClojureScript components in .cljc files"? Is Facebook also working with ClojureScript?
by graffitici 11y ago
Can you expand on what you mean by "what can be done with ClojureScript components in .cljc files"?
Is Facebook also working with ClojureScript?
- petrbela 11y agoClojureScript community is pretty close to React (see e.g. Om), and since React 0.13 supports plain classes, they can be written in CS. So FB itself might not be doing anything with CS but enables the CS community to work in the same ecosystem.
- AlwaysBCoding 11y agoWell the whole idea of Relay is to couple together the rendering logic of a UI component with the data fetching requirement of the component. So if you change the rendering logic of the component, the data that is fetched from the server will also change with it and you'll never be over/under fetching data. But inside the UI component you're really just defining the schema of the data to be returned from the server, you're actually implementing how to fetch that schema from the database somewhere else in your codebase. Clojure 1.7 introduces a new file-type with extension .cljc that can load in both Clojure and ClojureScript. Which means you should be able to define both your React component AND the Server side implementation of the data fetching schema all from one file. Pretty frickin' cool if you ask me. One file, one component, that knows how to render itself, fetch it's data and serialize it's data.