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

Support for production & profiling React builds #25

Closed
dinkinflickaa opened this issue May 10, 2022 · 5 comments
Closed

Support for production & profiling React builds #25

dinkinflickaa opened this issue May 10, 2022 · 5 comments

Comments

@dinkinflickaa
Copy link

I am trying to run react-render-tracker against a react profiling build but seeing this error in the console

dispatcher-trap.ts:292 
       Uncaught (in promise) TypeError: renderer.getCurrentFiber is not a function
    at Object.set [as current] (dispatcher-trap.ts:292:41)
    at li (react-dom.profiling.min.js:169:287)
    at xc (react-dom.profiling.min.js:169:424)
    at sf (react-dom.profiling.min.js:163:248)
    at Qa (react-dom.profiling.min.js:158:295)
    at Hd (react-dom.profiling.min.js:195:178)
    at react-dom.profiling.min.js:198:188
    at qi (react-dom.profiling.min.js:164:220)
    at Id (react-dom.profiling.min.js:198:174)
    at Object.N.render (react-dom.profiling.min.js:250:154)

Are there any plans to make the tracker compatible with the profiling build?

@lahmatiy
Copy link
Owner

lahmatiy commented May 11, 2022

@dinkinflickaa Production and profiling builds provide limited API to React's internals. So, some data can't be captured for such builds. I have plans to support such builds with limited functionality. However, there is no ETA at the moment, since I focused on other features for now.

It also surprises me that you are getting an exception instead of a warning: "[react-render-tracker] Unsupported React renderer, only bundle type 1 (development) is supported but 0 (production) is found". What versions of React Render Tracker and React are you using?

@dinkinflickaa
Copy link
Author

Thanks for your response @lahmatiy. I made some changes locally to run the tracker against a profiling build, The stacktrace is probably the side effect of that.

@lahmatiy
Copy link
Owner

I found that the new check and warning was not published at the moment of writing my comment. So now you should see a warning in RRT about an unsupported build.

@lahmatiy
Copy link
Owner

Time to time, I get requests to support React build type other than development (i.e. production & profiling). Technically, it's possible but with a drawback that RRT will capture less data in this case, e.g. no owner-based hierarchy of components and less precision for a render/update cause detection. However, in some cases it might be not important at all. So I going to add such a support, with a reduction in data details due to a build type restrictions.

@lahmatiy lahmatiy changed the title Tracker doesn't work with react profiling build Support for production & profiling React builds Aug 17, 2022
@lahmatiy lahmatiy mentioned this issue Aug 17, 2022
62 tasks
@lahmatiy
Copy link
Owner

lahmatiy commented Jun 6, 2023

Just released 0.7.1 with basic support for production & profiling React builds.
Due to lack of API provided by production & profiling builds at the moment, some data is not capturing for these builds:

  • No owner for components, so only parent-child hierarchy in the components tree is supported. It also prevents detection of triggers for an update in most cases
  • No info about used hooks, including used contexts on functional components, memo hooks recomputation etc.
  • Some updates might be missed in the event log

@lahmatiy lahmatiy closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants