Skip to content

Commit 15ad520

Browse files
committed
Re-fix #3228 and related follow-up issues
- 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)
1 parent f2eccc4 commit 15ad520

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
1515
should change the heading of the (upcoming) version to include a major version bump.
1616
1717
-->
18+
# 5.0.0-beta-17
19+
20+
## @rjsf/playground
21+
- 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).
22+
23+
## @rjsf/validator-ajv8
24+
- Remove alias for ajv -> ajv8 in package.json. This fixes [#3215](https://github.com/rjsf-team/react-jsonschema-form/issues/3215).
25+
1826
# 5.0.0-beta-16
1927

2028
## @rjsf/antd

packages/playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
"rimraf": "^3.0.2",
115115
"sass": "^1.57.1",
116116
"source-map-loader": "^4.0.1",
117-
"vite": "^3.2.2"
117+
"vite": "^4.0.4"
118118
},
119119
"directories": {
120120
"test": "test"

packages/playground/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
open: process.env.NODE_ENV !== "production",
1212
}, // maintain the old webpack behavior in dev
1313
plugins: [react()],
14+
mode: "production", // Fixes https://github.com/rjsf-team/react-jsonschema-form/issues/3228
1415
resolve: {
1516
alias: {
1617
// The following is needed to allow the material ui v4 and v5 themes to properly load the css

packages/validator-ajv8/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"dependencies": {
3030
"ajv-formats": "^2.1.1",
31-
"ajv8": "npm:ajv@^8.11.0",
31+
"ajv": "^8.11.0",
3232
"lodash": "^4.17.15",
3333
"lodash-es": "^4.17.15"
3434
},

packages/validator-ajv8/src/createAjvInstance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Ajv, { Options } from "ajv8";
1+
import Ajv, { Options } from "ajv";
22
import addFormats, { FormatsPluginOptions } from "ajv-formats";
33
import isObject from "lodash/isObject";
44

packages/validator-ajv8/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Ajv, { Options, ErrorObject } from "ajv8";
1+
import Ajv, { Options, ErrorObject } from "ajv";
22
import { FormatsPluginOptions } from "ajv-formats";
33

44
/** The type describing how to customize the AJV6 validator

packages/validator-ajv8/src/validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Ajv, { ErrorObject, ValidateFunction } from "ajv8";
1+
import Ajv, { ErrorObject, ValidateFunction } from "ajv";
22
import toPath from "lodash/toPath";
33
import isObject from "lodash/isObject";
44
import clone from "lodash/clone";

packages/validator-ajv8/test/createAjvInstance.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import Ajv from "ajv8";
2-
import Ajv2019 from "ajv8/dist/2019";
1+
import Ajv from "ajv";
2+
import Ajv2019 from "ajv/dist/2019";
33
import addFormats from "ajv-formats";
44

55
import createAjvInstance, {
@@ -9,8 +9,8 @@ import createAjvInstance, {
99
} from "../src/createAjvInstance";
1010
import { CustomValidatorOptionsType } from "../src";
1111

12-
jest.mock("ajv8");
13-
jest.mock("ajv8/dist/2019");
12+
jest.mock("ajv");
13+
jest.mock("ajv/dist/2019");
1414
jest.mock("ajv-formats");
1515

1616
export const CUSTOM_OPTIONS: CustomValidatorOptionsType = {

0 commit comments

Comments
 (0)