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(es/decorators): Implement decorator version 2023-11 #8970

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented May 23, 2024

@kdy1 kdy1 added this to the Planned milestone May 23, 2024
@kdy1 kdy1 self-assigned this May 23, 2024
Copy link

changeset-bot bot commented May 23, 2024

⚠️ No Changeset found

Latest commit: 2f5f49a

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.

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

@kdy1 kdy1 changed the title feat(es/decorators): Implement latest stage 3 decorators feat(es/decorators): Implement decorator version 2023-11 May 23, 2024
pub use self::{
decorators::decorators, export_default_from::export_default_from,
import_assertions::import_assertions,
};

#[derive(Debug, Default, Clone, Copy, Serialize, Deserialize)]
#[serde(deny_unknown_fields, rename_all = "camelCase")]
pub enum DecoratorVersion {
Copy link
Member

Choose a reason for hiding this comment

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

Babel 8 keeps only the newest and the oldest versions; I think we should also keep just two versions.

Keeping the latest version is sensible, but another that leverages TypeScript's legacy decorators (experimentalDecorators) is preferable.

It is necessary to specify the exact version. SWC references the TypeScript version with the date 2021-12, whereas Babel uses 2018-09.

The TypeScript documentation states that it adopts a Stage 2 version, but it doesn't specify the exact year and month of the draft.

Copy link
Member Author

Choose a reason for hiding this comment

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

But some users will complain that removal of implementations is a breaking change, and I'm not sure if it's fine to remove an option.

Choose a reason for hiding this comment

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

Please only remove an option in a major version 😂

kdy1 added a commit that referenced this pull request Jul 5, 2024
**Description:**

I extracted some changes from #8970
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Various transform bugs with the JavaScript decorators proposal
3 participants