hyperstack-org / hyperstack-org/hyperstack

The DIV generated by the top level component error handler should have a class

Aperta
#308 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement good first issue
Lingua principale
JavaScript
Stelle
538
Fork
41
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

In order easily style the top level component error handler back stop it should have a class (like ''hyperstack-top-level-error-boundry' that you can set the CSS for.

I.e. make the text smaller, and give it a white background, etc.

Here is a patch:

```ruby
module Hyperstack
class Hotloader
module AddErrorBoundry
# don't attempt the alias unless the method is defined.
# for example if HotLoader is not included in the stack
alias original_display_error display_error if method_defined? :display_error
def display_error(*args)
DIV(class: 'hyperstack-top-level-error-boundry') { original_display_error(*args) }
end
end
end
end
```

**Be sure to have the method_defined? guard defined, otherwise you may discover in test or worse in production things won't boot**

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.