Repository navigation
Support data-* attributes in DOM JSX - #933
anmonteiro wants to merge 6 commits into
Conversation
|
Note on digits: server-reason-react's ppx converts data attribute names differently when a digit follows a letter.
server-reason-react puts a dash before every character that is unchanged by If one component is rendered on the server with server-reason-react and hydrated with reason-react, the attribute names will not match. We should agree on one rule. |
5d27b57 to
6f1ef6b
Compare
data-* attributes in DOM JSX3d44983 to
efa1f26
Compare
|
@davesnx to confirm, does it make sense to change server-reason-react, or will that be a breaking change for folks who may be using it? |
efa1f26 to
21db365
Compare
afac9ad to
a078dd5
Compare
Use an erased DOM prop checker for typing and Merlin while emitting a single object constructor. Preserve identifier locations without duplicating complex expressions, restore the generated JavaScript snapshot, and cover nested JSX completion.
d133e9a to
b1fc8ff
Compare
|
I prefer to keep the server-reason-react intact and update the logic here, there's no user of data-* aside from ahrefs afaik and this code is new. |
|
@davesnx for sure, open to that! I was just confirming what you had said above:
It sounds like we'll change this one to match instead! |
Hyphenate digits and underscores, and accept data-prefixed names while keeping standard data and datatype props on their existing DOM path. Update output snapshots, runtime coverage, and documentation.
|
The output of the attributes are often critical in some cases where a 3rd party integration asks for a specific name, and not being able to represent those are a big blocker. I push a PR ml-in-barcelona/server-reason-react#412 to improve the output, maybe we can align? Sorry for the back and forth but I think it might be worth it |
Support arbitrary string-valued data attributes in DOM JSX, including optional attributes. Extends the coverage merged in #934 and #935 to exercise JSX support. Fixes #230; related to melange-re/melange#2004.
01a17001-efda-7320-8b10-3844e629533f