neighbour-hoods / nh-launcher

Creating a group coherence with holochain apps
Other
4 stars 3 forks source link

Strip out @scoped-elements/shoelace and use @shoelace directly #148

Closed adaburrows closed 6 months ago

adaburrows commented 8 months ago

Much of our code is currently using the @scoped-elements/shoelace project, but it doesn't really do much for us since there are some issues with it. However, it can work as a general template of how to use each Shoelace component in the context of a scoped lit-element.

Keep in mind, it uses a different mix-in than the one from lit labs that we should be using, so the interface is different.

However, to see why this could be problematic see the code in https://github.com/scoped-elements/shoelace/blob/main/src/sl-icon-button.ts, look at how it inherits things, and look at how it includes the themes from shoelace https://github.com/scoped-elements/shoelace/blob/main/src/index.ts which could potentially overwrite our theme each time we import a component.

nick-stebbings commented 8 months ago

From a quick survey of which scoped elements are still in use in the launcher:

So we are not far away from having all our own scoped components. Perhaps we just need to follow through with wrapping these remaining Sl components and check that the exising Nh ones are using the correct mixin (pretty sure they are).

We could combine this review with updating design system styles to also use a mixin, and changing the way we use overrides.

nick-stebbings commented 8 months ago

We should also by that point be able to also replace the rest of the MWC scoped components. Once we remove both of these packages and rely just on the design system the bundle size should drop dramatically.