rough-stuff / wired-elements

Collection of custom elements that appear hand drawn. Great for wireframes or a fun look.
https://wiredjs.com
MIT License
10.49k stars 328 forks source link

Bundled version not working with Google Closure compiler #147

Open davclark opened 4 years ago

davclark commented 4 years ago

I'm trying to use the bundled wired-elements with ClojureScript / shadow-cljs as part of a community project. shadow-cljs uses Google's Java-based closure compiler, and gives me the following error:

Closure compilation failed with 3 errors
--- node_modules/wired-elements/lib/wired-elements-bundled.js:2
Class names defined inside a function cannot be reassigned.
--- node_modules/wired-elements/lib/wired-elements-bundled.js:28
Class names defined inside a function cannot be reassigned.
--- node_modules/wired-elements/lib/wired-elements-bundled.js:984
Class names defined inside a function cannot be reassigned.

Each of these lines appears to be a definition of a CSS :host rule inside a template string... so I'm not sure what the issue really is, and it may be due to shadow-cljs. While my project is using shadow-cljs, it is structured as a fairly typical npm project if you want to try running it yourself. The project in question is in the scrape-n-mail directory (after installing dependencies w/ npm install, I get the above error using npm run watch for example):

https://github.com/davclark/maybe-buddha/tree/wired

While this doesn't seem insurmountable, I'm not famliar with how you bundle things and what the right plan of attack would be. I'm happy to try to work up a PR with some guidance on how to do that!

And if this seems like the fault of shadow-cljs, please let me know and I'll go bother those fine people.

pshihn commented 4 years ago

I know lit-element added support for Closure compiler, so there's a change things will work with the latest version. Try v2.1.0