Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Fix Fiber DEV mode detection #694

Closed
gaearon opened this issue May 6, 2017 · 4 comments
Closed

Fix Fiber DEV mode detection #694

gaearon opened this issue May 6, 2017 · 4 comments
Assignees

Comments

@gaearon
Copy link
Contributor

gaearon commented May 6, 2017

I fixed a false positive in #693 but we should have a better strategy than relying on a particular function. I think we should pass a completely separate function in Fiber which we'll check for crushed-ness, and keep it explicit. This will require a small change in React.

@gaearon gaearon self-assigned this May 6, 2017
@ManasJayanth
Copy link
Contributor

The approach, using a self declared testFunc and checking it name in the runtime, taken in earlier ReactDOM.js seems to be missing in ReactDOMFiber.js. Is this the small change in React you are talking about?

If the same approach is taken in Fiber, we again run the same check in devtools right?

@gaearon
Copy link
Contributor Author

gaearon commented May 10, 2017

I think something similar is reasonable. We keep testFunc declared in ReactDOMFiber but pass it together with injectInternals() call. Then in DevTools we can assert on it.

I want to check two things:

  1. That name is minified
  2. That something inside __DEV__ block in testFunc does not exist at all in toString()'d code

@ManasJayanth
Copy link
Contributor

ManasJayanth commented May 10, 2017

Ah! Interesting. And use regex to check if __DEV__ block is empty?

Edit: Did you mean __DEV__ block is empty, or no __DEV__ block at all? I thought the build process strips the block altogether. In that case its again a simple string check for just __DEV__

@bvaughn
Copy link
Contributor

bvaughn commented Aug 19, 2019

React DevTools has been rewritten and recently launched a new version 4 UI. The source code for this rewrite was done in a separate repository and now lives in the main React repo (github.com/facebook/react).

Because version 4 was a total rewrite, and all issues in this repository are related to the old version 3 of the extension, I am closing all issues in this repository. If you can still reproduce this issue, or believe this feature request is still relevant, please open a new issue in the React repo: https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools

@bvaughn bvaughn closed this as completed Aug 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants