Skip to content

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Jul 11, 2025

Input:

class DeclareFields {
  @dec declare name: string;
  @dec declare output: number;
}

Before output:

class DeclareFields {}

After output:

class DeclareFields {}

babelHelpers.decorate([dec], DeclareFields.prototype, "name", void 0);
babelHelpers.decorate([dec], DeclareFields.prototype, "output", void 0);

The declare fields with decorators should be transformed, but they would be removed in the typescript plugin before legacy decorators transform them, so this PR is to adjust the transform order and allow declare fields can be transformed

@Dunqing Dunqing requested a review from overlookmotel as a code owner July 11, 2025 03:21
@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-bug Category - Bug labels Jul 11, 2025
Copy link
Member Author

Dunqing commented Jul 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 11, 2025

CodSpeed Instrumentation Performance Report

Merging #12212 will not alter performance

Comparing 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed (ef69c5c) with main (6e54645)

Summary

✅ 34 untouched benchmarks

@Dunqing Dunqing force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from d6300d7 to 0d17c57 Compare July 11, 2025 03:31
@Dunqing Dunqing added the P-high Priority - High label Jul 11, 2025
@Dunqing Dunqing force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from 0d17c57 to 470a724 Compare July 11, 2025 04:53
@Dunqing Dunqing changed the base branch from main to graphite-base/12212 July 11, 2025 07:11
@Dunqing Dunqing force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from 470a724 to 1e4dd7c Compare July 11, 2025 07:11
@Dunqing Dunqing changed the base branch from graphite-base/12212 to 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena July 11, 2025 07:11
@Dunqing Dunqing force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch 2 times, most recently from 385516d to 1974408 Compare July 11, 2025 07:40
@Dunqing Dunqing force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch from 20854b0 to 7dc1a91 Compare July 11, 2025 07:40
Copy link
Member

@overlookmotel overlookmotel left a comment

Choose a reason for hiding this comment

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

I don't understand this transform, so have not reviewed. Please feel free to merge if you're happy with it.

@graphite-app graphite-app bot force-pushed the 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena branch 2 times, most recently from caa2e11 to 2690913 Compare July 11, 2025 09:56
@graphite-app graphite-app bot force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from 1974408 to 22b37b3 Compare July 11, 2025 09:56
@graphite-app graphite-app bot changed the base branch from 07-10-refactor_transformer_styled-components_do_not_allocate_temp_data_into_arena to graphite-base/12212 July 11, 2025 10:09
@graphite-app graphite-app bot force-pushed the graphite-base/12212 branch from 2690913 to 5ad62cd Compare July 11, 2025 10:17
@graphite-app graphite-app bot force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from 22b37b3 to 3510778 Compare July 11, 2025 10:17
@graphite-app graphite-app bot changed the base branch from graphite-base/12212 to main July 11, 2025 10:18
@graphite-app graphite-app bot force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from 3510778 to c76e3f0 Compare July 11, 2025 10:18
@Dunqing Dunqing requested a review from Boshen July 11, 2025 13:52
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
Copy link
Member

Boshen commented Jul 11, 2025

Merge activity

  • Jul 11, 2:35 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 11, 2:35 PM UTC: Boshen added this pull request to the Graphite merge queue.
  • Jul 11, 2:44 PM UTC: The Graphite merge queue couldn't merge this PR because it had merge conflicts.

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jul 11, 2025
@Boshen Boshen force-pushed the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch from c76e3f0 to ef69c5c Compare July 11, 2025 15:33
@Boshen Boshen merged commit 23c5951 into main Jul 12, 2025
25 checks passed
@Boshen Boshen deleted the 07-11-fix_transformer_legacy-decorator_decorated_fields_with_the_declare_modifier_are_not_transformed branch July 12, 2025 01:52
graphite-app bot pushed a commit that referenced this pull request Jul 21, 2025
…2417)

* close rolldown/rolldown#5326

Regression introduced by #12212. The transform execution shift causes the bug because the `class-properties` plugin always assumes that all fields accessed can be transformed. However, the prior change breaks the assumption.

This PR reverts some changes to remove the ts-only field early, which respects that `class-properties` assumption
graphite-app bot pushed a commit that referenced this pull request Jul 21, 2025
…2417)

* close rolldown/rolldown#5326

Regression introduced by #12212. The transform execution shift causes the bug because the `class-properties` plugin always assumes that all fields accessed can be transformed. However, the prior change breaks the assumption.

This PR reverts some changes to remove the ts-only field early, which respects that `class-properties` assumption
graphite-app bot pushed a commit that referenced this pull request Jul 21, 2025
…2417)

* close rolldown/rolldown#5326

Regression introduced by #12212. The transform execution shift causes the bug because the `class-properties` plugin always assumes that all fields accessed can be transformed. However, the prior change breaks the assumption.

This PR reverts some changes to remove the ts-only field early, which respects that `class-properties` assumption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-bug Category - Bug P-high Priority - High

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants