-
Notifications
You must be signed in to change notification settings - Fork 38
Conversation
Co-authored-by: Patrick Ecker <patrick@ecker.dev>
- use rescript-react for the new jsx transform - change cli arg, react-runtime -> jsx-mode - add cli arg, jsx-module
While this is a breaking change, I'm wondering whether it could be turned into a net positive. worth thinking about anyway |
One possible view is that for component definitions, what the ppx does is completely transparent and documented. So this is about just accepting the current situation and putting it in context. A separate thing to think about is to tweak the name of the props type being defined. |
I had noticed it with the test case in |
Not sure I understand which one you're proposing: Which one are you thinking about? |
This is what I'm proposing. |
I think this needs to be enforced directly in the ppx. Not by a compiler error. |
So for each module in the ast, check that at most 1 component definition is there. |
Can I ask what your proposal is?
I guess it is not a difficult job to achieve with EDIT: not even |
Exactly. It fits naturally in the existing ppx mapper. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of visual changes so don't know exactly everything that has changed.
But notice that hasReactComponent
could be changed in a sub-module, and should be restore to its previous value when processing the submodule is finished.
Most diff is cased by indent by if else expression added. Actually, |
Shouldn't config.hasReactComponent be restored? |
I added to restore the old value of config.hasReactComponent |
This is looking good for an initial merge as WIP. Seems low-risk as existing projects are using V3 and should not be affected. |
This moves #586 to a branch on the repo.