EOX-A / EOxElements

A Web Component collection of geospatial UI elements, crafted by EOX.
https://eox-a.github.io/EOxElements/
MIT License
12 stars 2 forks source link

Add check for already registered component before registering #1182

Open santilland opened 2 months ago

santilland commented 2 months ago

With migration to js+jsdoc from typescript we can now add a check when registering component so that no double registration attempt happens when importing elements multiple times. eox-map needs to be migrated, but this could be done for all other elements

silvester-pari commented 2 months ago

Relevant discussions of how/if this can/should be done:

https://github.com/lit/lit-element/issues/207 https://github.com/storybookjs/storybook/tree/master/app/web-components#setup-page-reload-via-hmr

Need to research a bit more on the pros/cons of this...

Looking at how other libraries handle this, one example is pharos letting the user define/register the components: https://github.com/ithaka/pharos/blob/develop/packages/pharos/README.md#registering-components