-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Layout should have a provision to handle application loading errors gracefully #49
Comments
Agreed. Perhaps a <application name="nav" loader="navLoader" load-error="navLoadError"></application> import { constructRoutes } from 'single-spa-layout';
const routes = constructRoutes(document.querySelector('#single-spa-layout'), {
loaders: {
navLoader: "<img src="loading.gif"></img>",
},
loadErrors: {
navLoadError: "<div>The navbar is having problems</div>"
}
}) One question about this is if we should also think about mount errors for applications as part of this. @TheMcMurder do you have thoughts on this? |
One thought was can we look esi spec for ideas Namely |
Another possibility is the application tag is likely to become very verbose with leaders, errors , parameter lists etc. and its likely we add more in the times to come. Since we already have the json being provided in the constructRoute Api we can probably only provide the name and the rest including the params ,loaders , exception paths are defined in json. This will avoid the clutter as we as keep the template stable for the users. |
Please refer to issue #47 where if there is a loading failure we continue to see the
loader
and the user will not know if there is a failure.The layout engine should have some provision to show an alternate message or alternate error handling component plus also unload the js file for the failing application.
The text was updated successfully, but these errors were encountered: