Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name conversions and component modularity #41

Closed
mbykovskyy opened this issue Aug 8, 2014 · 4 comments
Closed

Name conversions and component modularity #41

mbykovskyy opened this issue Aug 8, 2014 · 4 comments
Labels

Comments

@mbykovskyy
Copy link
Contributor

I need an autocomplete component so I was thinking about pulling @bamnet's work and add on to it, but I'm curious about your conventions. Do you prefer keeping components in files that reflect Google Maps API namespaces such as google-map.html and google-map-places.html? Or is it good practice to separate components into their own files i.e. google-map.html, google-map-marker.html, google-places-autocomplete.html?

@bamnet
Copy link
Contributor

bamnet commented Aug 8, 2014

I think it's useful to make distinct features, like autocomplete, into their own component files. Developers might want to pull in the autocomplete box without a map.

Personally, I also find it easier to read diffs if we have seperate files. I always get a bit confused if a change is happening up in <google-map-marker> or down in <google-map> since they're part of the same google-map.html file.

P.S. I'd open an issue about the autocomplete functionality you're interested in, there are a few different ways that implementation can pan out if we choose to expose the full autocomplete widget or just the JS service you could wire up to your own input boxes.

@mbykovskyy
Copy link
Contributor Author

Ok I'll open a new issue for autocomplete component. Should this issue stay open until there's an agreed convention for naming and separating components? Like you said google-map.html contains two components while the rest of the components/services live in their own file.

@bamnet
Copy link
Contributor

bamnet commented Aug 8, 2014

Let's let @ebidel || @addyosmani weigh in here.

@ebidel
Copy link
Contributor

ebidel commented Aug 11, 2014

Generally, we prefer separate files for separate functionality. That's the majority case. However, for something like google-map and google-map-marker, the latter is not useful by itself so it makes sense to define it alongside google-map. Given that, a separate import would be wasteful and unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants