-
Notifications
You must be signed in to change notification settings - Fork 182
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
(fix) Fix issues with single-spa caused by naming extensions #720
Conversation
Size Change: -210 kB (-8%) ✅ Total Size: 2.26 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ibacher!
Might ticket the parcel re-rendering in https://issues.openmrs.org/browse/O3-769 @ibacher . Also I am reminded of https://issues.openmrs.org/browse/O3-1418, which we may want to resurrect if we think excess parcels cause performance problems. I suspect we are better off focusing on the loaders à la core v5. |
@brandones Yeah, definitely should ticket it. I'm not too concerned about it performance-wise, but I'm a little worried that there's a gap between the mental model of an extension and the actual implementation, since it's easy to think about "extension x in slot y (with hash z)" as a single, unique identity for the extension, but, in fact, the actual instance that extension creates can be different, depending on the application state. Basically, it would seem cleaner if e.g., As a practical matter, though, this doesn't seem to really be affecting anything, so I'm not sure it's the highest priority. |
Requirements
For changes to apps
If applicable
Summary
#708 accidentally broke our use of single-spa. Specifically, single-spa uses parcel names in order to track the parcel internally. However, we support rendering each extension basically any number of times. With the new names, this meant that if the same extension was loaded more than once (which happens relatively frequently, likely due to re-renders), this caused single-spa to improperly track the parcel's state resulting in a number of single-spa errors.
This shifts us to using the convention:
${slotName}/${extensionName}-${uniqueNumber}
, which avoids these errors.As future work, we should look into better memoisation of rendered extensions and extension-slots to reduce the number of parcels we are generating.
Screenshots
Related Issue
Other