Skip to content

Conversation

@lucasmcht
Copy link
Contributor

@lucasmcht lucasmcht commented Oct 28, 2024

Fixes #3695 (Rework of PR #3881) and #1680

Reasons for making this change

Currently, to per-field customize the template, it is necessary to send the function/class of the component in the uiSchema, breaking the JSON nature of the uiSchema. It's not possible to provide just the registration key.

This pull request includes updates to the @rjsf/utils package to allow for per-field customization using string keys from the Registry, as well as updates to the documentation to reflect these changes. Additionally, it simplifies the types in the codebase by introducing a new RJSFBaseProps type.

Feature Enhancements

  • packages/utils/src/getTemplate.ts: Updated getTemplate() to allow per-field customization using string keys from the Registry.

Documentation Updates

  • packages/docs/docs/advanced-customization/custom-templates.md: Updated to include examples of specifying templates using both components and string values from the Registry.

Type Simplification

  • packages/utils/src/types.ts: Introduced RJSFBaseProps to simplify and consolidate the properties passed to various template components. This change affects multiple type definitions, including ErrorListProps, FieldErrorProps, FieldHelpProps, FieldTemplateProps, and others.

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
@heath-freenome
Copy link
Member

@lucasmcht Also, can you fix the type errors in the themes?

@heath-freenome
Copy link
Member

@lucasmcht Some of your tests are failing

@heath-freenome
Copy link
Member

@lucasmcht Please fix the tests so that we can merge this. Thanks

@heath-freenome
Copy link
Member

@lucasmcht are you able to do the final bits so that we can merge your work?

@lucasmcht
Copy link
Contributor Author

@heath-freenome Yes I just need to find some bandwith and I'll finish the feature, I'll finish it this week or the next

@heath-freenome
Copy link
Member

@heath-freenome Yes I just need to find some bandwith and I'll finish the feature, I'll finish it this week or the next

@lucasmcht still waiting for you to finish this... Note that soon we will be merging in our rjsf-v6 branch to main and starting a beta, so the sooner you complete this the better

@lucasmcht
Copy link
Contributor Author

@heath-freenome Should be fixed now. Sorry for the delay.

@heath-freenome
Copy link
Member

@lucasmcht Looks like you are using something more modern than our babel supports. The pipeline is failing

@lucasmcht
Copy link
Contributor Author

@heath-freenome Is it better now ?

@heath-freenome
Copy link
Member

heath-freenome commented Mar 27, 2025

@lucasmcht was it really Node 14?! We are dropping support for it in the rjsf-v6 beta. Maybe it makes sense to put your fix into the rjsf-v6 branch instead and restore the code you switched in your last commit. If so, you can just update the CHANGELOG_v6.md instead of CHANGELOG.md. If not, can you at least add a comment to restore the hasOwn() functions in v6

@heath-freenome heath-freenome merged commit bf49ef1 into rjsf-team:main May 2, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants