Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release react-scripts with #8768 included #9814

Open
ankon opened this issue Oct 16, 2020 · 0 comments
Open

Release react-scripts with #8768 included #9814

ankon opened this issue Oct 16, 2020 · 0 comments

Comments

@ankon
Copy link

ankon commented Oct 16, 2020

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 (Add .cjs and .mjs files support to test runner #8768 (comment) in July says 99% close, with just eslint stuff missing), it's hard to work on that assumption.
  2. 3.x release before 4.0? #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)$'",
    // ..
  },
  // ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant