Skip to content

Move JsxDOM types etc. into @rescript/react(-dom) #8400

Description

@cknitt

Proposal:

  • Remove modules Dom, Dom_storage, Dom_storage2 from the @rescript/runtime package
  • Instead of those, vendor the base package of experimental-webapi
  • Make the vendored @rescript/react depend on that
  • Split off @rescript/react-dom
  • Move JsxDOM/JsxDOMStyle/JsxEvent into @rescript/react-dom
  • Make everything work 🙂
  • Also make it work/test with rescript-react-native and a with non-React JSX runtime like Xote

Note that any vendoring here (@rescript/react, @rescript/react-dom, relevant parts of webapi and rescript-react-native/Xote) does not mean moving the source of truth for these packages into the compiler repo. It's just for easier and quicker iteration while moving things around.

Once the new shape has crystallized, things need to be synced back to the respective repos.

Activity

  1. added this to the v13 milestone on Apr 29, 2026
  2. added theissue type on Apr 29, 2026
  3. dkirchhof commented on Apr 30, 2026

    @dkirchhof
    Contributor

    I started to work on it here:

    rescript-lang/rescript-react#151
    #8282

    Now, after about 2 months, there are a lot of conflicts. Maybe it's a good starting point. Maybe not. Could fix the merge conflicts first, if this is going in the right direction.

  4. tsnobip commented on Apr 30, 2026

    @tsnobip
    Member

    @cknitt do we want to split off @rescript/react-dom to its own package or should we rather use rewatch "features"?

  5. cknitt commented on Apr 30, 2026

    @cknitt
    MemberAuthor

    Not sure. I was originally leaning towards splitting it off to match what people would be expecting following the npm package structure (react/react-dom, @types/react/@types/react-dom).

    OTOH maybe keeping it a single package with all features on by default would improve compatibility/ease migration.

  6. tsnobip commented on May 1, 2026

    @tsnobip
    Member

    You're right, those are separate packages in js so it'd make sense to stick to the same structure.

  7. dkirchhof commented on May 14, 2026

    @dkirchhof
    Contributor

    So, I updated my branches and fixed the conflicts.
    Unfortunately, I have no idea how to fix the missing dependencies. Rescript-React should be included in the monorepo since the dependencies point to a "workspace" version?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions