Skip to content

Async ref resolving#1505

Closed
edgarmueller wants to merge 19 commits intoeclipsesource:masterfrom
edgarmueller:fix/ref-handling-refactoring
Closed

Async ref resolving#1505
edgarmueller wants to merge 19 commits intoeclipsesource:masterfrom
edgarmueller:fix/ref-handling-refactoring

Conversation

@edgarmueller
Copy link
Copy Markdown
Contributor

@edgarmueller edgarmueller commented Oct 1, 2019

Some thing we need to clarify from the top of my head:

  • manual ref resolution in context of arrays via ResolveRef (clear resolving design) + when to use ScopedRenderer
  • caching of refs (this could be part of the store state)
  • duplicate code (refResovler callback)
  • usage of resolveLocalSchema
  • generation of UI schema for object controls
  • typings

@edgarmueller edgarmueller force-pushed the fix/ref-handling-refactoring branch 3 times, most recently from 1572b8b to b8ff16e Compare October 8, 2019 12:29
sdirix and others added 18 commits October 9, 2019 12:59
Avoid returning objects with circular references
Prepare core package for resolving refs in an asynchronous manner:
- synchronous resolving functions have been removed, only a refactored
  resolveLocalSchema remains
- `refParserOptions` props is made available to most renderer property
  sets
- to avoid ending up with unresolvable refs (i.e. the scoped down
  schema is too narrow), we now require refs to be absolute.
  This has a couple of implications: first, the UI schema generation
  must produce absolute schema paths, second, `toDataPath` must
  be adapted as schema path now contain more keywords than before
- as ref resolving is asynchronous, testers are as well. This changes
  the signature of a tester: they return Promises and additionally
  also expect a `refResolver` paramter for resolving any refs
- enum props do not feature an `indexOfFittingSchema` prop anymore
  as it involved ref resolving
- Add ScopedRenderer component capable of resolving a JSON pointer
  given by an UI schema element. This is essentially the replacement
  mechanism for resolving refs lazily in-place
- Adapt JSONForms and DispatchCell components
- Add RefResolver component which is intended to be registered as
  a renderer. This deals with cases where the root schema only contains
  a `$ref`
Adapt Material UI renderers to new resolution mechanism. Note that
array-based renderers utilize manual resolution via `ResolveRef`.
This is necessary because when de-referencing the `items` property
we can end up with a schema that's a `$ref` again which is not the
case for regular controls.
Adapt array with detail example to feature absolute paths
for detail view
* `ResolveRef` has been renaemd to `RefResolver`
* `refResolver` prop of `RefResolver` has been renamed to `resolveRef`
* `RefResolver` type has been renamed to `RefResolverFunction`
@edgarmueller edgarmueller force-pushed the fix/ref-handling-refactoring branch from 6a62ef9 to 383040e Compare October 10, 2019 14:31
@sdirix
Copy link
Copy Markdown
Member

sdirix commented Dec 7, 2021

I'll close this PR as it's open for a long time. There is a copy of the contribution branch as part of the repository which could prove useful should we go into this direction at some point in the future.

@sdirix sdirix closed this Dec 7, 2021
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.

2 participants