-
Notifications
You must be signed in to change notification settings - Fork 416
Remove json-schema-ref-parser #1762
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
Remove json-schema-ref-parser #1762
Conversation
3f57522 to
45c2f65
Compare
45c2f65 to
ae1e113
Compare
| }); | ||
|
|
||
| it('should add an item within an array', async () => { | ||
| it.skip('should add an item within an array', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why skip all these tests?
|
I tested the examples, the AnyOf, OneOf, AllOf Resolve example (/packages/examples/src/anyOf-oneOf-allOf-resolve.ts) is crashing. I didn't test which of these crashed before. |
eneufeld
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed, we should update the resolver code and the examples in a follow up commit.
Removes json-schema-ref-parser and corresponding resolving functionality and dependencies from JSON Forms. Resolving of external dependencies is not a core feature of JSON Forms which is why we delegated it to a 3rd party dependency. However the json-schema-ref-parser library is not only slow and mutating schemas in place but also brings in a number of questionable Node dependent dependencies. The only binding actually using this functionality is the React binding. The way resolving was implemented resulted in the same flow as resolving it outside of JSON Forms and handing the resolved schema over for all but the very niche use case of unresolved schemas in the ui schema registry. Even that case can still be handled using a custom renderer. Based on these downsides and the very little upsides we decided to remove json-schema-ref-parser without a replacement from JSON Forms. Angular and Vue consumers don't need to spend any migration efforts. In @jsonforms/react we still export the backward API compatible 'ResolvedJsonFormsDispatch'. Therefore only React consumers actually using the now removed `refParserOptions` are forced to migrate while for all other React consumers it depends on their use cases. The built-in resolving mechanism in JSON Forms is quite basic. When the schema was fully resolved anyway the basic resolving did quite fine. However as this is no longer the case by default, there are now cases which are no longer supported and break. This is especially the case for complex combinator use cases involving references. Of course these can still be used when the consumer resolves their schema themselves before handing it over to JSON Forms. We also plan to make our built-in resolving more robust before the full 3.0 release to cover more of these cases. However we will not reach feature parity without major additional efforts.
ae1e113 to
5e01daf
Compare
Removes json-schema-ref-parser and corresponding resolving functionality
and dependencies from JSON Forms.
Resolving of external dependencies is not a core feature of JSON Forms
which is why we delegated it to a 3rd party dependency. However the
json-schema-ref-parser library is not only slow and mutating schemas in
place but also brings in a number of questionable Node dependent
dependencies.
The only binding actually using this functionality is the React
binding. The way resolving was implemented resulted in the same flow
as resolving it outside of JSON Forms and handing the
resolved schema over.
Based on these downsides and the very little upsides we decided to
remove json-schema-ref-parser without a replacement from JSON Forms.
Angular and Vue consumers don't need to spend any migration efforts. In
@jsonforms/react we still export the backward API compatible
'ResolvedJsonFormsDispatch'. Therefore only React consumers actually
using the now removed 'refParserOptions' are forced to migrate while
for all other React consumers it depends on their use cases.
The built-in resolving mechanism in JSON Forms is quite basic. When
the schema was fully resolved anyway the basic resolving did quite
fine. However as this is no longer the case by default, there are
now cases which are no longer supported and break. This is especially
the case for complex combinator use cases involving references.
Of course these can still be used when the consumer resolves their
schema themselves before handing it over to JSON Forms. We also plan
to make our built-in resolving more robust before the full 3.0 release
to cover more of these cases. However we will not reach feature parity
without major additional efforts.