web-infra-dev / modern.js

Modern.js is a web engineering system, including a web framework and a npm package solution.
https://modernjs.dev/en/
MIT License
4.26k stars 351 forks source link

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

Closed yf-yang closed 2 weeks ago

yf-yang commented 2 weeks ago

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

changeset-bot[bot] commented 2 weeks ago

⚠️ No Changeset found

Latest commit: 20f9df023aebc1b315f8a849f66d6522248269be

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

yf-yang commented 2 weeks ago

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.