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(es/types): Add missing types for jsc.transform.react.refresh #10206

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

leegeunhyeok
Copy link
Contributor

Description:

The jsc.transform.react.refresh option only accepts a boolean. However, the core implementation also supports an object (RefreshOptions)

image

This PR adds the missing types for RefreshOptions

// https://github.com/swc-project/swc/blob/c5f1cbe46762b9b9fa1cc27495675ae32e30c9ed/crates/swc_ecma_transforms_react/src/refresh/options.rs#L3-L13

#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
#[serde(rename_all = "camelCase")]
#[serde(deny_unknown_fields)]
pub struct RefreshOptions {
    #[serde(default = "default_refresh_reg")]
    pub refresh_reg: Atom,
    #[serde(default = "default_refresh_sig")]
    pub refresh_sig: Atom,
    #[serde(default = "default_emit_full_signatures")]
    pub emit_full_signatures: bool,
}

Preview

image
.swcrc image

SWC Playground: Link

BREAKING CHANGE:

Related issue (if exists):

@leegeunhyeok leegeunhyeok requested a review from a team as a code owner March 15, 2025 10:29
Copy link

changeset-bot bot commented Mar 15, 2025

⚠️ No Changeset found

Latest commit: c9711e4

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

CLAassistant commented Mar 15, 2025

CLA assistant check
All committers have signed the CLA.

@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.

Copy link

codspeed-hq bot commented Mar 15, 2025

CodSpeed Performance Report

Merging #10206 will degrade performances by 1.98%

Comparing leegeunhyeok:fix/react-refresh-config (c9711e4) with main (c5f1cbe)

Summary

❌ 1 regressions
✅ 151 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
es/lints/libs/d3 28.1 ms 28.7 ms -1.98%

@kdy1 kdy1 self-assigned this Mar 17, 2025
@kdy1 kdy1 added this to the Planned milestone Mar 17, 2025
@kdy1 kdy1 merged commit e71b000 into swc-project:main Mar 17, 2025
169 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.11.10 Mar 17, 2025
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.

None yet

3 participants