nanocomponent icon indicating copy to clipboard operation
nanocomponent copied to clipboard

Error boundries

Open yoshuawuyts opened this issue 8 years ago • 5 comments
trafficstars

In React 16 components introduce something new called error boundries. The main idea is that if an error is thrown from a component, it can be caught early, and prevents crashing the whole web page.

I find this interesting because:

  1. it means apps can keep running even if a component crashes (resiliency! :D)
  2. it'll play well with component.use (or similar); can send through the error to a local dev logger, or monitoring solution
  3. it's especially good to add resiliency when encapsulating 3rd party code - ideally code would never crash, but alas code isn't bug free

Thoughts?

yoshuawuyts avatar Aug 07 '17 15:08 yoshuawuyts

How does this work? Wrap stuff in try catch?

bcomnes avatar Aug 07 '17 15:08 bcomnes

I like the idea though.

bcomnes avatar Aug 07 '17 15:08 bcomnes

Wrap stuff in try catch

yeah, pretty much haha

yoshuawuyts avatar Aug 07 '17 16:08 yoshuawuyts

I saw this on twétèr and thought the idea was interesting too. Would this be something baked in to nanocomponent or could it be maintained as a standalone module?

ungoldman avatar Aug 07 '17 17:08 ungoldman

Think having it be part of NC would be good - isolates a class of errors / unlike servers you'll most likely never want a full page to crash

On Mon, Aug 7, 2017, 19:33 Nate Goldman [email protected] wrote:

I saw this on twétèr and thought the idea was interesting too. Would this be something baked in to nanocomponent or could it be maintained as a standalone module?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/choojs/nanocomponent/issues/43#issuecomment-320728704, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlejQZJMKloyjeZlNo6AAm8tGooAhzks5sV0pRgaJpZM4OvmfY .

yoshuawuyts avatar Aug 08 '17 00:08 yoshuawuyts