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

How to integrate fronted tools with Backend: Tools #35

Open
gsambrotta opened this issue Aug 14, 2014 · 0 comments
Open

How to integrate fronted tools with Backend: Tools #35

gsambrotta opened this issue Aug 14, 2014 · 0 comments

Comments

@gsambrotta
Copy link
Collaborator

What we have to integrate:

  • Ruby on Rails (Rake and Sprockets)
  • Ember.js (Bower and Grunt)

Solutions:

  1. Get rid of Sprockets and totally relay on GruntJS through Gruntfile.js
    Write a Gruntfile.js which can compile, minify and build.
    http://blog.pedago.com/2014/01/21/goodbye-sprockets-a-grunt-based-rails-asset-pipeline/

I like a lot but I guess it required a very good Gruntfile and knowledge of grunt.
It will take more time but is for sure a good way to learn.

  1. Using Yeoman
    http://www.emmanueloga.com/2013/07/23/Using-AngularJS-with-a-Rails-backend.html
    http://www.base2.io/2014/03/14/using-multi-buildpacks-to-deploy-a-yeoman-bower-grunt-application-on-rails/

I”m not so sure that this solution is actually helping us or it just make us use another tool.
Anyway using another tool but for good reasons, let’ go for it.

  1. Use just rails (Ember gem)
    http://robots.thoughtbot.com/emberjs-with-a-separate-rails-api
    https://github.com/dockyard/ember-appkit-rails
    http://www.ember-cli.com/

This will not allow us to separate easily BE and FE. If the project will grow up we’ll probably have some trouble.

I want to highlight this sentence which i totally agree with:
“While it is possible to include AngularJS(or Ember for us) as part of the rails assets, I think it is better to setup the angular code base on a standalone folder, leaving the rails app as a (more or less) isolated backend.
By keeping the frontend isolated from the backend you get an amazingly fast development environment and draw a clear line between backend and frontend (great for making sure you are writing the right unit/integration tests).”

Other questions:

  • Don’t commit and ignore .css files
  • Better solution for main.css file? Right now we compile in local, not commit it and then compile in deploy, but seems not really working because main.css is not ignored! (we have to uncommit every time!) and it always give a problem during deployment

Good Practice:

  • Don’t commit /bower_packages. Just bower.json WITH packages versions specified!
    Write a bower init task on deploy task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant