Code Monkey home page Code Monkey logo

Comments (3)

lstrzebinczyk avatar lstrzebinczyk commented on September 13, 2024

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.

from ember-widgets.

azirbel avatar azirbel commented on September 13, 2024

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.

from ember-widgets.

lstrzebinczyk avatar lstrzebinczyk commented on September 13, 2024

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:

#= require ../origin/ember_widgets
#= require ../origin/src/carousel
#= require ../origin/src/templates/carousel
#= require_self

(+ 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.

from ember-widgets.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.