Skip to content

Conversation

@huntie
Copy link
Member

@huntie huntie commented Mar 28, 2024

Summary

Note

Depends on #34 ✅ and #35 ✅. Please review the latest stacked commit.

Adds an FB-only react_devtools_placeholder panel and enables in the rn_fusebox entry point. This panel is intended to be temporary, until we internally launch the React DevTools feature.

Test plan

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.

const ReactDevToolsPlaceholder = await loadReactDevToolsPlaceholderModule();
return ReactDevToolsPlaceholder.ReactDevToolsPlaceholder.ReactDevToolsPlaceholderImpl.instance();
},
experiment: Root.Runtime.ExperimentName.REACT_DEVTOOLS_PLACEHOLDER_PANEL_ENABLE,
Copy link

Choose a reason for hiding this comment

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

Can we actually hide this panel / placeholder if ENABLE_REACT_DEVTOOLS_PANEL flag is enabled? This was added in eba41f4

Maybe change logic a bit in a way that if flag is not enabled -> render placeholder. Otherwise, we may end up in a state, when flag is enabled and we render 2 panels: one is placholder and the other is experimental React DevTools panel.

Copy link
Member Author

Choose a reason for hiding this comment

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

if flag is not enabled

I'd love to, but can't find any pattern to invert an experiment check in this way in the codebase 😐. What we will have instead is one configuration point where it should be clear we'll disable one experiment over the other.

Root.Runtime.experiments.enableExperimentsByDefault([
  Root.Runtime.ExperimentName.REACT_NATIVE_SPECIFIC_UI,
  Root.Runtime.ExperimentName.REACT_DEVTOOLS_PLACEHOLDER_PANEL_ENABLE,
]);

Choose a reason for hiding this comment

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

Bit surprised CDT doesn't have the convention of "disabled experiment". In that case, sounds like it would it be simpler to

  1. remove the existing experiment field from RDT view registration
  2. modify the existing RDT view registration to load this placeholder based on the existing experiment value.

Depending on where we check the experiment, we can mark the RDT experiment registration as "restart required" too.

That way we have a single deterministic experiment and always have the RDT panel visible (goal of this PR).

Copy link
Member Author

Choose a reason for hiding this comment

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

We could do this, but I don't think the juice is worth the squeeze, as we'll remove this placeholder soon enough. Main blocker is the RDT panel hasn't landed yet.

Copy link
Member Author

Choose a reason for hiding this comment

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

Discussed offline with @hoxyq — will remove my experiment flag and enable by default. Ruslan will build on top of this to use this panel as the RDT panel.

@huntie huntie force-pushed the fusebox-entry-point-3 branch from 94d11da to fe5f2a7 Compare April 3, 2024 13:27
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.

Discussed offline, I will update my changes in #17 to change paths / ids for this panel, and which will gate the contents of this panel (stub / real RDT view)

@huntie huntie merged commit 9a23d4c into facebook:main Apr 3, 2024
@huntie huntie deleted the fusebox-entry-point-3 branch April 3, 2024 13:58
>npx react-devtools</code
>
</div>
<a
Copy link

Choose a reason for hiding this comment

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

I don't think this fburl quite makes sense considering that we launch CDT in a Chrome guest profile.

Choose a reason for hiding this comment

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

@huntie, #31 and the internal diff could be a useful pattern here

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.

5 participants