-
Notifications
You must be signed in to change notification settings - Fork 114
chore: upgrade preact #1349
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
chore: upgrade preact #1349
Conversation
To compare: preactjs/preact@10.24.0...hzy:preact:lynx/v10.24.x, which means this is preactjs/preact#4849 landed on previous version `319c684e`
|
📝 WalkthroughWalkthroughThe changes update the signature of the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ERROR Cannot resolve version $@rspack/core in overrides. The direct dependencies don't have dependency "@rspack/core". Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ 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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the preact dependency from version 10.24.0-319c684e to 10.24.0-3d3cc198 and updates the codebase to accommodate API changes in the new version. The upgrade includes handling a new parameter in the options[DIFF] hook callback.
- Updates preact dependency version in package.json
- Modifies all
options[DIFF]hook implementations to accept the newoldVNodeparameter - Ensures backward compatibility by passing the additional parameter to existing diff callbacks
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/package.json | Updates preact dependency version |
| packages/react/runtime/src/lynx/runWithForce.ts | Adds oldVNode parameter to DIFF hook callback |
| packages/react/runtime/src/lynx/performance.ts | Adds oldVNode parameter to DIFF hook callback |
| packages/react/runtime/src/debug/profile.ts | Adds oldVNode parameter to DIFF hook callback |
| packages/react/runtime/src/debug/component-stack.ts | Adds oldVNode parameter to DIFF hook callback |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/react/runtime/src/lynx/runWithForce.ts:19
- The parameter 'oldVNode' lacks a type annotation. It should be typed consistently with other similar parameters in the codebase.
options[DIFF] = (vnode: PatchedVNode, oldVNode) => {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/react/runtime/src/lynx/runWithForce.ts (1)
19-19: Add explicit typing for theoldVNodeparameter.The
oldVNodeparameter should be explicitly typed for better type safety and consistency with the codebase.- options[DIFF] = (vnode: PatchedVNode, oldVNode) => { + options[DIFF] = (vnode: PatchedVNode, oldVNode: VNode | null) => {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
packages/react/package.json(1 hunks)packages/react/runtime/src/debug/component-stack.ts(1 hunks)packages/react/runtime/src/debug/profile.ts(1 hunks)packages/react/runtime/src/lynx/performance.ts(2 hunks)packages/react/runtime/src/lynx/runWithForce.ts(1 hunks)packages/react/runtime/types/internal-preact.d.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
Learnt from: colinaaa
PR: lynx-family/lynx-stack#1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
packages/react/package.json (1)
Learnt from: colinaaa
PR: #1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
packages/react/runtime/src/debug/component-stack.ts (1)
Learnt from: colinaaa
PR: #1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
packages/react/runtime/src/lynx/performance.ts (1)
Learnt from: colinaaa
PR: #1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
packages/react/runtime/types/internal-preact.d.ts (1)
Learnt from: colinaaa
PR: #1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
packages/react/runtime/src/debug/profile.ts (1)
Learnt from: colinaaa
PR: #1238
File: packages/react/runtime/src/debug/component-stack.ts:70-90
Timestamp: 2025-07-18T04:27:18.291Z
Learning: The component-stack.ts file in packages/react/runtime/src/debug/component-stack.ts is a direct fork from https://github.com/preactjs/preact/blob/main/debug/src/component-stack.js. The team prefers to keep it aligned with the upstream Preact version and may contribute improvements back to Preact in the future.
🧬 Code Graph Analysis (4)
packages/react/runtime/src/debug/component-stack.ts (1)
packages/react/runtime/src/renderToOpcodes/constants.ts (1)
DIFF(4-4)
packages/react/runtime/src/lynx/performance.ts (1)
packages/react/runtime/src/renderToOpcodes/constants.ts (1)
DIFF(4-4)
packages/react/runtime/src/debug/profile.ts (2)
packages/react/runtime/src/renderToOpcodes/constants.ts (1)
DIFF(4-4)packages/react/runtime/src/utils.ts (1)
getDisplayName(67-69)
packages/react/runtime/src/lynx/runWithForce.ts (2)
packages/react/runtime/__test__/utils/nativeMethod.ts (1)
options(23-23)packages/react/runtime/src/renderToOpcodes/constants.ts (1)
DIFF(4-4)
🔇 Additional comments (5)
packages/react/package.json (1)
169-169: LGTM! Dependency version aligns with the DIFF hook signature changes.The preact dependency update from
10.24.0-319c684eto10.24.0-3d3cc198correctly supports the two-parameteroptions[DIFF]hook signature changes implemented throughout the runtime files.packages/react/runtime/src/lynx/performance.ts (1)
120-132: LGTM! Correctly implements the two-parameter DIFF hook signature.The changes properly update the
options[DIFF]hook to accept bothvnodeandoldVNodeparameters and pass them through to the originaloldDifffunction. The timing logic remains intact.packages/react/runtime/types/internal-preact.d.ts (1)
9-9: LGTM! Type definition correctly reflects the updated DIFF hook signature.The
__bhook type signature properly updated to accept bothvnodeandoldVNodeparameters, maintaining type consistency with the runtime implementation changes.packages/react/runtime/src/debug/profile.ts (1)
12-19: LGTM! Profile hook correctly updated for the new DIFF signature.The changes properly implement the two-parameter DIFF hook signature while preserving the existing profiling logic for function components.
packages/react/runtime/src/debug/component-stack.ts (1)
150-155: LGTM! Component stack hook correctly updated to match upstream Preact.The DIFF hook signature update maintains the component stack tracking logic while properly implementing the two-parameter signature. This aligns well with the team's preference to keep this forked file consistent with upstream Preact changes.
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging #1349 will not alter performanceComparing Summary
|
Web Explorer#3328 Bundle Size — 304.83KiB (~+0.01%).e9e954a(current) vs 2be5349 main#3322(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch hzy:p/hzy/pick_preact_4849 Project dashboard Generated by RelativeCI Documentation Report issue |
React Example#3338 Bundle Size — 235.02KiB (+0.02%).e9e954a(current) vs 2be5349 main#3332(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch hzy:p/hzy/pick_preact_4849 Project dashboard Generated by RelativeCI Documentation Report issue |
Reverts #1349 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated the signature of an internal rendering hook to accept a single parameter for improved consistency. * Adjusted related profiling and performance logic to align with the new hook signature. * **Chores** * Updated the "preact" dependency version. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
To compare: preactjs/preact@10.24.0...hzy:preact:lynx/v10.24.x, which means this is preactjs/preact#4849 landed on previous version
319c684eSummary by CodeRabbit
Bug Fixes
Chores
Checklist