react icon indicating copy to clipboard operation
react copied to clipboard

Add hermes-transform infra

Open kassens opened this issue 1 year ago • 0 comments

Add hermes-transform infra

This adds hermes-transform as a dependency for scripts to allow us to run some codemods updating tests.

If this turns out useful, there's obviously more that can be done to the script, but as these internal codemods are pretty one-off, I'm also okay to keep it fairly rough.

The included codemod is a starting point to convert tests to crateRoot. Due to many different patterns in tests, this does just the following:

  • convert it and expect calls that contain ReactDOM.render to the async variant, so await can be used inside.
  • convert ReactDOM.render(el, container) to root.render(el). Note that this does not create root and that needs to be updated manually.

Stack created with Sapling. Best reviewed with ReviewStack.

  • #27994
  • -> #27921

kassens avatar Jan 10 '24 18:01 kassens