Skip to content

Conversation

@huntie
Copy link
Member

@huntie huntie commented Jul 2, 2024

Summary

Note

Depends on #86 and facebook/react-native#45250.

Updates the rn_fusebox entrypoint to update the window title if the device returns identifying metadata via ReactNativeApplication.metadataUpdated. This signals the current app name and device name to the user! 🎉

Resolves T165849560.

Note

Known issue — ReactNativeApplicationModel is mounted within the Welcome panel, meaning this behaviour won't trigger if opened to another panel. This needs to be relocated in a later PR — likely having some model within the entrypoint inherit from this (or however the data flow can work). However, I want to land this change (see #88 for where we do make use of this in RNWelcome.ts) so we have incremental progress.

Test plan

Connect to Android and iOS after facebook/react-native#45250.

image

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.

Copy link

@hoxyq hoxyq left a comment

Choose a reason for hiding this comment

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

Can you try making ReactNativeApplicationModel part of the SDK? I believe this way it should start automatically, together with other required models, such as RuntimeModel:
https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/b1ab9e1f8a9b50cb2df3aeb48a50019e6e535294/front_end/core/sdk/sdk.ts#L5-L11

@huntie
Copy link
Member Author

huntie commented Jul 3, 2024

@hoxyq I can do 👍🏻 Alright if I stack this on top of #88?

@huntie huntie force-pushed the dynamic-window-title branch from 40042a0 to 31936d7 Compare July 3, 2024 14:55
@hoxyq
Copy link

hoxyq commented Jul 3, 2024

Can you try making ReactNativeApplicationModel part of the SDK? I believe this way it should start automatically, together with other required models, such as RuntimeModel:

https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/b1ab9e1f8a9b50cb2df3aeb48a50019e6e535294/front_end/core/sdk/sdk.ts#L5-L11

Oh, I think I was wrong, its probably better to register model in rn_fusebox.ts, the way we do it for FuseboxClientMetadata model:
https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/7cd81c1548a4bca19732037dcf82662a6ed9ca39/front_end/entrypoints/rn_fusebox/rn_fusebox.ts#L108-L121

@huntie huntie force-pushed the dynamic-window-title branch from 31936d7 to 4ea6a66 Compare July 3, 2024 16:24
Copy link

@hoxyq hoxyq left a comment

Choose a reason for hiding this comment

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

Model initialization logic is refactored in #90

@huntie huntie merged commit 5ab00ca into facebook:main Jul 4, 2024
@huntie huntie deleted the dynamic-window-title branch July 4, 2024 10:57
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