Skip to content

Conversation

@nickgros
Copy link
Contributor

@nickgros nickgros commented Nov 19, 2025

Reasons for making this change

Resolves #4774

  • Replace json-schema-merge-allof with @x0k/json-schema-merge
  • Update TypeScript configuration to use package exports field for imports
  • Update documentation to scrub json-schema-merge-allof

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npx nx run-many --target=build --exclude=@rjsf/docs && npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could not import from @x0k/json-schema-merge/lib/array without changing this. I think the old node resolution did not respect the package exports

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'm actually surprised I didn't change that one along with the rest that I did change

- 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

Comment on lines -2 to -3
// With Lerna active, the test world has access to the test suite via the symlink
import { TestValidatorType } from '@rjsf/utils/test/schema';
Copy link
Contributor Author

@nickgros nickgros Nov 19, 2025

Choose a reason for hiding this comment

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

This stopped working after I updated the TypeScript configuration, likely because ./test/schema is not actually exported by @rjsf/utils.

Surprisingly, a relative path to the utils folder didn't break anything, so let's go with that.

food: { type: 'string', enum: ['meat', 'grass', 'fish'] },
},
required: ['animal', 'food'],
required: ['food', 'animal'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The order of these changed, but otherwise all tests passed

deep: false,
resolvers: {
$defs: mergeAllOf.options.resolvers.definitions,
},
Copy link
Contributor Author

@nickgros nickgros Nov 19, 2025

Choose a reason for hiding this comment

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

One thing I am unsure of is if the behavior this option controlled is supported by @x0k/json-schema-merge. Since resolution of references is a non-goal of that project, I would expect not.

However, we don't have a test for this, so I'm not sure if we were relying on json-schema-merge-allof to do resolution in the first place, and I don't know exactly what kinds schemas this might affect.

Copy link
Member

Choose a reason for hiding this comment

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

Have you tried asking the author of the library whether it does this behavior, and if so, how to configure it?

Copy link
Contributor

Choose a reason for hiding this comment

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

  • deep: false -> createShallowAllOfMerge
  • Merging $defs is supported source

deep: false,
resolvers: {
$defs: mergeAllOf.options.resolvers.definitions,
},
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried asking the author of the library whether it does this behavior, and if so, how to configure it?

"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "node",
"moduleResolution": "bundler",
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I'm actually surprised I didn't change that one along with the rest that I did change

- additional feedback
@nickgros nickgros merged commit 828331b into rjsf-team:main Nov 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New alternative to json-schema-merge-allof

3 participants