diff --git a/.changeset/tiny-boxes-play.md b/.changeset/tiny-boxes-play.md new file mode 100644 index 000000000..d0bd3fd00 --- /dev/null +++ b/.changeset/tiny-boxes-play.md @@ -0,0 +1,9 @@ +--- +"mobx": patch +"eslint-plugin-mobx": patch +"mobx-react": patch +"mobx-react-lite": patch +"mobx-undecorate": patch +--- + +Disable `useDefineForClassFields` in `tsconfig.json` to reduce memory footprint and improve performance of class instances with undefined and unused members. diff --git a/tsconfig.json b/tsconfig.json index 4be5dff7e..b9fb5f3b3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ "noImplicitThis": false, "noEmit": true, "experimentalDecorators": true, - "useDefineForClassFields": true, + // See: https://github.com/mobxjs/mobx/pull/3884 + "useDefineForClassFields": false, "jsx": "react", "esModuleInterop": true }, diff --git a/tsconfig.test.json b/tsconfig.test.json index f8e4f8c91..0bfdfaf81 100644 --- a/tsconfig.test.json +++ b/tsconfig.test.json @@ -3,6 +3,8 @@ "compilerOptions": { // "module": "commonjs", "allowJs": true, - "noUnusedLocals": false + "noUnusedLocals": false, + // See: https://github.com/mobxjs/mobx/pull/3884 + "useDefineForClassFields": true } }