Skip to content

Commit

Permalink
Update enabling-decorators.md
Browse files Browse the repository at this point in the history
Clarified that using modern decorators will increase the output bundle size for TypeScript projects.
  • Loading branch information
chadsowald authored Oct 2, 2024
1 parent ed9ab96 commit 6b08279
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/enabling-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ With modern decorators, it is no longer needed to call `makeObservable` / `makeA
2022.3 Decorators are supported in:

- TypeScript (5.0 and higher, make sure that the `experimentalDecorators` flag is NOT enabled). [Example commit](https://github.com/mweststrate/currencies-demo/commit/acb9ac8c148e8beef88042c847bb395131e85d60).
- Note: As modern decorators are not yet supported in major browsers ([implementation status](https://github.com/tc39/proposal-decorators/issues/476)), any TypeScript target other than ESNext will result in a bundle size increase from transpiling compared with legacy decorators. Consider the bundle size impact before moving to modern decorators.
- For Babel make sure the plugin [`proposal-decorators`](https://babeljs.io/docs/babel-plugin-proposal-decorators) is enabled with the highest version (currently `2023-05`). [Example commit](https://github.com/mweststrate/currencies-demo/commit/4999d2228208f3e1e10bc00a272046eaefde8585).

```js
Expand Down

0 comments on commit 6b08279

Please sign in to comment.