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

Fix 2022-03 decorators initialization order #9760

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jzhan-canva
Copy link
Contributor

Description:
Fix the order of initialization for 2022-03 decorators.
TBH the proposal isn't very clear on how init is executed for auto-accessor decorator

Related issue (if exists):
#9669

Copy link

changeset-bot bot commented Nov 26, 2024

⚠️ No Changeset found

Latest commit: 10a9b4e

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

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jzhan-canva
Copy link
Contributor Author

@kdy1 please take a look on this draft

@kdy1 kdy1 self-assigned this Nov 26, 2024
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Are you sure that this order change belongs to 2022-03 decorators?

I'm asking because the next version has initializer order reversed.

@jzhan-canva
Copy link
Contributor Author

the only thing I changed in this PR is to move _init_proto to before field initialization, I didn't change any logic of how _init_proto calls each initializer internally

I can double check the 2022-03 specification

Copy link

codspeed-hq bot commented Nov 26, 2024

CodSpeed Performance Report

Merging #9760 will improve performances by 3.51%

Comparing jzhan-canva:jzhan-2022deco-order (10a9b4e) with main (fa80a1e)

Summary

⚡ 1 improvements
✅ 193 untouched benchmarks

Benchmarks breakdown

Benchmark main jzhan-canva:jzhan-2022deco-order Change
es/full/base/fixer 121.2 µs 117 µs +3.51%

@jzhan-canva jzhan-canva marked this pull request as ready for review November 26, 2024 08:05
@jzhan-canva jzhan-canva requested a review from a team as a code owner November 26, 2024 08:05
@jzhan-canva jzhan-canva marked this pull request as draft November 26, 2024 08:07
@jzhan-canva jzhan-canva marked this pull request as ready for review November 26, 2024 12:19
@jzhan-canva
Copy link
Contributor Author

I misunderstood the unit test, now it's fixed

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Can you add some tests?

@jzhan-canva
Copy link
Contributor Author

Can you add some tests?
will do

another question @kdy1, does swc have corporate CLA that my employer can sign?

@kdy1
Copy link
Member

kdy1 commented Nov 27, 2024

No, but I don’t think signing is necessary for this changes. I’m not going to monetize SWC or change license forever. I just want to be free while moving source codes in GitHub. I moved plugin codes from vercel/next.js to swc-project/plugins, and some npm packages within swc org, but that’s all.

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.

3 participants