Skip to content

Commit

Permalink
fix missing component name
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Dec 6, 2024
1 parent 1dc41b2 commit 59219b8
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 50 deletions.
23 changes: 15 additions & 8 deletions chrome/public/bundle/detector.js

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

23 changes: 15 additions & 8 deletions chrome/public/bundle/hook.js

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

23 changes: 15 additions & 8 deletions chrome/public/bundle/panel.js

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

23 changes: 15 additions & 8 deletions chrome/public/bundle/proxy.js

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

23 changes: 15 additions & 8 deletions chrome/public/bundle/service-worker.js

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

28 changes: 18 additions & 10 deletions packages/core/src/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ export class DevToolCore {

this.notifyHMR();

this.notifyDispatch(dispatch);
this.notifyDispatch(dispatch, true);
};

const onFiberRun = (fiber: MyReactFiberNodeDev) => {
Expand Down Expand Up @@ -478,21 +478,29 @@ export class DevToolCore {
this._notify({ type: DevToolMessageEnum.chunk, data: { [id]: { loaded: data } } });
}

notifyDispatch(dispatch: DevToolRenderDispatch) {
notifyDispatch(dispatch: DevToolRenderDispatch, force?: boolean) {
if (!this.hasEnable) return;

if (this._dispatch.has(dispatch)) {
const now = Date.now();

const last = map.get(dispatch);

if (last && now - last < 200) return;

map.set(dispatch, now);
if (force) {
map.set(dispatch, now);

const tree = this.getTree(dispatch);

this._notify({ type: DevToolMessageEnum.ready, data: tree });
const tree = this.getTree(dispatch);

this._notify({ type: DevToolMessageEnum.ready, data: tree });
} else {
const last = map.get(dispatch);

if (last && now - last < 200) return;

map.set(dispatch, now);

const tree = this.getTree(dispatch);

this._notify({ type: DevToolMessageEnum.ready, data: tree });
}
}
}

Expand Down

0 comments on commit 59219b8

Please sign in to comment.