Skip to content

Commit 135d5fb

Browse files
heath-freenomenickgros
authored andcommitted
Fix 4726 by removing nanoid in favor of lodash.uniqueId
Fixed rjsf-team#4726 by removing nanoid in favor of lodash.uniqueId - Uninstalled `nanoid` from `@rjsf/utils` and `@rjsf/semantic-ui`, switching to use `uniqueId` from lodash in `utils`'s `getTestId()` and `semantic-ui`'s `FieldErrorTemplate` - Updated all of the `jest.config.js` file to remove `nanoid` - Updated `CHANGELOG.md` accordingly # Conflicts: # CHANGELOG.md
1 parent 5b9bb4f commit 135d5fb

File tree

22 files changed

+93
-128
lines changed

22 files changed

+93
-128
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@ should change the heading of the (upcoming) version to include a major version b
1717
-->
1818
# 6.0.0-beta.15
1919

20+
## @rjsf/semantic-ui
21+
22+
- Updated `ArrayField` to stop using `nanoid` and instead use `lodash/uniqueId` to fix [#4762](https://github.com/rjsf-team/react-jsonschema-form/issues/4726)
23+
2024
## @rjsf/shadcn
2125

2226
- Update `README.md` with picture of the theme!
2327
- Allow passing `className` props to `AddButton`, `BaseInputTemplate`, `CheckboxWidget`, `CheckboxesWidget`, `RadioWidget`, `SelectWidget`, `SubmitButton`, `TextareaWidget` for extra Tailwind CSS customization through `ui:className`
2428

29+
## @rjsf/utils
30+
31+
- Updated `getTestIds` to stop using `nanoid` and instead use `lodash/uniqueId` to fix [#4762](https://github.com/rjsf-team/react-jsonschema-form/issues/4726)
32+
33+
## Dev / docs / playground
34+
35+
- Removed `nanoid` from the build system and `jest.config.js` files
36+
2537
# 6.0.0-beta.14
2638

2739
## @rjsf/core

package-lock.json

Lines changed: 51 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/antd/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"moduleNameMapper": {
88
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
99
},
10-
"transformIgnorePatterns": ["/node_modules/(?!nanoid|deep-freeze-es6)"]
10+
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
1111
}

packages/chakra-ui/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"browsers": ["chrome", "firefox", "safari"]
66
},
77
"setupFilesAfterEnv": ["./test/setup-jest-env.js"],
8-
"transformIgnorePatterns": ["/node_modules/(?!nanoid|deep-freeze-es6)"]
8+
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
99
}

packages/core/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"testEnvironment": "jsdom",
44
"setupFilesAfterEnv": ["./test/setup-jest-env.js"],
55
"testMatch": ["**/test/**/*.test.[jt]s?(x)"],
6-
"transformIgnorePatterns": ["/node_modules/(?!nanoid|deep-freeze-es6)"]
6+
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
77
}

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"lodash": "^4.17.21",
7474
"lodash-es": "^4.17.21",
7575
"markdown-to-jsx": "^7.7.13",
76-
"nanoid": "^5.1.5",
7776
"prop-types": "^15.8.1"
7877
},
7978
"devDependencies": {

packages/daisyui/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
88
"transformIgnorePatterns": [
9-
"/node_modules/(?!(@rjsf|@epicfaace|nanoid|@fortawesome|@coreui|yup|react-day-picker|dayjs|deep-freeze-es6)/)"
9+
"/node_modules/(?!(@rjsf|@epicfaace|@fortawesome|@coreui|yup|react-day-picker|dayjs|deep-freeze-es6)/)"
1010
],
1111
"moduleNameMapper": {
1212
"\\.(css|less|scss|sass)$": "<rootDir>/test/fileMock.js"

packages/daisyui/test/helpers/createMocks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Templates from '../../src/templates/Templates';
66
import generateWidgets from '../../src/widgets/Widgets';
77

88
// Mock any problematic dependencies
9-
// This helps when a dependency like nanoid uses ESM
10-
jest.mock('nanoid', () => ({
9+
// This helps when a dependency like uniqueId uses ESM
10+
jest.mock('lodash/uniqueId', () => ({
1111
nanoid: () => 'test-id-12345',
1212
}));
1313

packages/fluentui-rc/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"testEnvironmentOptions": {
55
"browsers": ["chrome", "firefox", "safari"]
66
},
7-
"transformIgnorePatterns": ["/node_modules/(?!nanoid|deep-freeze-es6)"]
7+
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
88
}

packages/mui/jest.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
"testEnvironmentOptions": {
55
"browsers": ["chrome", "firefox", "safari"]
66
},
7-
"transformIgnorePatterns": ["/node_modules/(?!nanoid|deep-freeze-es6)"]
7+
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
88
}

0 commit comments

Comments
 (0)