Comments (13)
@Deraen
Let's say your server prepares some content that can be generated server side, like prepared info pages that are cached, or content from a CMS, and that content is supposed to contain some interactive elements,
then having the ability to just send data amd render that is much nicer than having to perform a clientside postprocessing step that walks the entire tree and replaces keyword with functions.
We currently do the latter and it is super messy :/
from reagent.
+1 I could really use this! Important enough to me that I am tackling it myself but I have limited experience with CLJS and Reagent so it will take sometime.
from reagent.
Not sure how idiomatic it is but I have a working solution in a custom-tags branch on my fork. k2052@9a6ab3b
Seems to not have broken anything (all tests still pass). Will make a PR as soon as I have some tests written and work out the most idiomatic API.
from reagent.
@k2052 any word on a pr? :)
from reagent.
This is an even bigger deal for react native. I'll prepare a PR
from reagent.
@galdolber π
from reagent.
Is there any progress on this?
Is there something holding the integration of the MR back?
We also need to render hiccup that was generated elsewhere and it would help a lot.
from reagent.
@holmsand this seems like it would be a nice addition.
from reagent.
Yeah this would be pretty rad! π
from reagent.
Any update on this PR?
from reagent.
I don't yet understand why this is needed.
First comment mentions server-side rendering, but in that case, the app would be rendered as string to HTML, which wouldn't refer the component functions? What use case there is for sending hiccup from server to client?
What about ReactNative? Obviously Reagent already works there, what would this improve on that environment?
I'd prefer not introducing new abstractions, especially one with global state (atom), without good reason.
from reagent.
This feature would be very useful for me!
from reagent.
While I didn't mention this in Clojurist Together plans directly, I have some ideas on implementing this:
[As this affects how Reagent turns Hiccup to React elements and components,] I have some ideas on allowing users configure the Reagent Hiccup compiler, similar to what Hicada does. This would also allow introducing optional features which would break existing Reagent code, by making users opt-in to these. One case would be to make React component interop simpler.
This configuration will probably allow providing a function to convert keywords (or other values) to React elements, which will allow users to configure custom tags.
from reagent.
Related Issues (20)
- Infinite loop in the reagent.impl.input wrapper HOT 1
- Reaction value propagation glitch - the dirty flag is not set HOT 3
- Bad react key warning when using false as key
- examples/material-ui not work HOT 1
- examples/material-ui not work HOT 1
- Docs on βChanged?β inaccurate? HOT 5
- React 18 does not live reload with Shadow-CLJS in non-trivial projects HOT 5
- Prop types
- `TypeError` when using function components with `r/create-class` with `dom.server/render-to-string`
- ReactDOM.render is no longer supported in React 18. Use createRoot instead. HOT 2
- shadow-cljs emits a warning when using with-let HOT 4
- Korean input broken on :input and :textarea HOT 1
- Update docs? HOT 1
- MUI ThemeProvider not working HOT 1
- @@ -62,6 +62,45 @@ class _Config { } } // eslint-disable-next-line valid-jsdoc /** * fetch problem title, level via solved.ac api * @see {@link https://solvedac.github.io/unofficial-documentation/#/operations/getProblemByIdArray} * @param {string[]} pids - list of problem id (up to 100) * @param { ({ problemId, titleKo, level }) => void } callback */ function fetchProblemsFromSolvedAc(pids, callback) { const query = encodeURIComponent(pids.join(',')); console.log(`https://solved.ac/api/v3/problem/lookup?problemIds=${query}`); fetch(`https://solved.ac/api/v3/problem/lookup?problemIds=${query}`) .then((res) => { console.log('fetchProblemsFromSolvedAc', res); return res; }) .then((res) => res.json()) .then(callback) .catch(() => callback(null)); }
- Readme says npm i or add deps to .edn but (in my case at least) needed both HOT 1
- Any interest in being able to replace `react/createElement` with a custom function? HOT 7
- The cursor disappears at the end of a controlled input on Chrome
- Reusable components following HTML semantics of Opional Attributes and Variadic Children HOT 3
- Controlled input loses cursor under ShadowRoot in React 18 HOT 3
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 reagent.