Skip to content

Commit

Permalink
Updated the playground to allow a validator selection
Browse files Browse the repository at this point in the history
- Defaults to the `ajv6` validator
- Updated `package*.json` to add `@rjsf/utils` and `@rjsf/validator-ajv6`
  - Also removed a bunch of unnecessary packages
  - Bumped a bunch of other packages to the latest minor and patch version
  - Bumped a few select packages to the latest major version
- Updated `.eslintrc` to switch from `babel-eslint` to `@babel/eslint-parser`
- Updated the `index.js` file to add a `validators` object containing the `AJV6` validator choice, passing it into `Playground`
- Updated the `app.js` file to get `shouldRender()` from `@rjsf/utils` instead of copying it from core
  - Also extracted `validators` from the props for `Playground`, storing `validator` in the state, initially set to `AJV6`
  - Added a `ValidatorSelector` component that is used to update the selected `validator` in state
  - Rendered a `ValidagtorSelector` just before the `CopyLink` component
  - Passed `validators[validator]` as the `validator` prop on `FormComponent`
  • Loading branch information
heath-freenome committed Jul 20, 2022
1 parent fe26c36 commit cf3f28a
Show file tree
Hide file tree
Showing 6 changed files with 35,053 additions and 38,901 deletions.
7 changes: 1 addition & 6 deletions packages/playground/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"rules": {
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
Expand All @@ -26,11 +26,6 @@
"node": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"modules": true,
"jsx": true,
"experimentalObjectRestSpread": true
},
"plugins": [
"jsx-a11y",
"react"
Expand Down
2 changes: 2 additions & 0 deletions packages/playground/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Use legacy peer deps to allow things to install with node 16
legacy-peer-deps=true
Loading

0 comments on commit cf3f28a

Please sign in to comment.