DEV Community

Discussion on: How to avoid namespace pollution in Javascript

Collapse
 
artydev profile image
artydev • Edited

Hy Eckehard

In a module you cant import whatever variables from another one, and use them without any prefix.

TodoListTutor

Feel free to correct :-)

Regards

PS : Have you considered turning DML UI Elment in customeElements ?

TodoListCE

Thread Thread
 
efpage profile image
Eckehard

No, we had a focus on long term compatibility (expect IE), CE had a limited support some years ago.

I try to keep modules as small as possible. But maybe somebody could write a wrapper as a separate module? On the other hand, what's the advantage?

Thread Thread
 
artydev profile image
artydev • Edited

For the CE , it was in fact to illustrate,how easy it was to create one.
You can create a lib containing only DML-CE like Shoelace for CSS

But if IE is a concerned, you can look at a article I post WE
which allows create CE without any polyfill that works even in IE.

Regards

Thread Thread
 
peerreynders profile image
peerreynders

People get easily overwhelmed with his contributions so it's best to always pass along:

Thread Thread
 
artydev profile image
artydev • Edited

I know, unfortunately.
Thank you peerenders :-)