-
Notifications
You must be signed in to change notification settings - Fork 75
Make it easy to include components individually #68
Comments
I have created a small gem available at https://github.com/KillaPL/ember_widgets_rails to simplify rails integration. I only need carousel widget and this is the only one available in the gem right now. However, the ability to include components individually is possible to achieve using sprockets, as I've done in the gem. If you'd like, I can try sending a pull request to achieve the same effect here. |
I'd be interested to hear more, but I don't have enough rails background to understand how your gem works or whether your approach would be applicable here. Could you explain, or just make a rough PR so I can get an idea of what it would look like? Alternatively - @bigsley may have a better understanding, since he's worked more with rails. |
Hopefully Addepar#68 gets fixed.
Sorry for the delay. Basically sprockets works my adding so colled directives, and then proprocessing files. Preprocessing concatenates all requested files into one. When developing web apps it allows to work on separate files for separate concerns, and deploy a single file to production. If you take a look at https://github.com/KillaPL/ember_widgets_rails, you will notice that all I did was, I copied whole repo from here and created file like this:
(+ some templates setting up not related to this problem) If this file was compiled by itself, it would provide a standalone file with carousel widget. If some widgets use common files, the common is obviously only included once, so it's a good way to provide standalone, and smallest possible file with expected widgets. It should be even possible to create an automated source generator with it, something like bootstrap has. |
Discussion from #19: "The files should be structured in such a way that to just use the couple of components only (not whole ember-widgets), the inclusion of the features should be very light and isolated."
Ideally, there would be a way to include just a few components, and avoid unnecessary dependencies/large amounts of code from other components.
The text was updated successfully, but these errors were encountered: