Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,30 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.

-->

# 6.1.2

## @rjsf/antd

- Updated `SelectWidget` to add a static `getPopupContainerCallback` to the `SelectWidget` component, partially fixing [#3609](https://github.com/rjsf-team/react-jsonschema-form/issues/3609)
- Also, added the explicit `open` state to the `Select` in conjunction with providing the `setOpen` as the `onOpenChange` prop
- Also, added the explicit `open` state to the `Select` in conjunction with providing the `setOpen` as the `onOpenChange` prop
- In `BaseInputTemplate` added comments explaining why `step='1'` is returned, closing [#4022](https://github.com/rjsf-team/react-jsonschema-form/issues/4022)

## @rjsf/mantine

- Align Mantine’s behavior with other themes when clearing string fields: clearing an input now removes the key from formData instead of setting it to an empty string. ([#4875](https://github.com/rjsf-team/react-jsonschema-form/pull/4875))

## @rjsf/utils

- Replace json-schema-merge-allof with [@x0k/json-schema-merge](https://github.com/x0k/json-schema-merge/) ([#4774](https://github.com/rjsf-team/react-jsonschema-form/issues/4774))

## Dev / docs / playground

- Updated `DemoFrame` as follows to fix [#3609](https://github.com/rjsf-team/react-jsonschema-form/issues/3609)
- Override `antd`'s `SelectWidget.getPopupContainerCallback` callback function to return undefined
- Added a `AntdSelectPatcher` component that observes the creation of `antd` select dropdowns and makes sure they open in the correct location
- Update the `antd` theme wrapper to render the `AntdSelectPatcher`, `AntdStyleProvider` and `ConfigProvider` with it's own `getPopupContainer()` function inside of a `FrameContextConsumer`
- Updated TypeScript configuration to use `"moduleResolution": "bundler"`

# 6.1.1

Expand Down Expand Up @@ -197,7 +204,7 @@ should change the heading of the (upcoming) version to include a major version b
- Updated the `OptionsDrawer` of the playground to add `idPrefix` and `idSeparator` fields
- Updated test files to switch to using the React Testing library instead of `react-test-renderer`, updating all snapshots accordingly
- Updated Fluent libraries to latest, with updated snapshots
- Added Node 24 to `ci.yml`, removing `v5` and old Node 14 non-docs builds
- Added Node 24 to `ci.yml`, removing `v5` and old Node 14 non-docs builds
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and below was automatic whitespace formatting


# 6.0.1

Expand All @@ -218,7 +225,7 @@ should change the heading of the (upcoming) version to include a major version b
## @rjsf/core

- Updated `SchemaField` to add a new optional property `childFieldPathId` to the `FieldComponent` render to prevent duplicate ids, fixing (#4819)[https://github.com/rjsf-team/react-jsonschema-form/issues/4819]
- Also updated `ObjectField` and `ArrayField` to make children use the `childFieldPathId` if present, falling back to the `fieldPathId` if not
- Also updated `ObjectField` and `ArrayField` to make children use the `childFieldPathId` if present, falling back to the `fieldPathId` if not

## Dev / docs / playground

Expand All @@ -245,7 +252,7 @@ should change the heading of the (upcoming) version to include a major version b
- Updated `Form` to support the new feature to do `onBlur` handling of `liveValidate` and `liveOmit`
- Updated `FormProps` to add the new `initialFormData` prop
- Updated `Form` so that is behaves as a "controlled" form when `formData` is passed and uncontrolled when `initialFormData` is passed, fixing [#391](https://github.com/rjsf-team/react-jsonschema-form/issues/391)
- Also fixed an issue where live validation was called on the initial form render, causing errors to show immediately, partially fixing [#512](https://github.com/rjsf-team/react-jsonschema-form/issues/512)
- Also fixed an issue where live validation was called on the initial form render, causing errors to show immediately, partially fixing [#512](https://github.com/rjsf-team/react-jsonschema-form/issues/512)
- Updated `Form` to add a new programmatic function, `setFieldValue(fieldPath: string | FieldPathList, newValue?: T): void`, fixing [#2099](https://github.com/rjsf-team/react-jsonschema-form/issues/2099)
- Added new `FallbackField` to add opt-in functionality to control form data that is of an unsupported or unknown type ([#4736](https://github.com/rjsf-team/react-jsonschema-form/issues/4736)).
- Refactored much of the `FileWidget` implementation into a new `useFileWidgetProps()` hook, fixing [#3146](https://github.com/rjsf-team/react-jsonschema-form/issues/3146)
Expand Down Expand Up @@ -384,7 +391,7 @@ should change the heading of the (upcoming) version to include a major version b
- Updated the `customArray` sample to refactor out a `ArrayFieldItemButtonsTemplate`
- Updated the `custom-templates.md` documentation to reflect the `additionalProperties`-based interface props replacement and `ArrayField` conversion changes
- Updated the `utility-functions.md` documentation to add the new `useDeepCompareMemo()` hook
- Updated the `v6.x upgrade guide.md` documentation to add the BREAKING CHANGES to the `ArrayFieldTemplateProps`, `ArrayFieldItemTemplateType`, `ArrayFieldItemButtonsTemplateType`, `FieldTemplateProps`, `ObjectFieldTemplateProps` and `WrapIfAdditionalTemplateProps` interface props changes and the `useDeepCompareMemo()` hook
- Updated the `v6.x upgrade guide.md` documentation to add the BREAKING CHANGES to the `ArrayFieldTemplateProps`, `ArrayFieldItemTemplateType`, `ArrayFieldItemButtonsTemplateType`, `FieldTemplateProps`, `ObjectFieldTemplateProps` and `WrapIfAdditionalTemplateProps` interface props changes and the `useDeepCompareMemo()` hook
- Added documentation for the `nameGenerator` prop in `form-props.md` and v6.x upgrade guide
- Updated `@rjsf/snapshot-tests` package to explicitly depend on `@rjsf/core` to build first, fixing an error with parallelized builds

Expand All @@ -411,11 +418,11 @@ should change the heading of the (upcoming) version to include a major version b
- Updated `ArrayFieldTemplate`, `ObjectFieldTemplate`, `TitleField` to add support for the new `optionalDataControl` feature
- Added the new `OptionalDataControlTemplate` to the theme, adding it to the `templates` list
- Updated `Form` as follows to fix [#4796](https://github.com/rjsf-team/react-jsonschema-form/issues/4796)
- Refactored the `liveValidate()` and `mergeErrors()` functions out of `getStateFromProp()` and `processPendingChange()`
- Added new, optional `customErrors?: ErrorSchemaBuilder<T>` to the `FormState`, updating the `IChangeEvent` interface to remove all of the private variables
- Reworked the `newErrorSchema` handling in `processPendingChange()` to simplify the handling since `newErrorSchema` is now path-specific, adding `newErrorSchema` to `customErrors` when they don't match an existing validator-based validation
- This rework resulted in any custom errors passed from custom widgets/fields will now be remembered during the validation stage
- Removed the now unused `getPreviousCustomValidateErrors()` and `filterErrorsBasedOnSchema()` methods
- Refactored the `liveValidate()` and `mergeErrors()` functions out of `getStateFromProp()` and `processPendingChange()`
- Added new, optional `customErrors?: ErrorSchemaBuilder<T>` to the `FormState`, updating the `IChangeEvent` interface to remove all of the private variables
- Reworked the `newErrorSchema` handling in `processPendingChange()` to simplify the handling since `newErrorSchema` is now path-specific, adding `newErrorSchema` to `customErrors` when they don't match an existing validator-based validation
- This rework resulted in any custom errors passed from custom widgets/fields will now be remembered during the validation stage
- Removed the now unused `getPreviousCustomValidateErrors()` and `filterErrorsBasedOnSchema()` methods
- Updated `LayoutGridField` to simplify `onFieldChange()` to just return the given `errorSchema` now that it is path-specific, fixing [#4796](https://github.com/rjsf-team/react-jsonschema-form/issues/4796)
- Updated `NullField` to pass `fieldPathId.path` for the `onChange()` instead of `[name]`

Expand Down Expand Up @@ -476,7 +483,7 @@ should change the heading of the (upcoming) version to include a major version b
- Updated `GlobalFormOptions` to add new `enableOptionalDataFieldForType?: ('object' | 'array')[]` prop
- Updated `SchemaUtilsType`'s `retrieveSchema()` function to add an additional, property `resolveAnyOfOrOneOfRefs?: boolean`
- Updated the `Templates` interface to add a new required template `OptionalDataControlsTemplate: ComponentType<OptionalDataControlsTemplateProps<T, S, F>>`
- Updated `retrieveSchema()` to add an additional property `resolveAnyOfOrOneOfRefs?: boolean` which causes `resolveAllSchemas()` to resolve `$ref`s inside of the options of `anyOf`/`oneOf` schemas
- Updated `retrieveSchema()` to add an additional property `resolveAnyOfOrOneOfRefs?: boolean` which causes `resolveAllSchemas()` to resolve `$ref`s inside of the options of `anyOf`/`oneOf` schemas
- Updated `getDefaultFormState` to fix an issue where optional array props had their default set to an empty array when they shouldn't be
- Updated the `TranslatableString` enum to add three new strings in support of the new feature: `OptionalObjectAdd`, `OptionalObjectRemove` and `OptionalObjectEmptyMsg`
- Added four new utility functions: `isFormDataAvailable()`, `isRootSchema()`, `optionalControlsId()`, and `shouldRenderOptionalField()`
Expand Down
99 changes: 10 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/antd/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"moduleNameMapper": {
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js"
},
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
"transformIgnorePatterns": ["/node_modules/(?!(@x0k/json-schema-merge|deep-freeze-es6))"]
}
2 changes: 1 addition & 1 deletion packages/chakra-ui/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"browsers": ["chrome", "firefox", "safari"]
},
"setupFilesAfterEnv": ["./test/setup-jest-env.js", "../../testing/testSetup.ts"],
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
"transformIgnorePatterns": ["/node_modules/(?!(@x0k/json-schema-merge|deep-freeze-es6))"]
}
2 changes: 1 addition & 1 deletion packages/core/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"testEnvironment": "jsdom",
"setupFilesAfterEnv": ["./test/setup-jest-env.js", "../../testing/testSetup.ts"],
"testMatch": ["**/test/**/*.test.[jt]s?(x)"],
"transformIgnorePatterns": ["/node_modules/(?!deep-freeze-es6)"]
"transformIgnorePatterns": ["/node_modules/(?!(@x0k/json-schema-merge|deep-freeze-es6))"]
}
4 changes: 1 addition & 3 deletions packages/daisyui/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"^.+\\.(t|j)sx?$": "babel-jest"
},
"coveragePathIgnorePatterns": ["/node_modules/", "/test/"],
"transformIgnorePatterns": [
"/node_modules/(?!(@fortawesome|yup|react-day-picker|dayjs|deep-freeze-es6)/)"
],
"transformIgnorePatterns": ["/node_modules/(?!(@x0k|@fortawesome|yup|react-day-picker|dayjs|deep-freeze-es6)/)"],
"moduleNameMapper": {
"\\.(css|less|scss|sass)$": "<rootDir>/test/fileMock.js"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/advanced-customization/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This component follows [JSON Schema](http://json-schema.org/documentation.html)

You can also use `oneOf` with [schema dependencies](../json-schema/dependencies.md#schema-dependencies) to dynamically add schema properties based on input data.

The `allOf` keyword is supported; it uses [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.
The `allOf` keyword is supported; it uses [@x0k/json-schema-merge](https://github.com/x0k/json-schema-merge/) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.

- `"additionalProperties":false` produces incorrect schemas when used with [schema dependencies](../json-schema/dependencies.md#schema-dependencies). This library does not remove extra properties, which causes validation to fail. It is recommended to avoid setting `"additionalProperties":false` when you use schema dependencies. See [#848](https://github.com/rjsf-team/react-jsonschema-form/issues/848) [#902](https://github.com/rjsf-team/react-jsonschema-form/issues/902) [#992](https://github.com/rjsf-team/react-jsonschema-form/issues/992)

Expand Down
2 changes: 1 addition & 1 deletion packages/docs/docs/api-reference/form-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ NOTE: If there is a default for a field and the `formData` is unspecified, the d

## experimental_customMergeAllOf

The `experimental_customMergeAllOf` function allows you to provide a custom implementation for merging `allOf` schemas. This can be particularly useful in scenarios where the default [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) library becomes a performance bottleneck, especially with large and complex schemas or doesn't satisfy your needs.
The `experimental_customMergeAllOf` function allows you to provide a custom implementation for merging `allOf` schemas. This can be particularly useful in case the where the default merge library ([@x0k/json-schema-merge](https://github.com/x0k/json-schema-merge/)) doesn't satisfy your functional or performance requirements.

By providing your own implementation, you can potentially achieve significant performance improvements. For instance, if your use case only requires a subset of JSON Schema features, you can implement a faster, more tailored merging strategy.

Expand Down
Loading