create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Convert react-error-overlay to React

Open gaearon opened this issue 9 years ago β€’ 14 comments

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.

gaearon avatar May 08 '17 18:05 gaearon

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.

Timer avatar May 08 '17 19:05 Timer

Yea I was being silly for not thinking of this earlier.

Do you mind bringing your package into our monorepo?

gaearon avatar May 08 '17 19:05 gaearon

Sure, we can do that. πŸ˜„

Timer avatar May 08 '17 19:05 Timer

I think we should do this asap because it’s going to be tough to fix bugs as soon as this is out.

gaearon avatar May 10 '17 10:05 gaearon

I’m cool with keeping it separate too if you would prefer that. Just need access to publishing.

gaearon avatar May 10 '17 10:05 gaearon

The package(s) have been brought into this repo. πŸ‘

Timer avatar May 10 '17 23:05 Timer

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.

gaearon avatar May 14 '17 22:05 gaearon

Is anyone working on this? If not, I would like to write some React code πŸ˜„

tharakawj avatar May 20 '17 10:05 tharakawj

I don't think anyone started it yet. Please do!

gaearon avatar May 20 '17 10:05 gaearon

The latest code lives in packages/react-error-overlay.

gaearon avatar May 20 '17 10:05 gaearon

Ok. Thanks!

tharakawj avatar May 20 '17 10:05 tharakawj

Note that it has a build step (see its package.json).

gaearon avatar May 20 '17 11:05 gaearon

Noted!

tharakawj avatar May 20 '17 13:05 tharakawj

Fixed in 645dc42a18daeedd536a31dadd788ef32a4cf19a.

gaearon avatar Aug 28 '17 01:08 gaearon