insin / babel-plugin-react-html-attrs

Babel plugin which transforms HTML and SVG attributes on JSX host elements into React-compatible attributes

Home Page:https://astexplorer.net/#/gist/0008d677e8156dab437be51d1fee1757/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release new version

insin opened this issue · comments

Hey buddy! Would you like some help on this? (I'm still an avid user :D)

Made an issue to make sure I wouldn't forget.

Forgot.

I'll cut a release later today 👍

@ericclemmons One thing before I do: I was considering backing out the change which added loads more attributes first because I think the plugin should attempt to restrict those fixes to creation of the specific HTML elements they apply to, otherwise it increases the scope for an incredibly confusing prop-naming bug if you happen to use one of them in a custom component.

Sound good?

@insin Sorry, I don't fully understand. Can you give an example or describe what your preference is?

An alternative would be to keep the translations, but allow an option for the plugin to accept key/value pairs for the user to opt into.

With the big translation list I reverted, if you wrote a component whose usage was something like <TimeSince datetime={this.state.someDate}/>, you'd be scratching your head for a while before figuring out this plugin was silently changing it to dateTime.

I could make it configurable, but class and for are the only ones which regularly bother me.

v2.1.0 is published now, but after releasing it and fixing the t o t a l l y incorrect test I added, it seems plugin order also matters.

Thanks, this totally makes sense!