Skip to content

Commit

Permalink
Re-fix rjsf-team#3228 and related follow-up issues
Browse files Browse the repository at this point in the history
- Upgrade vite to 4.0.4
- Remove ajv8 alias for validator-ajv8 (will fix issues in skypack)
- Change vite mode to production (fixes issue where vite/esbuild mix up ajv v6 and v8)
  • Loading branch information
nickgros committed Jan 13, 2023
1 parent f2eccc4 commit 15ad520
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,14 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.
-->
# 5.0.0-beta-17

## @rjsf/playground
- Change Vite `mode` to `'production'`, which provides an alternative fix for [#3228](https://github.com/rjsf-team/react-jsonschema-form/issues/3228) since the prior fix caused [#3215](https://github.com/rjsf-team/react-jsonschema-form/issues/3215).

## @rjsf/validator-ajv8
- Remove alias for ajv -> ajv8 in package.json. This fixes [#3215](https://github.com/rjsf-team/react-jsonschema-form/issues/3215).

# 5.0.0-beta-16

## @rjsf/antd
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/package.json
Expand Up @@ -114,7 +114,7 @@
"rimraf": "^3.0.2",
"sass": "^1.57.1",
"source-map-loader": "^4.0.1",
"vite": "^3.2.2"
"vite": "^4.0.4"
},
"directories": {
"test": "test"
Expand Down
1 change: 1 addition & 0 deletions packages/playground/vite.config.ts
Expand Up @@ -11,6 +11,7 @@ export default defineConfig({
open: process.env.NODE_ENV !== "production",
}, // maintain the old webpack behavior in dev
plugins: [react()],
mode: "production", // Fixes https://github.com/rjsf-team/react-jsonschema-form/issues/3228
resolve: {
alias: {
// The following is needed to allow the material ui v4 and v5 themes to properly load the css
Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/package.json
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"ajv-formats": "^2.1.1",
"ajv8": "npm:ajv@^8.11.0",
"ajv": "^8.11.0",
"lodash": "^4.17.15",
"lodash-es": "^4.17.15"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/createAjvInstance.ts
@@ -1,4 +1,4 @@
import Ajv, { Options } from "ajv8";
import Ajv, { Options } from "ajv";
import addFormats, { FormatsPluginOptions } from "ajv-formats";
import isObject from "lodash/isObject";

Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/types.ts
@@ -1,4 +1,4 @@
import Ajv, { Options, ErrorObject } from "ajv8";
import Ajv, { Options, ErrorObject } from "ajv";
import { FormatsPluginOptions } from "ajv-formats";

/** The type describing how to customize the AJV6 validator
Expand Down
2 changes: 1 addition & 1 deletion packages/validator-ajv8/src/validator.ts
@@ -1,4 +1,4 @@
import Ajv, { ErrorObject, ValidateFunction } from "ajv8";
import Ajv, { ErrorObject, ValidateFunction } from "ajv";
import toPath from "lodash/toPath";
import isObject from "lodash/isObject";
import clone from "lodash/clone";
Expand Down
8 changes: 4 additions & 4 deletions packages/validator-ajv8/test/createAjvInstance.test.ts
@@ -1,5 +1,5 @@
import Ajv from "ajv8";
import Ajv2019 from "ajv8/dist/2019";
import Ajv from "ajv";
import Ajv2019 from "ajv/dist/2019";
import addFormats from "ajv-formats";

import createAjvInstance, {
Expand All @@ -9,8 +9,8 @@ import createAjvInstance, {
} from "../src/createAjvInstance";
import { CustomValidatorOptionsType } from "../src";

jest.mock("ajv8");
jest.mock("ajv8/dist/2019");
jest.mock("ajv");
jest.mock("ajv/dist/2019");
jest.mock("ajv-formats");

export const CUSTOM_OPTIONS: CustomValidatorOptionsType = {
Expand Down

0 comments on commit 15ad520

Please sign in to comment.