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

Umbrella: New Devtools API #5306

Closed
5 tasks
jimfb opened this issue Oct 28, 2015 · 4 comments
Closed
5 tasks

Umbrella: New Devtools API #5306

jimfb opened this issue Oct 28, 2015 · 4 comments

Comments

@jimfb
Copy link
Contributor

jimfb commented Oct 28, 2015

As per conversation with @sebmarkbage, it would be cool if React emitted events that allowed any attached devtools to listen for relevant events occurring in the core. The emitted events could be just descriptive enough that devtools could track whatever internal state it wants. For instance, a devtool could track perf by seeing how long various operations are taking (marked by start and end of the operation). Or a devtool could emit useful warnings (all our core warnings could be rolled into a devtools module/package, and by tracking state internally we could avoid routing the only-useful-for-warnings data throughout the core).

Anyway, the following are relevant:

@gaearon
Copy link
Collaborator

gaearon commented Oct 29, 2015

For instance, a devtool could track perf by seeing how long various operations are taking (marked by start and end of the operation).

I remember somebody trying to call Perf.start() and Perf.stop() before and after Flux Store dispatches, but the problem was that React batched setState() calls, and so the actual work was performed after. So if an API is provided for more accurate measurements, there should be a way to track the actual work associated with setState calls in particular period.

@slorber
Copy link
Contributor

slorber commented Nov 27, 2015

You probably refer to this issue @gaearon #3611

Also want these events to know when something bad happen, so that I can display a big fat red message to developers to fix their bug (because they usually don't look that much the console and ship softwares with console.error messages...)

@benmills
Copy link

I hit a similar issue around not getting prop type validation warnings as mocha reran my tests on file system changes. While resetting state would be a fine solution I would strongly prefer to get programatic access to prop type validation failures.

The real thing that, I believe, @glenjamin and I want to do is write tests that assert no prop type validations have failed. If we had the ability to clear ReactElementValidator.loggedTypeFailures we still would have to mess with console.warn to find validation errors.

@gaearon
Copy link
Collaborator

gaearon commented Oct 3, 2017

In the end the extensible system we tried to design didn’t really work out. Even with very few warnings, it was quite slow in development, and also pretty complicated.

We can design a better one now with the new engine, but I’d like to begin with scoping it down just to a warning hook first. We can track that in #4302.

@gaearon gaearon closed this as completed Oct 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants