-
Notifications
You must be signed in to change notification settings - Fork 20
Use Lit Context to share config across all addons
#491
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
Conversation
humitos
commented
Jan 13, 2025
- Reference: https://lit.dev/docs/data/context/
952d5d5 to
2289537
Compare
|
I merged #455 into this PR to give it a try, and I was able to re-display a notification by clicking on the "Change URL" button 🎉 . It seems this Lit Context pattern is proving that's going to work for what we want to do 👍🏼 . There is going to be some updates we will need to do to our addons, tho. Example: I found that |
|
I pushed up an example of using ContextRoot at #499 |
Additional elements shouldn't be needed in our structure. This is how we can use ContextRoot with `document.html` as the context root for providers/consumers of the config context. Both the flyout and the notifications load for me with this change.
|
@agjohnson I updated this PR to follow a pattern:
Can you provide an early review here taking into account the code written and the points I highlighted here? I understand we are moving in the right direction, tho. |
|
Yeah you look on a good path there, I think everything you've done so far makes sense 👍 |
|
I've been thinking a little more about this and I think we need something different here. The current approach this PR is following is re-render the addon every time the
Instead, I think we can create a
I understand this looks a lot simpler to implement and follows the pattern we currently have. I will give it a try and see where I end. |
|
I got everything working in #504 with 10% of the effort. I'm going to close this PR. We can continue there. |
This PR follows the approach exposed in #491 (comment). Basically, it manage all the `ContextRoot` logic in one place and update all the addons as needed. This approach is a lot simpler and easier to follow than the one originally done in #419. It also requires less code changes. Closes #157 --------- Co-authored-by: Anthony <[email protected]>