Skip to content

[Chore] Simplify the generation of the type definition files #223

Open
@nmn

Description

React Strict DOM has a single file for Flow type definitions and a single file for TS type definitions.

The build step for this is fairly complex, however:

  • We transform the entire folder of source files to individual .js.flow and .d.ts files using flow-api-translator.
  • We then use a script to concatenate all the type files into a single file
  • We then delete the folder

The script that concatenates the types from all the files is brittle and can break if we accidentally use the same type name in different files.


We should be able to simplify this process by using this Rollup-like bundler that understands Flow syntax.

We will need to wait for this bundler to be migrated to the hermes repo and open-sourced as a standalone package.

Activity

necolas

necolas commented on Oct 16, 2024

@necolas
Contributor

React Strict DOM has a single file for Flow type definitions and a single file for TS type definitions.

I don't think that has been the case for a while. But it would be good to go back to 1-file libdefs using the flow bundler at some point

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @necolas@nmn

      Issue actions

        [Chore] Simplify the generation of the type definition files · Issue #223 · facebook/react-strict-dom