-
Notifications
You must be signed in to change notification settings - Fork 257
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
Vue3: Exceptions thrown in data
result in blank page
#11807
Comments
data
result in blank pagedata
result in blank page
We are pushing this issue out because it appears to be more complex than originally thought. A few discoveries:
This can be reproduced by throwing an error inside data in 'shell/pages/c/_cluster/manager/cloudCredential/index.vue' Some suggestions: #12198 |
We should strongly consider refactoring instances of data that contain complex initialization logic. The project will benefit from writing idiomatic Vue code, and my concern is that we're trying to preserve an anti-pattern instead of correcting and discouraging its usage. We can eliminate this problem entirely by moving logic and side effects to lifecycle hooks, computed props, or methods and keeping |
@rak-phillip If the anti-pattern was just tech debt i would agree. This issue though is about ensuring the ui doesn't 'crash' (show a blank page, require refresh), which is about worst thing that can happen, erodes faith in the product and rancher, and is a vue3 UX regression. Once we identify places where this covers we can address in a better, targeted way (whilst still incrementally converting the complex data fn's over to something better). |
In that case, I'd like to advocate for guarding against as many critical failures as possible for 2.10. A straightforward way to address this is to wrap each offending instance of complex initialization in data in a If we consider all components that contain a data prop that does not immediately return an object
These can be interpreted as containing complex initialization logic; we would have at least 155 components to cover:
|
Setup
Describe the bug
To Reproduce
data
function, for example/shell/pages/home.vue
Result
Expected Result
Additional Information
The text was updated successfully, but these errors were encountered: