Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Decorators][Docs] Clarify that modern decorator usage will increase TypeScript project bundle size #3931

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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