Convert react-error-overlay to React
It's currently pretty complicated. We should turn this into a separate package with a build step, and probably use React as a dependency instead of vanilla JS code.
We shouldn't have the "duplicate React" issue because it's technically inside an iframe and would get its own copy of React. So if I understand it right, they wouldn't share any state, and if React in the app breaks, the one in the overlay should not be affected.
This should also work if the main app stops depending on React.
So I went ahead and turned this into a separate package (and flow-type'd it) a while ago simply because it was virtually impossible to change things without breaking everything. See here.
The current copy in this repo is basically the rollup'd version of that package (which isn't published).
Switching it to React is viable now since we're using an iframe, but wasn't before since it wasn't in it's own frame. In hindsight, doing it in React probably would've been optimal but that was pre-iframe days.
Yea I was being silly for not thinking of this earlier.
Do you mind bringing your package into our monorepo?
Sure, we can do that. π
I think we should do this asap because itβs going to be tough to fix bugs as soon as this is out.
Iβm cool with keeping it separate too if you would prefer that. Just need access to publishing.
The package(s) have been brought into this repo. π
Let's do an equivalent of https://github.com/facebookincubator/create-react-app/pull/2142 as part of that. I'll close that PR for now.
Is anyone working on this? If not, I would like to write some React code π
I don't think anyone started it yet. Please do!
The latest code lives in packages/react-error-overlay.
Ok. Thanks!
Note that it has a build step (see its package.json).
Noted!
Fixed in 645dc42a18daeedd536a31dadd788ef32a4cf19a.