-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Move instrumentation from isomorphic to renderers/shared #6797
Comments
Should |
Yea. @gaearon Do you have a plan for how the new perf tool API will be used since it is tied to a particular renderer? It is the only of the add-ons that does that. |
I don't quite understand what you're asking. From user's point of view it is used the same way as before, through react-addons-perf. If you create a third party renderer you'll need to emit some events to tell it what's going on, but I don't see this as being "tied" to RN or DOM renderers. |
Move instrumentation to renderers/shared. Closes #6797
I still don’t quite understand what you want to do in #6795. Why is |
Currently both This means that there will be two copies of the The alternative would be that we keep The other addons are not affected because they only depend on things in the |
Do I understand correctly that you are concerned that changes to |
Is the intent also to get away from the current dependency injection? Would this allow multiple independent renderers to coexist in a runtime environment as well? (Possible upcoming scenario: ReactDOM and ReactART, with ReactDOM using the current reconciler and ART using the incremental reconciler) |
@iamdustan Yes, that is an imminent upcoming scenario. |
@gaearon I'm more concerned about the events not making sense across renderers, but I guess we already tried to make that very generic so maybe that's unfounded. I'm concerned about having too much in the isomorphic package. It is supposed to be small. I'm also concerned about having stateful modules in the isomorphic package. It would be nice to let I think
Then we'd need some way to connect them up. For UI based tools such as the Chrome React DevTools, we've used a global variable to coordinate. That way it doesn't matter how npm nests the packages and it doesn't matter which module loads first. The perf tool or the renderer. Not sure how we'd solve this with a programmatic API though. One solution would be to expose the ReactInstrumentation module on the renderer and then you have to register it to get a paired up perf tool. var ReactDOMPerf = require('react-addons-perf')(require('react-dom')); If we're comfortable with require('react').registerRendererInstrumentation(require('ReactInstrumentation')); Then the perf tool can be a summary of all renderers ever registered. |
I'm offering problems more than solutions. Eager to hear your proposals. Btw, a design goal was to allow third parties doing something like |
Thanks, I understand it better now. I created #6812 to track this and will share my thoughts next week. |
…ared Move instrumentation to renderers/shared. Closes facebook#6797 (cherry picked from commit d125682)
Per @sebmarkbage, we want
isomorphic
folder to only contain the code necessary to author React components. It should not have dependencies onReactInstrumentation
,ReactDebugTool
, anddevtools/*
friends, which themselves should be moved torenderers/shared/
.The only caller we to
ReactInstrumentation
we have right now in that folder isonSetState()
insideReactComponent
. We need to move it somewhere inside the renderer (e.g. in the update queue implementation).Labeling it as a
good first bug
because this mostly involves moving files. The goal is that files inisomorphic
folder don’t contain anything that referencesReactInstrumentation
.This is up for grabs but I’ll do it myself if no one takes it.
The text was updated successfully, but these errors were encountered: