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

Refactor Core JSON-Schema specific logic into modular packages #100

Open
elbakerino opened this issue Mar 25, 2021 · 0 comments
Open

Refactor Core JSON-Schema specific logic into modular packages #100

elbakerino opened this issue Mar 25, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request json-schema-spec Relates to official JSON-Schema Spec. refactoring validators
Projects
Milestone

Comments

@elbakerino
Copy link
Member

elbakerino commented Mar 25, 2021

Refactor validators and schema handlers core into new modular packages, primary for validators. To support further implementations, this will also split react-core from json-schema specific react logic.

This will lead to an general overhaul of naming & structure - but logic will stay identical for widget rendering & concepts (especially how the React part works)

  • to use as isometric validators in backend and frontend
  • to use e.g. conditional handler not only by react
  • supporting "multi strategies" (already basic support)
    • full for backend, no-render endless nested validation
    • level for e.g. react frontends, to only validate one-schema level
      • but with full support for if/else validation through full
  • support for multiple type schemas (already full support)
  • support for version changing
  • new plugin factory pattern to overwrite any validators, build validateSchema automatically
  • passing down full schema to all validators

Part of: validators, pluginSimpleStack schemaPlugins and ValidatorStack, PluginStack WidgetEngine/WidgetPlugin/SchemaPlugin to support version changing, full support for non-render related validations (e.g. validation with a react hook).

Ideas

Currently intended changes.

Removement of deprecated logic #192

Package Structure

  • @ui-schema/system for general interfacing & typings, JSON-Schema plugins, validators
  • @ui-schema/json-pointer JSON-Schema pointer
  • @ui-schema/react for store, provider, pluginstack (exec. part), translate, JSON-Schema react renderers, react plugins
  • @ui-schema/immutable for all immutable tools (or extract/include as other micropackage?) [would be the first "core depencies" then]
  • @ui-schema/ui-schema will be removed most likely

Naming Structure

  • everything regarding PluginStack to something like WidgetEngine
  • better distinctive namings in plugin architecture - PluginStack / PluginSimpleStack / PluginType / PluginSimple...
    • PluginStack > WidgetEngine and WidgetPlugin
    • PluginSimpleStack > SchemaPluginStack and SchemaPlugin
  • UI* prefixes optimize, only for the most important domains: Meta, Store*
  • restructure / rename storeUpdater and storeActionHandler factory parts
  • system WidgetPayload, where WidgetProps is the react-specific implementation
  • ....

JSON-Lib

  • new architecture for "full" & "level" schema validation support, to support backend APIs & frontend UI generators
  • option to specify validate callback / interfacing
  • a new "parse schema" part, which could consume the specified validate
  • options to specify callbacks for parts like isRootSchema / mergeSchema (buildHappyPath)
  • (maybe) enable "build happy path" or "pre-build" which will give a full Schema, reduced like the renderer would consume it

Tactic-UI

  • widgetsBinding subkeys types/custom will be merged into one
  • widgetsBinding custom components (e.g. GroupRenderer will move to a new definition map
  • UIMeta* will be just an adjusted tactic-ui context binding

Updates

2022-11

As WidgetEngine/PluginStack and the general widgetsBinding are too coupled to be able to cleanly rewrite it, a new package was created which will replace those internals in 0.5.0: @tactic-ui/react.

This will replace and ease a lot of open typing issues, e.g. plugins requirements are automatically collected when adding plugins.

UIS will rewire tactic-ui to provide a similiar setup like currently, as tactic-ui itself doens't bring any UI or data-specific logic.

2023-09-29

Dropped extra json-schema packages, was planned to also split up, now only separated by "react vs. universal js".

@elbakerino elbakerino added enhancement New feature or request json-schema-spec Relates to official JSON-Schema Spec. refactoring labels Mar 25, 2021
@elbakerino elbakerino added this to To do in ui-schema via automation Mar 25, 2021
@elbakerino elbakerino changed the title Refactor validators into own package Refactor schema handling fns into own package Mar 27, 2021
@elbakerino elbakerino added this to the v0.4.0 milestone Jun 28, 2021
@elbakerino elbakerino modified the milestones: v0.4.0, v0.5.0 May 2, 2022
elbakerino added a commit that referenced this issue May 4, 2022
- deprecated `UIProvider`, `UIGenerator`, `UIRootRenderer`/`widgets.RootRenderer`, the `ownKey` prop
- new `injectPluginStack` util as `UIRootRenderer` replacement
- new `GridContainer` in `ds-material` + `ds-bootstrap`  for `injectPluginStack`
- now `applyPluginStack` applies `memo` internally
- fix from `0.4.0-alpha.0`: `Divider` between `GenericListItem` had missing gutters
- `material-code` hard-copy react-codemirror2 for React v17
@elbakerino elbakerino pinned this issue May 5, 2022
elbakerino added a commit that referenced this issue May 5, 2022
- mui NumberSlider label had an now invalid color value, also for multiple-numbers sliders, the thumb was incompatible
- 0.4.0-alpha typing optimizes
@elbakerino elbakerino self-assigned this Jul 7, 2022
elbakerino added a commit that referenced this issue Jul 13, 2022
and a few related renamings to make it more clearer
@elbakerino elbakerino changed the title Refactor schema handling fns into own package Refactor Core JSON-Schema specific logic into modular packages Jul 13, 2022
elbakerino added a commit that referenced this issue Jul 14, 2022
most likely requires now adjustments for JSDom/React testing
elbakerino added a commit that referenced this issue Sep 5, 2022
elbakerino added a commit that referenced this issue Sep 5, 2022
tests still not running for all files (esm, node, react) with new ts-jest setup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request json-schema-spec Relates to official JSON-Schema Spec. refactoring validators
Projects
ui-schema
  
To do
Development

No branches or pull requests

1 participant