hermes icon indicating copy to clipboard operation
hermes copied to clipboard

babel-plugin-syntax-hermes-parser fails to parse decorators

Open neutraali opened this issue 1 year ago • 1 comments

I've spent most of the day trying to find info on this issue, but Google is giving me nothing. We're using [email protected] and Flow version 0.238.2 and running into errors while trying to parse decorators. For example:

@exampleDecorator
class Example extends React.Component { ... }

Results in:

Parsing error: unrecognized character '@'
@exampleDecorator

We're using Webpack + babel-loader with the following plugins to try and make things happen:

@babel/[email protected]
[email protected]
[email protected]

Is it true that hermes-parser can't deal with decorators or are we missing some obscure config somewhere?

neutraali avatar Aug 15 '24 15:08 neutraali

We do plan to add support for parsing decorators, but we haven't done so yet given that they aren't standardized yet. https://github.com/tc39/proposal-decorators is at stage 3, so we'll likely be able to implement this feature soon.

avp avatar Aug 16 '24 23:08 avp