-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ErrorBoundary for PluginContainer #96
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #96 +/- ##
=======================================
Coverage 97.80% 97.81%
=======================================
Files 10 10
Lines 228 229 +1
Branches 55 59 +4
=======================================
+ Hits 223 224 +1
Misses 4 4
Partials 1 1 ☔ View full report in Codecov by Sentry. |
fad73ae
to
c3c816c
Compare
Co-authored-by: Jason Wesson <jsnwesson@gmail.com>
This is a great idea! Do you have examples of slots that you'd like to update to use this? |
I think the |
Yeah, there are definitely some product questions around that one - one of the main questions is "do we want to have the upgrade button by default?" If the answer to that is "no," then it wouldn't be a great candidate for a slot to show this off with. I think an ideal candidate would:
|
🎉 This PR is included in version 1.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
My bad! I was conflating internal interests with open source. I blame the fact that it's the end of the week 😅 . We are working on removing the Upgrade button from the open source repo so I agree it's actually not a great candidate. |
No worries at all! I definitely agree that is a great example of a place where |
This adds an
ErrorBoundary
(from frontend-platform) around each PluginContainer and provides two methods with which consumers can set the fallback component that renders when an error is caught.Also, the
pluginSlots
directory of the example app has been renamed toplugin-slots
in order to keep with the pattern we have set in MFEs.PluginSlot props
Set the
slotErrorFallbackComponent
prop in thePluginSlot
to a React component. This will replace the default<ErrorPage />
from frontend-platform.JS config
Set the
errorFallbackComponent
field for the specific plugin to the custom fallback component in the JS configuration. This will be prioritized over any other fallback components.