-
Notifications
You must be signed in to change notification settings - Fork 27
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
Log render reasons in browser console #282
Comments
Hi there! Preact has its own developer tools that you can install as a browser extension: As for the "Why Did You Render" library, the reason there is no specific documentation on how to set it up with Preact is because it works out-of-the-box with Here's their codesandbox that I forked and dropped in the aliases on: I'm going to close this one out since it's a question, but feel free to ask any further questions on Slack - Saturdays aren't as quick to get an answer, but it's generally a better avenue than GitHub for things like this. |
@marvinhagemeister I wanna know why an update is trigger as an alert in console during development. Is this possible today? |
@frederikhors I'd love to hear more about the use case before adding such a feature. What kind of information you're aiming to get via the console.log output that's not present in devtools? Or are you looking for a different way to visualize renders over time? |
Ok. I will explain it differently. I'm developing a new app with React/Preact. I would love to install Is it clear now? |
Thanks for the explanation. That sounds reasonable, I can add such a setting to the devtools. My main worry initially was that it could get a bit noisy depending on the app in question, as I'm unsure how we can differentiate useful renders from non-useful ones. But if it's a custom user setting it's good enough imo. |
I think this is what https://github.com/welldone-software/why-did-you-render does. Nope? |
Hi @marvinhagemeister, we are evaluating Preact for a job where every single FPS counts. Do you think this feature will ever be implemented? |
Yes, I do like to have some form to judge the usefulness of a render. |
Like what they already do in https://github.com/welldone-software/why-did-you-render? Nope? |
@frederikhors if you have a specific thing that you want let's make an RFC? We can also help you out if you want to contribute this change yourself, insisting/pressuring someone else to do it won't solve the issue at hand 😄 |
@JoviDeCroock there is no RFC to write. Everything is very simple: " I didn't "insist"; today I just asked - after almost two months - if this feature will ever be inserted or not since in the coming weeks a project for which we are also evaluating Preact starts. Just to clarify. Thank you all for your immense commitment. |
So, I have some more concrete requests here which hopefully shed some light: Firstly, if a component is re-rendered, but no DOM changes are made as a result - that's a prime opportunity for applications developers to improve performance. I would find it very useful to have devtools separate "render with no updates" from "render with updates". Secondly, there's useful details regarding the render reason missing. In development mode, at least, I'd like to see a way to figure out what state changed. For class components, which keys of For function components, one could make For context updates, including the |
I'm new to Preact.
Long time ago I was using React and it was almost necessary to use this tool to speed everything up: https://github.com/welldone-software/why-did-you-render.
Today I started working with Preact for the first time and I was wondering if today we still need a tool like that.
And if so, how can we make it work for Preact?
From here it seems to me that nobody knows how: welldone-software/why-did-you-render#113.
The text was updated successfully, but these errors were encountered: