-
Notifications
You must be signed in to change notification settings - Fork 111
fix(react/runtime): remove listener before destroy #1379
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(react/runtime): remove listener before destroy #1379
Conversation
🦋 Changeset detectedLatest commit: 7faf71f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
📝 WalkthroughWalkthroughThis change addresses event listener cleanup in the "@lynx-js/react" package to prevent crashes during component destruction. It introduces a new test suite, updates existing tests for proper event listener removal, adjusts test utility logic for selective test skipping, and reorders cleanup operations in the destroy lifecycle function. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings.changeset/bright-rings-read.md (4)Learnt from: colinaaa Learnt from: colinaaa Learnt from: PupilTong Learnt from: PupilTong packages/react/runtime/__test__/utils/setup.js (1)Learnt from: colinaaa packages/react/runtime/__test__/lifecycle/destroy.test.jsx (3)Learnt from: colinaaa Learnt from: PupilTong Learnt from: PupilTong 🧬 Code Graph Analysis (1)packages/react/runtime/src/lynx/tt.ts (1)
🔇 Additional comments (6)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
CodSpeed Performance ReportMerging #1379 will not alter performanceComparing Summary
|
React Example#3476 Bundle Size — 235.18KiB (+0.02%).7faf71f(current) vs a8c8e39 main#3462(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch colinaaa:colin/0730/remove-event... Project dashboard Generated by RelativeCI Documentation Report issue |
Web Explorer#3466 Bundle Size — 352.53KiB (0%).7faf71f(current) vs a8c8e39 main#3452(baseline) Bundle metrics
Bundle size by type
|
| Current #3466 |
Baseline #3452 |
|
|---|---|---|
226.4KiB |
226.4KiB |
|
94.29KiB |
94.29KiB |
|
31.83KiB |
31.83KiB |
Bundle analysis report Branch colinaaa:colin/0730/remove-event... Project dashboard
Generated by RelativeCI Documentation Report issue
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/[email protected] ### Minor Changes - Add support for Lynx UI plugin system with configurable options. ([#1363](#1363)) - Introduced `lynxUIPlugins` option in `createLynxPreset`, allowing userland opt-in to Lynx UI specific plugins. - Implemented `uiVariants` plugin as the first UI plugin, supporting `ui-*` variant prefixes (e.g. `ui-checked`, `ui-open`) with customizable mappings. ## @lynx-js/[email protected] ### Patch Changes - Fix crash caused by not removing event listeners during destroy. ([#1379](#1379)) - Fix missing "type" in "update-list-info" in hydrate ([#1392](#1392)) ## @lynx-js/[email protected] ### Patch Changes - Bump Rsbuild v1.4.12 with Rspack v1.4.11. ([#1326](#1326)) ## @lynx-js/[email protected] ### Patch Changes - Updated dependencies \[[`e9edca0`](e9edca0), [`6f37db2`](6f37db2)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - feat: support `__ElementFromBinary` ([#1391](#1391)) - Updated dependencies \[]: - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - feat: support `__ElementFromBinary` ([#1391](#1391)) - fix: crash on chrome<96 ([#1361](#1361)) <wasm-bindgen/wasm-bindgen#4211 (comment)> <WebAssembly/binaryen#7358> The rust toolchain enables WASM feature `reference types` by default. However this feature is not supported by chromium lower than version 96 Therefore we found a workaround for it. In this implementation we detect if browser supports `reference types` first. If user's browser supported it, we load the wasm file with `reference types` on, otherwise we load the wasm file with `reference types` off. - Updated dependencies \[[`22ca433`](22ca433), [`8645d12`](8645d12), [`143e481`](143e481)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - refactor: bundle web-core-server ([#819](#819)) ## @lynx-js/[email protected] ### Patch Changes - feat: support color style for x-textarea ([#1382](#1382)) - Updated dependencies \[]: - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - feat: support `__ElementFromBinary` ([#1391](#1391)) - fix: crash on chrome<96 ([#1361](#1361)) <wasm-bindgen/wasm-bindgen#4211 (comment)> <WebAssembly/binaryen#7358> The rust toolchain enables WASM feature `reference types` by default. However this feature is not supported by chromium lower than version 96 Therefore we found a workaround for it. In this implementation we detect if browser supports `reference types` first. If user's browser supported it, we load the wasm file with `reference types` on, otherwise we load the wasm file with `reference types` off. - Updated dependencies \[[`22ca433`](22ca433)]: - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - optimize IO for all-on-ui: make startMainThreadWorker async and defer import ([#1385](#1385)) - Updated dependencies \[[`22ca433`](22ca433), [`143e481`](143e481)]: - @lynx-js/[email protected] - @lynx-js/[email protected] - @lynx-js/[email protected] ## @lynx-js/[email protected] ### Patch Changes - Support Rspack v1.4.9. ([#1351](#1351)) ## @lynx-js/[email protected] ### Patch Changes - feat: support elementTemplate for web ([#1374](#1374)) ## [email protected] ## @lynx-js/[email protected] ## [email protected] ## @lynx-js/[email protected] ## @lynx-js/[email protected] ## @lynx-js/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
Bug Fixes
Tests
close: f-6739779600
Checklist