Skip to content

Decorators: implement both optional parens and normal expressions. #7773

@nicolo-ribaudo

Description

@nicolo-ribaudo

The main thing preventing me from finishing the work on decorators is that it is not clear yet wether they will have optional parentheses or not.

Currently the proposal specifies @deco and @deco() to have the same meaning, but there is strong opposition from different people (tc39/proposal-decorators#81).

I propose adding an option to the new implementation of @babel/plugin-proposal-decorators (e.g. optionalParens, or automaticParens) which toggles this behavior. This would have two advantages: it would allow us to ship decorators in Babel 7 and it would make it easier to collect feedback about which of the two behaviors is better.

cc @littledan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Spec: Decoratorsi: discussionoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions