Using 'custom-element/index.html' instead of 'custom-element/custom-element.html'

41 views
Skip to first unread message

ivan.to...@gmail.com

unread,
Jul 30, 2014, 7:41:52 PM7/30/14
to polym...@googlegroups.com
Hi guys,

First of all, thank you for building into the future. Polymer is awesome, now I can picture a future where developing web apps is a pleasant thing.

Just wanted to share my opinion on how to name and import components. I know the convention is to name it like this: "/components/core-ajax/core-ajax.html" but it is so much easier to import when the name is just index.html, like this: "components/core-ajax/core-ajax.html" -- you can simply import "/components/core-ajax/" and it works... no need to repeat the component name in each import tag.

ivan.to...@gmail.com

unread,
Jul 30, 2014, 7:43:06 PM7/30/14
to polym...@googlegroups.com, ivan.to...@gmail.com
Just realized I repeated  "components/core-ajax/core-ajax.html", I meant  "components/core-ajax/index.html"

Eric Bidelman

unread,
Jul 31, 2014, 5:57:42 PM7/31/14
to ivan.to...@gmail.com, polymer-dev
I personally like the current approach because it's explicit. You know what you're importing (an element definition). It's unclear what index.html is or what it contains. Keep in mind, there's also the case where a repo can contain multiple elements:

In Polymer, we're using index.html to render element documentation. When you hit the URL, you get useful stuff rather than a blank screen:

Obviously, all of this is our convention :) You're free to use whatever works best for you.


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/27f22c29-2952-4d34-ad42-b7da15e7fa15%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages