kentcdodds / kcd-scripts

CLI toolbox for common scripts for my projects

Home Page:http://npm.im/kcd-scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ReactDOM is misspelled as ReactDom in UMD files

hornta opened this issue · comments

I first issued this to the @testing-library/react but after debugging I found out this issue belongs to this project.

Looks like it's caused by https://github.com/kentcdodds/kcd-scripts/blob/master/src/config/rollup.config.js#L44. I don't know the reasoning behind this.


testing-library/react-testing-library#797

I noticed that the generated UMD files has incorrect spelling of ReactDOM. The "DOM" part is misspelled as "Dom".

Steps:

  • npm i @testing-library/react -SED
  • Search for ReactDom in ./node_modules/@testing-library

Screenshot 2020-10-12 at 17 39 49

How did I find this? Our company are using a legacy build system and we rely on globals everywhere and we are on way to migrate from Enzyme to this lib.

This is just a default, individual libraries should configure those defaults as needed. React Testing Library does this: https://github.com/testing-library/react-testing-library/blob/master/.bundle.main.env

Unfortunately there's no reasonable way for us to know or infer the true global variable so we make our best guess.