WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.56k stars 4.22k forks source link

Scripts: No support for decorators when using TypeScript #39435

Open andreslopezrm opened 2 years ago

andreslopezrm commented 2 years ago

Description

I use decorators for some libraries that I integrate in Typescript and that go along with the blocks and I get the following error that the default configuration does not support decorators

Support for the experimental syntax 'decorators-legacy' isn't currently enabled (4:1):

Step-by-step reproduction instructions

npm run start

Screenshots, screen recording, code snippet

No response

Environment info

@wordpress/scripts: ^22.2.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

kmonahan commented 2 years ago

Opened https://github.com/WordPress/gutenberg/pull/40660 to add support for decorators.

gziolo commented 2 years ago

See my comment in https://github.com/WordPress/gutenberg/pull/40660#issuecomment-1112868215. Decorators are at stage 3 in becoming the part of JavaScript language. Let's wait until the process is finished after promotion to stage 4.