GithubHelp home page GithubHelp logo

Comments (4)

darwin avatar darwin commented on July 3, 2024

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.

darwin avatar darwin commented on July 3, 2024

@Lokeh FYI, I started experimental work on that props translation. See the above commit.

from helix.

darwin avatar darwin commented on July 3, 2024

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.

lilactown avatar lilactown commented on July 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.