8 Commits

Author SHA1 Message Date
Jack Hsu
90c0c8ebf6
fix(react): transpile SVGR into React 19 compatible component (#29543)
This PR fixes an issue with React 19 and our `@nx/react/plugins/jest`
transform. The current transform uses an unsupported `$$typeof` symbol,
and also uses the deprecated `forwardRef` API.

The updated transform will use new API for React 19 and older, while
maintaining the previous API for React 18 and earlier. The backwards
compatibility may be needed if the test is using `ref`, which requires
`forwardRef` older versions.

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
SVGR fails in Jest tests with React 19

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->
SVGR works

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
2025-01-07 18:26:02 -05:00
Jason Jean
2d195007b0
feat(core): switch packages to use the @nx scope (#16069) 2023-04-14 19:56:37 -04:00
Caleb Ukle
f3515e4ddc
fix(testing): use @swc/jest if being used as transformer (#12614) 2022-10-28 10:46:58 -05:00
Caleb Ukle
657b2bff5a
feat(testing): support jest 28 (#10857)
* feat(testing): support jest 28

WIP jest migration

* fix(testing): jest-environment-jsdom must be explicitly added now

* fix(testing): add rxjs to the transform lsit

* fix(testing): jest ts-jest updates and resolver issues

* feat(testing): remove test runner for react native jest

* feat(testing): add preprocessor for react native jest

* fix(testing): update query to handle tsx file syntax, remove rxjs transform

* chore(repo): remove file from accident commit

* chore(testing): update migration to target 14.6 for RN jest preprocessor

* fix(testing): call passed in packageFilter if preset

* docs(testing): add resolver env var to troubleshooting guide

* chore(repo): prep resolver for jest 28 migration

* fix(testing): update deps to handle esbuild-wasm service error

* fix(testing): switch to testEnvironmentOptions for cjs loading vs resolver list

* fix(testing): force babel-jest preset in transformer for project transforms

* chore(testing): address PR feedback

* fix(testing): address pr feedback, remove react-native transform

* chore(testing): update createTreeWithEmptyWorkspace calls

* chore(testing): address pr feedback

* feat(testing): add migration script for react native to rename .babelrc to babel.config.json

* chore(testing): nx format after rebase

* chore(testing): fix display name for @nrwl/js

Co-authored-by: Emily Xiong <xiongemi@gmail.com>
2022-08-18 18:40:31 -04:00
Jack Hsu
8171e68da7
fix(react): handle transform properly for js/ts files in @nrwl/react/plugin/jest (#9898)
Fixes #9640
2022-04-20 16:37:10 +00:00
victor savkin
234ca36385 cleanup(misc): clean up devkit 2020-11-26 10:19:13 -05:00
Jason Jean
e06822da7e
chore(repo): update prettier to v2 (#2934)
this is just for the repo, and not the workspace

Co-authored-by: Rares Matei <matei.rar@gmail.com>
2020-04-29 01:09:37 -04:00
Jack Hsu
ef995fdabe feat(react): add SVG and SVGR support for React apps 2019-12-28 11:06:45 -05:00