Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"api-extractor": "api-extractor run --verbose"
},
"dependencies": {
"preact": "npm:@hongzhiyuan/preact@10.24.0-319c684e"
"preact": "npm:@hongzhiyuan/preact@10.24.0-3d3cc198"
},
"devDependencies": {
"@lynx-js/types": "3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/react/runtime/src/debug/component-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ export function setupComponentStack(): void {
if (oldDiffed) oldDiffed(vnode);
};

options[DIFF] = vnode => {
options[DIFF] = (vnode, oldVNode) => {
if (isPossibleOwner(vnode)) {
renderStack.push(vnode);
}
if (oldDiff) oldDiff(vnode);
if (oldDiff) oldDiff(vnode, oldVNode);
};

options[ROOT] = (vnode, parent) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/runtime/src/debug/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import { getDisplayName } from '../utils.js';

export function initProfileHook(): void {
const oldDiff = options[DIFF];
options[DIFF] = function(vnode: VNode) {
options[DIFF] = function(vnode: VNode, oldVNode: VNode) {
// This __PROFILE__ is used for DCE testing
if (__PROFILE__ && typeof vnode.type === 'function') {
// We only add profiling trace for Component
console.profile(`diff::${getDisplayName(vnode.type as ComponentClass)}`);
}
oldDiff?.(vnode);
oldDiff?.(vnode, oldVNode);
};
const oldDiffed = options[DIFFED];
options[DIFFED] = function(vnode) {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/runtime/src/lynx/performance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function markTiming(timestampKey: typeof PerformanceTimingKeys[number], force?:

function initTimingAPI(): void {
const oldDiff = options[DIFF];
options[DIFF] = (vnode: VNode) => {
options[DIFF] = (vnode: VNode, oldVNode: VNode) => {
// check `__globalSnapshotPatch` to make sure this only runs after hydrate
if (__JS__ && __globalSnapshotPatch) {
if (!globalPipelineOptions) {
Expand All @@ -128,7 +128,7 @@ function initTimingAPI(): void {
markTimingLegacy('updateDiffVdomStart');
}
}
oldDiff?.(vnode);
oldDiff?.(vnode, oldVNode);
};
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react/runtime/src/lynx/runWithForce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function runWithForce(cb: () => void): void {

const oldDiff = options[DIFF];

options[DIFF] = (vnode: PatchedVNode) => {
options[DIFF] = (vnode: PatchedVNode, oldVNode) => {
if (oldDiff) {
oldDiff(vnode);
oldDiff(vnode, oldVNode);
Comment thread
colinaaa marked this conversation as resolved.
}

// when `options[DIFF]` is called, a newVnode is passed in
Expand Down
2 changes: 1 addition & 1 deletion packages/react/runtime/types/internal-preact.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'preact';
declare module 'preact' {
interface Options {
/** _diff */
__b?(vnode: VNode): void;
__b?(vnode: VNode, oldVNode: VNode): void;
/** _render */
__r?(vnode: VNode): void;
/** _commit */
Expand Down
22 changes: 11 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading