Skip to content
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

Add reload-to-profile for Fusebox #117

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

EdmondChuiHW
Copy link

@EdmondChuiHW EdmondChuiHW commented Sep 22, 2024

Summary

Dependant on Flow types from facebook/react#31021

Updated the TS def in this PR to allow building without errors. Will do a proper upgrade after everything has landed

Test plan

Test E2E in D63233256

Upstreaming plan

  • This commit should be sent as a patch to the upstream devtools-frontend repo. I've reviewed the contribution guide.
  • This commit is React Native-specific and cannot be upstreamed.

@EdmondChuiHW EdmondChuiHW requested a review from hoxyq September 26, 2024 03:12
@EdmondChuiHW EdmondChuiHW marked this pull request as ready for review September 26, 2024 03:12
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 6, 2024
Summary:
Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under new architecture. Bridging for legacy Android and iOS will be added in follow-up diffs

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 7, 2024
Summary:
Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 7, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox.

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 8, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 9, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 9, 2024
…6856)

Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 9, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 10, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
EdmondChuiHW added a commit to EdmondChuiHW/react-native that referenced this pull request Oct 10, 2024
Summary:

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Oct 10, 2024
Summary:
Pull Request resolved: #46856

Changelog:
[General][Added] - Add support for reload-to-profile in Fusebox. (Part 1 of 2: native)

CDT: facebookexperimental/rn-chrome-devtools-frontend#117
React: facebook/react#31021

This diff adds support for reload2profile under bridge and bridgeless for iOS, Android, and C++

Reviewed By: hoxyq

Differential Revision: D63233256

fbshipit-source-id: f2f2814491e785b03af143cc26639ef178881fff
Comment on lines 174 to 178
this.#wall.listen((message: ReactDevToolsTypes.Message): void => {
if (message.event === 'reloadAppForProfiling') {
SDK.ResourceTreeModel.ResourceTreeModel.reloadAllPages(false);
}
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use bridge for it, not wall. Ideally, we should be using Store, because this should be the only public API entrypoint.

But please use bridge, just to make sure we use same thing as what extension is using, in case we are going to change this.

Comment on lines +18 to +20
addListener(event: string, listener: (params: unknown) => any): void;
removeListener(event: string, listener: Function): void;
shutdown: () => void;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will make it official in facebook/react#31274

Comment on lines +83 to +86
override dispose(): void {
this.#bridge?.removeListener('reloadAppForProfiling', this.#handleReloadAppForProfiling);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some existing listeners that needs to be unsubscribed here too. Following up in #129

@EdmondChuiHW EdmondChuiHW merged commit 7769586 into facebookexperimental:main Oct 16, 2024
3 checks passed
@EdmondChuiHW EdmondChuiHW deleted the reload2profile branch October 16, 2024 15:41
EdmondChuiHW added a commit to facebook/react that referenced this pull request Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants