Giter VIP home page Giter VIP logo

Comments (7)

lilactown avatar lilactown commented on August 29, 2024 1

This is a good question.

While it would be simpler and "cleaner" to map the keywords to strings without munging, it would break people's expectations that they have with hiccup coming from e.g. Reagent, Rum, Sablono, etc.

I'm thinking mainly about using :div, :input, etc.

There is a balance tension to provide something familiar and easy to help new users, while also avoiding footguns and too many corner cases.

Since it would be a breaking change, I don't think I'm going to remove munging for now. It is on my mind.

For this particular issue, I believe it's another case missed in camel->kebab so should be an easy fix.

from hx.

lilactown avatar lilactown commented on August 29, 2024 1

I suppose what we could do is limit the kebab->camel transformation to DOM elements e.g. [:div {:class "foo" :on-click handle}].

This way we would pass in props as-is to any React component, so you'd use camel for React components from NPM and kebab for your CLJS components.

That actually doesn't seem too bad, and might not be too much of a breaking change.

I will think about it.

from hx.

orestis avatar orestis commented on August 29, 2024

Compatibility with reagent is definitely not drop-in because of #29 :)

But I get the point.

from hx.

orestis avatar orestis commented on August 29, 2024

Oh, actually, would it make sense to apply the camelCasing transform only in the DOM specific properties? I believe React maintains a whitelist for them, not sure if it’s exposed somewhere.

from hx.

orestis avatar orestis commented on August 29, 2024

I like this. It also increases grepability and saves you the mental transformation when reading docs for an npm react component.

from hx.

lilactown avatar lilactown commented on August 29, 2024

I've created a PR that simplifies the props munging per our discussion here: #40

Thoughts?

from hx.

orestis avatar orestis commented on August 29, 2024

Upon initial inspection, it looks good. I'll need to run it locally tomorrow to check further.

Thanks for putting all this time into this library!

from hx.

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.