facebook/create-react-app

Release react-scripts with #8768 included

Opened this issue · 0 comments

ankon commented

Is your proposal related to a problem?

The problem is described nicely in #8768: Right now jest tests that depend on @ai's nanoevents or nanoid don't work.

Describe the solution you'd like

It seems #8768 was supposed to end up in a 3.4.2 release, but this hasn't happened. Instead 3.4.2 (and 3.4.3) have just been "republished" manually without any commit/tag in github by @gaearon (see #9033 (comment), 8e761d1#commitcomment-41533857)
Note that #9634 explicitly asks for the missing tags.

In the current state therefore we still cannot run the jest tests except by ejecting, which clearly is not what most users would (or should) want.

I would therefore propose that a patch release is created that includes the fix for #8768.

Describe alternatives you've considered

  1. Wait for 4.0 to be released. While this might be close (#8768 (comment) in July says 99% close, with just eslint stuff missing), it's hard to work on that assumption.
  2. #9612 asks for a new minor/patch release before 4.0 to address various issues (outdated dependencies, fixes, etc), but even though there are many "thumbs up!" emojis and the issue is already open since a month, there is no reply yet on it. Adding a comment there then seems to be less likely to be seen.

Additional context

As a work-around, as I cannot comment on the original PR: It is possible to apply the needed changes to an existing project, by using the fact that react-scripts test passes through arguments to jest, and jest uses the command-line-provided arguments as overrides:

In package.json, replace the invocation to react-scripts test with something like this:

{
  // ...
  "scripts": {
    // ...
    "test": "react-scripts test --transform '{\"^.+\\\\.(js|jsx|mjs|cjs|ts|tsx)$\":\"<rootDir>/node_modules/react-scripts/config/jest/babelTransform.js\", \"^.+\\\\.css$\": \"<rootDir>/node_modules/react-scripts/config/jest/cssTransform.js\", \"^(?!.*\\\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)\": \"<rootDir>/node_modules/react-scripts/config/jest/fileTransform.js\"}' --transformIgnorePatterns '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$' --transformIgnorePatterns '^.+\\.module\\.(css|sass|scss)$'",
    // ..
  },
  // ...
}