Skip to content

Commit b242804

Browse files
authored
Undo ajv8 alias and fix Vite dev server (#3371)
* 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) * Update lockfile * `preserveSymlinks` seems to fix rather than changing `mode` * Update CHANGELOG
1 parent 182d135 commit b242804

File tree

8 files changed

+18
-36
lines changed

8 files changed

+18
-36
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 `preserveSymlinks` to `true`, 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/vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default defineConfig({
1212
}, // maintain the old webpack behavior in dev
1313
plugins: [react()],
1414
resolve: {
15+
preserveSymlinks: true, // Fixes https://github.com/rjsf-team/react-jsonschema-form/issues/3228
1516
alias: {
1617
// The following is needed to allow the material ui v4 and v5 themes to properly load the css
1718
"@mui/styles": path.resolve("./node_modules", "@mui/styles"),

packages/validator-ajv8/package-lock.json

Lines changed: 1 addition & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)