globalbrain / sefirot

Global Brain Design System.
https://sefirot.globalbrains.com
MIT License
151 stars 12 forks source link

Remove dependency on pinia #469

Closed brc-dd closed 5 months ago

brc-dd commented 6 months ago

Only stores/Snackbars.ts uses it. But I don't think it needs it.

brc-dd commented 6 months ago

Things to consider - https://vuejs.org/guide/scaling-up/ssr#cross-request-state-pollution

https://github.com/globalbrain/sefirot/blob/85752d55a67c381dfd725044af0b579f23d864c5/lib/composables/Tooltip.ts#L11 is also a leak I guess in SSR

kiaking commented 6 months ago

Yeah. Leaving that since tooltip will never rendered in SSR with our use cases, but, as a best practice, we should avoid it 👀

This is another reason too, but if some component really has a global state, maybe it would be easier to just use Pinia? 🤔 I mean it is made especially for this purpose (handling global state) so 😳

brc-dd commented 6 months ago

Yeah Pinia is definitely easy to use. But it's pulling like 20kB, I wanted to avoid that. Client only refs will work fine for both snackbars and tooltips, and most likely we won't ever need server side state 🤷 Idk, let's focus on other stuff and come back to this if it becomes performance bottleneck.

kiaking commented 5 months ago

@brc-dd I guess due to Error component, we are going to drop this issue, right? 😳