-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(atomic): replace @stencil/store with in-house implementation (…
…#4814) https://coveord.atlassian.net/browse/KIT-3815 ## Why replace this dependency ? We are replacing stencil with lit and @stencil/store has some functionalities depending on stencil internal functions. It won't work once we begin switching. The implementation is here #4814 (comment) ## Why all the changes for isAppLoaded ? @stencil/store has a hidden functionality we were unknowingly depending on. There is an [stencil subscription](https://github.com/ionic-team/stencil-store/blob/main/src/subscriptions/stencil.ts) that causes automatic rerenders. The subscription listens to every component 'getting' a certain part of the state. It registers those components and whenever that same part of the state is 'set', it triggers a new render of those components. We were depending on it for the `loadingFlags` part of the state. In this PR I added `createAppLoadedListener` which takes in a callback and calls it whenever loadingFlags are empty. In every component that needs to listen to the loading flags, we add a `@State isAppLoaded` and create the listener to that internal state. Whenever that internal state is re triggered, it rerenders the component. ### Alternatives to `createAppLoadedListener` 1. We could create a decorator. That would mean implement the decorator in both Stencil & Lit. We can always revisit this whenever we implement Lit and figure out something better. 2. We could use Lit signals for this. It is exactly the signal use case. --------- Co-authored-by: GitHub Actions Bot <>
- Loading branch information
1 parent
58a2824
commit cc9cd0f
Showing
29 changed files
with
206 additions
and
73 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.