w
Just watched Lit video on Context And understand how Umbraco’s provide and consume context works a bit better. One thing I liked from Lit’s implementation that is now GA and not in labs stage is the Typescript decorator to provide & consume. Is this something we the Umbraco community could borrow or be inspired by?
n
I'm all for decorators mainly because they're more concise and when used with property/state keep the implementation details for the property together. I don't know from the example how to observe a property on the context, but I still like the general direction.
d
I'm also currently using lit-context for my U10 & U13 extensions. It's very nice to work with.
j
Just want to note, that we noticed Lit's context implementation was in conflict with our UmbController implementation, so we went ahead and renamed our methods to allow you to work with regular Lit controllers (such as the Context) as well as ours side-by-side. This allows you to use Lit's Context outright if you desire.
Initially we considered working with decorators, but we saw a need to have a callback and a filter function to be able to react on future changes to our own contexts. However, this doesn't exclude decorators from being a thing down the line for Umbraco's context. I, too, really like to work with decorators and especially for simple contexts that never change, this is perfect.
w
Yeh if we can simply or make things easier for common patterns or approaches with a custom decorator it will help with DX and help most people and if you need to do something more complex then you jump in as you have been doing before.
j
Just confusing that we have something called a "Context" and Lit now does as well, is all
d
This is awesome!
n
I would say that when time is there we will make a decorators for most things, but thats just synthetic sugar and it could complicate things in the current periode. So not a priority right now, but yeah that would lower the entry level 🙂
w
Yeh I know your all mega stacked, just spit balling future ideas to see what could be done to help improve
n
w
If you clone me, I would happily hack all day long. But it don’t pay the bills
13 Views