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

Enable decorators, which are supported by SWC and stage3, just like import_attributes #5252

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NullVoxPopuli
Copy link

@NullVoxPopuli NullVoxPopuli commented Nov 16, 2023

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

Copy link

vercel bot commented Nov 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 16, 2023 3:31pm

@NullVoxPopuli NullVoxPopuli changed the title WIP: Enable decorators, which are stage3, just like import_attributes WIP: Enable decorators, which are supported by SWC and stage3, just like import_attributes Nov 16, 2023
@NullVoxPopuli NullVoxPopuli changed the title WIP: Enable decorators, which are supported by SWC and stage3, just like import_attributes Enable decorators, which are supported by SWC and stage3, just like import_attributes Nov 16, 2023
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review November 16, 2023 21:16
Copy link

codecov bot commented Nov 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (01d8c9d) 98.89% compared to head (67070b1) 98.89%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5252   +/-   ##
=======================================
  Coverage   98.89%   98.89%           
=======================================
  Files         232      232           
  Lines        8936     8936           
  Branches     2333     2333           
=======================================
  Hits         8837     8837           
  Misses         40       40           
  Partials       59       59           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lukastaegert
Copy link
Member

lukastaegert commented Nov 17, 2023

Note that to enable decorators, a lot of additional work will be needed:

  • You need to extend the converters in convert_ast.rs to add the new Decorator node and extend the existing nodes compatible with https://github.com/estree/estree/blob/master/stage3/decorators.md
  • Similarly, you need to extend the decoder in convert-ast.ts to handle the new Decorator node and any additional properties to ensure we produce an ESTree-Compatible AST.
  • You also need to extend the AST nodes in /src/ast/ with the new Node/properties.
  • We need extensive tests for all situations where we can have decorators. It would be especially important to test for tree-shaking (via form tests) or on the other hand if side effects in decorators are respected (via function tests)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants