Labs Feedback: @lit-labs/context #3302
Replies: 5 comments 11 replies
-
I will happily switch my " 😕 I have tried this package and would use it, but it has serious bugs or missing features." vote to 🚀 once #3296 is fixed (for the moment, this issue is breaking our app). I am not worried / impacted by the other issues listed above. Prop drilling was (still somehow is, as our migration to using context is still undergoing) a real nuisance for our accessible survey application (accessiblesurveys.com or idata.tools): We tried a couple of (in house) approach to mitigate this, We are also using context to map nested references of a json database (firebase realtime db and firestore) to the dom tree. It is working quite well. |
Beta Was this translation helpful? Give feedback.
-
At first an important disclaimer: I have close to zero experience with lit - I started 2 days ago. What I found missing (or maybe just not documented enough?) is control over what takes precedence - provided context or locally-defined value My setup is a demo with many copies of the same component. Off course that can be managed inside context consumer, by splitting into 2 properties - provided and related to attribute, and manage state locally. I propose that But It's definitely worth to ship it even without the detail I described, since delivering props' defaults (which is the use case I worked on) is just one of the use cases for context provider |
Beta Was this translation helpful? Give feedback.
-
This is working great, one nitpick:
|
Beta Was this translation helpful? Give feedback.
-
In the @provide({context: loggerContext})
logger = new Logger(); |
Beta Was this translation helpful? Give feedback.
-
I seems found one serious shortcoming of the Context protocol. The problem is, that it depends on the order of the initialization of participated elements. Precisely, it expects, that context provider is initialized before context consumer, otherwise it will miss the If consumer is in the shadow dom of a provider, this is always the case. Though, if both provider and consumer are in the light dom, this may not be the case anymore, even if provider is a consumer's parent. I created two elements and a demo page like this one:
and got the following initialization order:
If I change the order of scripts in the html page, that is,
|
Beta Was this translation helpful? Give feedback.
-
The
@lit-labs/context
package is a set of controllers and decorators for using the Context Protocol as defined by the Web Components Community Group. This protocol lets elements provide and consume data in its subtree without data-binding.We want to collect your feedback on your experiences with
@lit-labs/context
as we iterate on it according to our Lit Labs process and move the package towards possible graduation or retirement.Please try
@lit-labs/context
and tell us about your experience. Leave comments with your thoughts; highlight what issues or missing features you're blocked on; give a link to a project that uses it; etc.And so we can have some numbers to look at, you can add reactions to this comment to indicate your experience with this package:
🚀 I have tried this package and it works great. I need it. Ship it!
👍 I have tried this package and it seems like a good idea.
😕 I have tried this package and would use it, but it has serious bugs or missing features.
👀 I am interested, but haven't tried the package yet.
👎 I'm not interested in this package.
Note: other reactions like 😄, 🎉, and ❤️ don't mean anything as part of this scheme. You probably mean, and please use, 🚀, 👍, or 👀. One exception is @benjamind who contributed this feature and is probably excited that we're taking steps to graduate it, but doesn't want to vote on the readiness of his own code :)
Beta Was this translation helpful? Give feedback.
All reactions