alchaplinsky / polymer-rails

Polymer and web components for Ruby on Rails
MIT License
286 stars 80 forks source link

Template seperation #21

Closed steventill closed 9 years ago

steventill commented 10 years ago

This should fix issue number 13, in addition developers can now develop in coffeescript and sass that will be converted to js, and css inside the compiled import file.

alchaplinsky commented 9 years ago

Sorry for late commenting on this, but there are 2 things that I'm concerned about:

    • Inlining assets, after they have been processed is a good thing, but should we separate js,css and html in rails generator? Why don't we generate a single html file (like it was before) and let developers decide if they want to extract their css and js into a separate file (they may build web component which doesn't have any css or js in it)
    • Using name instead of file_name in generator will create a folder named as user typed it in console (without bringing it to snake case). But convention is to name folders and files with underscore between words.
steventill commented 9 years ago

Re: 1) The reason that I pulled everything out in to its own file is that once I actually started to develop my own components, I found that the files started getting larger then I would have liked. I thought that this would make my html files more reasonable. Maybe a better solution would be to add some more documentation to the generator. And the nice this is that if the css and/or js is in their own files then it is minified based upon the environment variables. But again maybe adding better documentation into the generator may alleviate concerns.

2) The reason that i changed this was because the default for the rails-core and rails-paper gems use hyphens. So I wanted there to be consistency between the gems and the generated components.

alchaplinsky commented 9 years ago

Ok, I'm thinking about following polymer approach and name all components folders hyphen separated. But this should be enforced by generator, cause user may type a name with underscores. Merging this, but have few improvement ideas before releasing new version.