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

feat: enable stage3 decorator for swc based on typescript version #5849

Closed
wants to merge 1 commit into from

Conversation

yf-yang
Copy link

@yf-yang yf-yang commented Jun 19, 2024

Summary

This is a draft PR as the API is not designed. I'd like to discuss with the maintenance team if this implementation is fine.

Currently, I can hack it by enabling transformLodash to enable swc compiler.

Related Links

Fixes #5834

Checklist

  • I have added changeset via pnpm run change.
  • I have updated the documentation.
  • I have added tests to cover my changes.

Copy link

changeset-bot bot commented Jun 19, 2024

⚠️ No Changeset found

Latest commit: 20f9df0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +105 to +108
decoratorVersion:
!emitDecoratorMetadata && tsVersion >= 5
? '2022-03'
: undefined,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a breaking change for projects using ts^5 and emitDecoratorMetadata not enabled?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this option takes effect only when decorator grammar is used?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 I'm fine with either. If you are willing to add another trigger option I'd like to help implement it. If you can bump to latest esbuild that'd be great 😀

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer bumping esbuild as we should catch up the latest version and the feature is resolved by the way. We're now using 0.19.2 version of esbuild which is release 10 months ago. It's better to bump it, @chenjiahan is there any issue blocks bumping esbuild that I don't know?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talked with @chenjiahan, there's no blocking point stopping us from bumping esbuild. We'd inclined to bump esbuild to address this issue.
I'm closing this PR in favor of bumping esbuild. Let me know if you're interested in implement this. Thanks for the PR anyway.

@yf-yang
Copy link
Author

yf-yang commented Jun 19, 2024

What's your opinion on the configuration option?
Option 1: An option to enable SWC.
Option 2: An option to enable decorator. Then implicitly enable SWC and checks ts version to apply the correct SWC config.

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.

[Feature]: build stage 3 decorator with swc in modern.js module
2 participants