Skip to content

Commit 9bb1dda

Browse files
authored
chore: upgrade preact (#1349)
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` <!-- Thank you for submitting a pull request! We appreciate the time and effort you have invested in making these changes. Please ensure that you provide enough information to allow others to review your pull request. Upon submission, your pull request will be automatically assigned with reviewers. If you want to learn more about contributing to this project, please visit: https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md. --> <!-- The AI summary below will be auto-generated - feel free to replace it with your own. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved internal handling of rendering lifecycle hooks for better consistency and compatibility. * **Chores** * Updated a dependency to a newer version for enhanced stability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> ## Checklist <!--- Check and mark with an "x" --> - [ ] 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).
1 parent 2d58759 commit 9bb1dda

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"api-extractor": "api-extractor run --verbose"
167167
},
168168
"dependencies": {
169-
"preact": "npm:@hongzhiyuan/[email protected]319c684e"
169+
"preact": "npm:@hongzhiyuan/[email protected]3d3cc198"
170170
},
171171
"devDependencies": {
172172
"@lynx-js/types": "3.3.0",

packages/react/runtime/src/debug/component-stack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ export function setupComponentStack(): void {
147147
if (oldDiffed) oldDiffed(vnode);
148148
};
149149

150-
options[DIFF] = vnode => {
150+
options[DIFF] = (vnode, oldVNode) => {
151151
if (isPossibleOwner(vnode)) {
152152
renderStack.push(vnode);
153153
}
154-
if (oldDiff) oldDiff(vnode);
154+
if (oldDiff) oldDiff(vnode, oldVNode);
155155
};
156156

157157
options[ROOT] = (vnode, parent) => {

packages/react/runtime/src/debug/profile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { getDisplayName } from '../utils.js';
99

1010
export function initProfileHook(): void {
1111
const oldDiff = options[DIFF];
12-
options[DIFF] = function(vnode: VNode) {
12+
options[DIFF] = function(vnode: VNode, oldVNode: VNode) {
1313
// This __PROFILE__ is used for DCE testing
1414
if (__PROFILE__ && typeof vnode.type === 'function') {
1515
// We only add profiling trace for Component
1616
console.profile(`diff::${getDisplayName(vnode.type as ComponentClass)}`);
1717
}
18-
oldDiff?.(vnode);
18+
oldDiff?.(vnode, oldVNode);
1919
};
2020
const oldDiffed = options[DIFFED];
2121
options[DIFFED] = function(vnode) {

packages/react/runtime/src/lynx/performance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function markTiming(timestampKey: typeof PerformanceTimingKeys[number], force?:
117117

118118
function initTimingAPI(): void {
119119
const oldDiff = options[DIFF];
120-
options[DIFF] = (vnode: VNode) => {
120+
options[DIFF] = (vnode: VNode, oldVNode: VNode) => {
121121
// check `__globalSnapshotPatch` to make sure this only runs after hydrate
122122
if (__JS__ && __globalSnapshotPatch) {
123123
if (!globalPipelineOptions) {
@@ -128,7 +128,7 @@ function initTimingAPI(): void {
128128
markTimingLegacy('updateDiffVdomStart');
129129
}
130130
}
131-
oldDiff?.(vnode);
131+
oldDiff?.(vnode, oldVNode);
132132
};
133133
}
134134

packages/react/runtime/src/lynx/runWithForce.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ export function runWithForce(cb: () => void): void {
1616

1717
const oldDiff = options[DIFF];
1818

19-
options[DIFF] = (vnode: PatchedVNode) => {
19+
options[DIFF] = (vnode: PatchedVNode, oldVNode) => {
2020
if (oldDiff) {
21-
oldDiff(vnode);
21+
oldDiff(vnode, oldVNode);
2222
}
2323

2424
// when `options[DIFF]` is called, a newVnode is passed in

packages/react/runtime/types/internal-preact.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import 'preact';
66
declare module 'preact' {
77
interface Options {
88
/** _diff */
9-
__b?(vnode: VNode): void;
9+
__b?(vnode: VNode, oldVNode: VNode): void;
1010
/** _render */
1111
__r?(vnode: VNode): void;
1212
/** _commit */

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)