Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Remove AJV usage from combinator mappers #2413

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

lucas-koehler
Copy link
Contributor

  • Adapt algorithm to determine the fitting schema index for combinators to no longer use AJV
  • New heuristic uses identifying properties that should match a const value in the schema
  • Adapt MaterialOneOfRenderer.test.tsx to fit new heuristic
  • Describe changes and add examples to migration guide
  • Adapt some of the anyOf and oneOf examples to custom and new identification properties

In contrast to oneOf and anyOf rendererer, allOf renderers do not need the indexOfFittingSchema because all schemas apply at once.
Thus, remove using mapStateToCombinatorRendererProps from mapStateToAllOfProps and, with this, the unnecessary calculation of the index.

fix #2371

Copy link

netlify bot commented Jan 31, 2025

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit cf3f154
🔍 Latest deploy log https://app.netlify.com/sites/jsonforms-examples/deploys/67c5c7c574c8890008085e21
😎 Deploy Preview https://deploy-preview-2413--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lucas-koehler lucas-koehler requested a review from sdirix February 4, 2025 09:33
- Adapt algorithm to determine the fitting schema index for combinators to no longer use AJV
- New heuristic uses identifying properties that should match a const value in the schema
- Adapt MaterialOneOfRenderer.test.tsx to fit new heuristic
- Describe changes and add examples to migration guide
- Adapt some of the anyOf and oneOf examples to custom and new identification properties

#2371
In contrast to oneOf and anyOf rendererer, allOf renderers do not need the `indexOfFittingSchema` because all schemas apply at once.
Thus, remove using mapStateToCombinatorRendererProps from mapStateToAllOfProps and, with this, the unnecessary calculation of the index.

Part of #2371
@lucas-koehler lucas-koehler force-pushed the lk/2371-remove-ajv-from-combinators branch from 07fe0f7 to d9b3550 Compare February 28, 2025 10:40
@lucas-koehler lucas-koehler requested a review from sdirix February 28, 2025 10:40
- remove usage of any number or string property as fallback
- choose type, kind default prop based on combinator schema with const entry instead of presence in the data object
- Adapt tests
- remove usage of id as a default prop
@lucas-koehler lucas-koehler force-pushed the lk/2371-remove-ajv-from-combinators branch from d9b3550 to cf3f154 Compare March 3, 2025 15:16
@lucas-koehler
Copy link
Contributor Author

@sdirix The tests are fixed and the review comments applied :)

@coveralls
Copy link

Coverage Status

coverage: 82.606% (+0.09%) from 82.517%
when pulling cf3f154 on lk/2371-remove-ajv-from-combinators
into daa1836 on master.

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.

Remove AJV usage from combinator mappers
3 participants