Managing imports

42 views
Skip to first unread message

Nicolas Ocquidant

unread,
May 24, 2016, 3:02:45 PM5/24/16
to Polymer
If I had understood correctly, managing imports in one big html file for the entire app (for instance elements.html) is not a best practice anymore.
Indeed, PRPL and polymer-cli requires each component (or view) to manage its dependencies.

Unfortunately, IDE are not a great help here. Do you have a tool to check (or automatically add if no conflict?) that a component declares all imports for the elements it uses?

Thanks a lot
--nick  

Justin Fagnani

unread,
May 24, 2016, 3:27:01 PM5/24/16
to Nicolas Ocquidant, Polymer
On Tue, May 24, 2016 at 12:02 PM, Nicolas Ocquidant <nocqu...@gmail.com> wrote:
If I had understood correctly, managing imports in one big html file for the entire app (for instance elements.html) is not a best practice anymore.
Indeed, PRPL and polymer-cli requires each component (or view) to manage its dependencies.

elements.html was never really a best practice, IMO. It completely bottlenecks the import graph so that you can't tell what depends on what. It's a convenience at first, but then gets harder and harder to maintain. If you stop using an import in one element, it makes it hard to know if you can remove the import from elements.html, or if another element is still using it.
 
Unfortunately, IDE are not a great help here. Do you have a tool to check (or automatically add if no conflict?) that a component declares all imports for the elements it uses?

`polymer lint --entrypoint x.html` should work most of the time, but we have a few outstanding issues to make it work correctly with lazy-loaded imports and it currently prefers the project configuration to the command-line args.

Cheers,
  Justin

 

Thanks a lot
--nick  

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/b9f59980-353f-4761-a528-ed99622fd994%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicolas Ocquidant

unread,
May 24, 2016, 4:11:01 PM5/24/16
to Polymer, nocqu...@gmail.com
Thank you for the feedback.
Reply all
Reply to author
Forward
0 new messages