Skip to content

feat: support suppress BROKEN warnings during compilation#2157

Merged
gaoachao merged 1 commit intomainfrom
feat/support-suppress-broken-warnings
Jan 30, 2026
Merged

feat: support suppress BROKEN warnings during compilation#2157
gaoachao merged 1 commit intomainfrom
feat/support-suppress-broken-warnings

Conversation

@gaoachao
Copy link
Collaborator

@gaoachao gaoachao commented Jan 29, 2026

Summary by CodeRabbit

  • New Features

    • Added disableDeprecatedWarning option to suppress deprecation warnings during compilation.
  • Documentation

    • Added ReactLynx 3.0 migration guidance: replace deprecated getNodeRef, getNodeRefFromRoot, createSelectorQuery, and getElementById methods with ref or lynx.* equivalents.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@cla-assistant
Copy link

cla-assistant bot commented Jan 29, 2026

CLA assistant check
All committers have signed the CLA.

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: ea6e68b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Introduces a disableDeprecatedWarning configuration option to suppress BROKEN warnings during compilation. Refactors deprecation warning emission logic into a centralized helper method and adds test coverage validating the suppression behavior.

Changes

Cohort / File(s) Summary
Feature Documentation
.changeset/friendly-cats-dance.md
Added changeset documenting disableDeprecatedWarning option for suppressing BROKEN warnings and ReactLynx 3.0 migration notes for getNodeRef and getElementById deprecations.
Test Coverage
packages/react/transform/__test__/fixture.spec.js
Added test case verifying that deprecation warnings are successfully suppressed when disableDeprecatedWarning flag is enabled for createSelectorQuery and getElementById.
Deprecation Warning Refactor
packages/react/transform/crates/swc_plugin_compat/lib.rs
Introduced emit_deprecation_warning helper method to centralize deprecation warning logic across multiple code paths, ensuring warnings respect the disable_deprecated_warning flag.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

framework:React

Suggested reviewers

  • colinaaa
  • upupming
  • Yradex

Poem

🐰 A hush falls over the warnings once loud,
Deprecated paths no longer allowed—
With one quiet helper, the noise fades away,
ReactLynx compiles in peace every day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature: adding support to suppress BROKEN warnings during compilation. It directly corresponds to the core changes across all modified files.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gaoachao gaoachao force-pushed the feat/support-suppress-broken-warnings branch from 4813e06 to ea6e68b Compare January 29, 2026 12:56
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.changeset/friendly-cats-dance.md:
- Around line 5-8: Update the changeset text to state that the
disableDeprecatedWarning option suppresses all deprecation warnings (including
both BROKEN and DEPRECATED), not just BROKEN; mention the affected APIs such as
getNodeRef/getNodeRefFromRoot/createSelectorQuery and getElementById and clarify
users should migrate to refs or lynx.createSelectorQuery/lynx.getElementById as
appropriate so the wording matches the actual implementation that gates both
BROKEN and DEPRECATED warnings.

In `@packages/react/transform/crates/swc_plugin_compat/lib.rs`:
- Around line 413-417: The helper emit_deprecation_warning currently respects
opts.disable_deprecated_warning but many other warning sites call HANDLER
directly and bypass that flag; update those call sites (e.g., the item-key props
warning, class config warnings, and the JSXSpread/addComponentElement warning)
to call self.emit_deprecation_warning(span, message) instead of HANDLER.with(|h|
h... ) so they honor disable_deprecated_warning (refer to the
emit_deprecation_warning function, the disable_deprecated_warning option, and
HANDLER to find and replace direct handler calls), or if you intend the flag to
only cover the current subset, rename disable_deprecated_warning to indicate
partial coverage and document which warnings are controlled.

@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 76.31579% with 9 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...es/react/transform/crates/swc_plugin_compat/lib.rs 76.31% 9 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 29, 2026

Merging this PR will improve performance by 5.96%

⚡ 2 improved benchmarks
✅ 61 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-nest-level-100 7.5 ms 7.1 ms +5.85%
transform 1000 view elements 46.3 ms 43.7 ms +5.96%

Comparing feat/support-suppress-broken-warnings (ea6e68b) with main (d1b0d9e)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link

relativeci bot commented Jan 29, 2026

Web Explorer

#7431 Bundle Size — 383.56KiB (0%).

ea6e68b(current) vs d1b0d9e main#7429(baseline)

Bundle metrics  Change 1 change
                 Current
#7431
     Baseline
#7429
No change  Initial JS 154.71KiB 154.71KiB
No change  Initial CSS 35.05KiB 35.05KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 238(+0.42%) 237
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.99% 2.99%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7431
     Baseline
#7429
No change  JS 252.66KiB 252.66KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.05KiB 35.05KiB

Bundle analysis reportBranch feat/support-suppress-broken-war...Project dashboard


Generated by RelativeCIDocumentationReport issue

@gaoachao gaoachao merged commit 3fe8949 into main Jan 30, 2026
46 of 47 checks passed
@gaoachao gaoachao deleted the feat/support-suppress-broken-warnings branch January 30, 2026 09:51
colinaaa pushed a commit that referenced this pull request Feb 1, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @lynx-js/motion@0.0.2

### Patch Changes

- Add initial support for `@lynx-js/motion`
([#1062](#1062))

## @lynx-js/react@0.116.2

### Patch Changes

- Fix "TypeError: not a function" error caused by `replaceAll` not
supported in ES5.
([#2142](#2142))

- Bump `swc_core` v56.
([#2154](#2154))

- Use `disableDeprecatedWarning` option to suppress BROKEN warnings
during compilation.
([#2157](#2157))

1. BROKEN: `getNodeRef`/`getNodeRefFromRoot`/`createSelectorQuery` on
component instance is broken and MUST be migrated in ReactLynx 3.0,
please use ref or lynx.createSelectorQuery instead.
2. BROKEN: `getElementById` on component instance is broken and MUST be
migrated in ReactLynx 3.0, please use ref or lynx.getElementById
instead.

- Fix memory leak by clearing list callbacks when \_\_DestroyLifetime
event is triggered.
([#2112](#2112))

## @lynx-js/rspeedy@0.13.3

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.7

## @lynx-js/qrcode-rsbuild-plugin@0.4.4

### Patch Changes

- Bump `@clack/prompts` v1.0
([#2171](#2171))

## @lynx-js/react-rsbuild-plugin@0.12.7

### Patch Changes

- Updated dependencies
\[[`92881e7`](92881e7),
[`1a5f2a1`](1a5f2a1)]:
    -   @lynx-js/template-webpack-plugin@0.10.3
    -   @lynx-js/css-extract-webpack-plugin@0.7.0
    -   @lynx-js/react-webpack-plugin@0.7.3
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.7
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.4

## @lynx-js/web-constants@0.19.7

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.19.7

## @lynx-js/web-core@0.19.7

### Patch Changes

- feat: add browser config of lynx-view, now you can customize the
browser config of lynx-view:
([#2140](#2140))

        lynxView.browserConfig = {
          pixelRatio: 1,
          pixelWidth: 1234,
          pixelHeight: 5678,
        }

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.7
    -   @lynx-js/web-mainthread-apis@0.19.7
    -   @lynx-js/web-worker-rpc@0.19.7
    -   @lynx-js/web-worker-runtime@0.19.7

## @lynx-js/web-core-wasm@0.0.2

### Patch Changes

- Updated dependencies
\[[`43fc7e7`](43fc7e7)]:
    -   @lynx-js/web-elements@0.11.1
    -   @lynx-js/web-worker-rpc@0.19.7

## @lynx-js/web-elements@0.11.1

### Patch Changes

- feat: add wheel event handling and corresponding tests for
x-foldview-ng
([#2145](#2145))

## @lynx-js/web-mainthread-apis@0.19.7

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.7

## @lynx-js/web-worker-runtime@0.19.7

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.7
    -   @lynx-js/web-mainthread-apis@0.19.7
    -   @lynx-js/web-worker-rpc@0.19.7

## @lynx-js/template-webpack-plugin@0.10.3

### Patch Changes

- Fix "Failed to load CSS update file" for lazy bundle
([#2150](#2150))

- Fix "TypeError: cannot read property 'call' of undefined" error of
lazy bundle HMR.
([#2146](#2146))

## create-rspeedy@0.13.3



## @lynx-js/react-alias-rsbuild-plugin@0.12.7



## upgrade-rspeedy@0.13.3



## @lynx-js/web-core-server@0.19.7



## @lynx-js/web-rsbuild-server-middleware@0.19.7



## @lynx-js/web-worker-rpc@0.19.7

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants