-
Notifications
You must be signed in to change notification settings - Fork 208
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) App not hot updating with slot config changes #357
Conversation
78fef85
to
d5ae830
Compare
File size impactMerging ext-slot-conf-update into master impact files as follow: @openmrs/esm-devtools-app (+1.81%)
@openmrs/esm-implementer-tools-app (+0.33%)
@openmrs/esm-login-app (+0.39%)
@openmrs/esm-offline-tools-app (+0.28%)
@openmrs/esm-primary-navigation-app (+0.36%)
@openmrs/esm-app-shell (+0.17%)
|
File size impactMerging ext-slot-conf-update into master impact files as follow: @openmrs/esm-devtools-app (+1.81%)
@openmrs/esm-implementer-tools-app (+0.33%)
@openmrs/esm-login-app (+0.39%)
@openmrs/esm-offline-tools-app (+0.28%)
@openmrs/esm-primary-navigation-app (+0.36%)
@openmrs/esm-app-shell (+0.17%)
|
); | ||
const slotStore = getExtensionSlotsConfigStore(); | ||
const oldState = slotStore.getState(); | ||
const newState = { slots: { ...oldState.slots, ...newSlotStoreEntries } }; |
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.
This will not remove oldState slots if they are meant to be removed. Is it desired to remove old unused slots from state?
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.
I asked @brandones a similar question once and he indicated the idea is to keep the slots around so that the implementer tools can track them even if the slot itself is no longer rendered.
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.
@ibacher is correct. There will not be so many that it will be a memory problem.
|
||
function useStore<T, U>(store: Store<T>): T; | ||
function useStore<T, U>(store: Store<T>, select: (state: T) => U): U; | ||
function useStore<T, U>( |
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.
What are all of these declarations for? You're just declaring a function then immediately overwriting it?
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.
Requirements
For changes to apps
If applicable
Summary
Fixes a bug where the app does not hot update in response to extension slot config changes.
Includes a breaking change to
useStore
anduseStoreState
, but this will not affect any existing users.Screenshots