-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Advertise a React-equivalent version number to the React DevTools #1231
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
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c15aa60:
|
|
So for the common human not clued up in how dev-tools works (a.k.a me) with react-reconciler, we need to pass the version of react not the version of the library using the reconciler? So in the case of |
|
yeah, i thought we're supposed to put ... um, our own version in there. :-D so i noticed that often features aren't available and always was scratching my head, so this is all that's needed? btw why 17.0.1 and not 17.0.2? in the file you linked it seems we'd miss a lot of integrations |
|
@joshuaellis I used "react" as an umbrella for all officially supported React Renderers: React DOM, React ART and React Native. All of these use a shader |
|
@drcmda In theory, yes that version number should absolutely be at the discretion of the library. Unfortunately in practice the devtools using it to choose how to parse the structure of the internal fiber object means it's not there yet. I'm thinking of opening an issue for react, unless of course you'd rather do it yourself as a renderer maintainer. As for the using |
|
One thing I'm thinking of with regards to the displayed version number for the library in the devtools being wrong is whether it would break anything to include the version number of react-three-fiber as a prelease tag, so the version number would be something like |
please do, that would be much appreciated |
The React DevTools parses the semver string passed to
injectIntoDevToolsto detect the features available in the underlyingreact-reconcilerinstance (one such example can be found here). These checks are used for instance to decide whether to enable support for hooks or suspense in the UI.This PR changes the advertised version number to that of an equivalent React version to the react-reconciler library being used (right now the current Reconciler version is
0.26.2, which I approximately mapped to17.0.1).There are a few pros and cons to this change that I can think of, the obvious pros being that it makes the development experience generally better as it unlocks all the features of the devtools, while the two main problems this creates are:
Obviously a better, long term fix would be to have react-reconciler pass its own version alongside the renderer's to the devtools, but in the short term this sounded like an acceptable fix (and if this is ever fixed in React itself I guess it should be enough to just revert this PR)