129 points · by clessg · 10y ago · 44 comments
While this looks useful, if `Foo` is an part of my application state I'm not too crazy about shipping that over to Facebook if I wanted to use this feature.
To clarify: the error message contains a link which goes to our GitHub pages site -- nothing is sent to any server automatically. You can always edit the URL if there's sensitive data in it for some reason.
You can also review the full source of our site or run it locally if you care to; it's all in the repo.
[1] https://github.com/facebook/react/blob/master/src/shared/uti...
[2] https://github.com/facebook/react/blob/master/docs/_js/Error...
Not sure if you missed spicyj's point or arguing that you yourself might not notice the sensitive data in the url.
If you - as the developer - need to inquire more about the error (say after reproducing it on production), you copy and paste the error url and remove the sensitive data before going to said url.
Even copying the error can be made a bit easier. Most (atleast FF and Chrome) consoles have the `copy` function which directly copies the passed string to clipboard. So when the error occurs, you can store it in an object in the global scope and the developer can just copy it with `copy(React.runtimeErrors.<errid>)` which is all autocompleted by the console anyways.
Now surely copy pasting secret stuff on another site is not very secure, but atleast it is not gonna be leaked to everyone in between the network from the url.
It's 4.5KB gzipped. All things considered this is insignificant to a normal react app.
This just adds extra overhead for everybody who tries to deal with those react errors in production (like for instance Sentry).
We thought this was a good compromise, but maybe we'll revisit in the future. Your feedback is valuable.
From @benvinegar's comments there (ex: https://github.com/facebook/react/issues/2686#issuecomment-2...) it sounded like the error code system would go at least most of the way towards solving your problem. Obviously the error message would not show up in Sentry automatically, but I figured that it would be a click away. I guess I must have misunderstood something along the line though.
Hoping to see more awesome stuff from him!
It's a terrible precedent and lacks any sort of standard :-/ I'm not a fan of this sort of pattern spreading.
Edit: here's someone complaining about it: https://github.com/angular/angular.js/issues/6077
It is a strong statement that React cares strongly about my page weight, even as small as 3KB. At least the implied message it sends me:
1. I really should care about my page weight too.
2. React must really need every KB it currently uses. And if not, it will soon optimize away the bloat.
[1] - https://github.com/facebook/react/blob/master/scripts/error-...
Another requirement would be that the URL on the server also does not change, otherwise the links from older react version would be broken.