Comments (4)
Just random thoughts:
I think there should be a well-documented set of rules for renaming keys and it should give us two-way mapping. $
and $$
will do mapping one way into js-land. And custom bean will implement mapping the other way into cljs-land.
btw. The mapping doesn't need to be shallow, handling :style
should be part of that mapping. The only trick would be to properly handle sub-maps, e.g. when cljs code asks to pull :style
it gets a "sub-bean" with the same rules still in place. Also the bean could be made read-only so user won't accidentally try to write to it.
As an escape hatch there should be a way hot to quote individual keys when coverting into js-land[1]. And the custom bean should give us some escape hatch to get properties using js-land key names.
[1] #8
from helix.
@Lokeh FYI, I started experimental work on that props translation. See the above commit.
from helix.
I just completed the experimental work and ported[1] my code to use this branch[2].
Good news is that implementation of the props-bean wasn't that hard[3], but I had to use val-hook-2 branch of cljs-bean[4]. I think we can make that work go into next cljs-bean release.
[1] binaryage/cljs-react-three-fiber@c79db08
[2] https://github.com/darwin/helix/tree/experimental
[3] darwin@596648c#diff-4e2696d03555bd7c23ee60920d4655feR114-R146
[4] mfikes/cljs-bean#67 (comment)
from helix.
In helix 0.1.0-SNAPSHOT
, there is a $d
macro which implements the specific transformation of props for DOM (or DOM-like) elements.
The strategy here is to be explicit about what prop transformation you want to use when rendering the component as an element; e.g. there could exist an $rn
for react-native, $r3
for react-three-fiber, etc.
This way, the $
macro does not need to try and reconcile all of the differences that each platform's elements has in regards to prop conventions.
from helix.
Related Issues (20)
- Any good way to make multimethods work as component functions? HOT 8
- gensym / anonymous function syntax breaks fast refresh HOT 2
- Include resources in deps.edn :paths
- $ clj-kondo hook fails to lint & right when component is not a symbol
- The $ macro and new JSX transform HOT 14
- `wrap-fx` is public HOT 1
- Wrappers for useTransition, useDeferredValue, etc. HOT 1
- Is it possible to bypass the camel-casing of properties? HOT 7
- Add wrapper around createRef with atom protocols HOT 2
- How to use with uikit? HOT 2
- Running tests in nodejs with jsdom HOT 4
- Companies using Helix HOT 1
- indent metadata on helix.dom macros HOT 3
- Create use-isomorphic-layout-effect HOT 6
- Make self-hosted CLJS compatible HOT 2
- Fix indentation with CIDER HOT 3
- Release request HOT 1
- Warning: React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead. HOT 2
- `helix.dom/tags` removed HOT 2
- defnc taking pre- & post-conditions HOT 1
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 helix.