You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is also related to my other issue/question here: #193
After trying ember-cli-rails for a while, I couldn't avoid to ask myself what are its main benefits/use cases? It's not clear to me, yet.
The README says:
You should still be able leverage the asset pipeline, and all the conveniences that Rails offers.
But you can't really use the assets pipeline from within the Ember app. For instance, you can't add a .slim extension to an Ember Handlebars template (.hbs.slim) and then use helpers like image_path to properly refer to images handled by the Rails' assets pipeline.
I tried adding the Ember app folder to the precompile list, but there are two problems:
It takes a hell lot of time for Sprockets to process all the files in the uncompiled Ember app;
Even if Sprockets compiles files inside the uncompiled Ember app, ember-cli-rails will run ember-clibefore Sprockets, so it doesn't really make sense to do so, without hacking it further.
The README also doesn't make it clear what is the suggested approach for handling assets. Given that ember-cli offers its own assets pipeline solution, should it be used instead of Rails'?
For instance, with Angular, I made the decision to make Rails the "owner" of the app, and package the angular app within the Rails app (I think that's what ember-rails does, btw). I used this gem https://github.com/pitr/angular-rails-templates, and I could then use Slim templates which would then be converted to plain HTML through Sprockets. Very convenient and worked great. However, it looks like ember-cli-rails doesn't offer a way, by default, to precompile templates using the Rails pipeline, not even from EmblemJS (you can however, just use ember-cli with EmblemJS, but then, what's the point of using ember-cli-rails?)
What also added to my confusion was this post from the ember-cli-rails author, here :#30, quoting him:
I'd suggest using EmberCLI for javascript only for now, and use conventional Rails Assets Pipeline for stylesheets and other assets including images.
But how am I supposed to use the Rails assets pipeline with ember-cli?
The only benefit I see from using it is a portion of the Rails app is completely static or made with a different framework, and part of it is Ember, but the whole Ember app(s) has its assets completely handled by ember-cli. The additional benefit is to have the deployment handled by the Rails assets pipeline (namely copying the compiled ember-cli files to public/assets and fingerprinting them).
However, for a greenfield app, if one wants to go the ember-cli way, then I get the feeling it's much better to just treat Rails as an API and not attempt to integrate ember-cli with Rails, as it looks like it doesn't really make much sense because of the fact ember-cli duplicates a lot of functionality that Rails provides and sometimes they even conflict and don't play well together. Am I right?
If someone could enlighten me, I'd be very grateful!
The text was updated successfully, but these errors were encountered:
Unfortunately, we don't currently (and probably won't support) hooking directly into the Asset pipeline to allow for Rails' compilation of EmberCLI templates with .slim extensions, (although there are alternatives).
This is also related to my other issue/question here: #193
After trying
ember-cli-rails
for a while, I couldn't avoid to ask myself what are its main benefits/use cases? It's not clear to me, yet.The
README
says:But you can't really use the assets pipeline from within the Ember app. For instance, you can't add a
.slim
extension to an EmberHandlebars
template (.hbs.slim
) and then use helpers likeimage_path
to properly refer to images handled by the Rails' assets pipeline.I tried adding the Ember app folder to the
precompile
list, but there are two problems:ember-cli-rails
will runember-cli
before Sprockets, so it doesn't really make sense to do so, without hacking it further.The
README
also doesn't make it clear what is the suggested approach for handling assets. Given thatember-cli
offers its own assets pipeline solution, should it be used instead of Rails'?For instance, with Angular, I made the decision to make Rails the "owner" of the app, and package the angular app within the Rails app (I think that's what
ember-rails
does, btw). I used this gem https://github.com/pitr/angular-rails-templates, and I could then useSlim
templates which would then be converted to plain HTML through Sprockets. Very convenient and worked great. However, it looks likeember-cli-rails
doesn't offer a way, by default, to precompile templates using the Rails pipeline, not even fromEmblemJS
(you can however, just use ember-cli with EmblemJS, but then, what's the point of usingember-cli-rails
?)What also added to my confusion was this post from the
ember-cli-rails
author, here :#30, quoting him:But how am I supposed to use the Rails assets pipeline with
ember-cli
?The only benefit I see from using it is a portion of the Rails app is completely static or made with a different framework, and part of it is Ember, but the whole Ember app(s) has its assets completely handled by
ember-cli
. The additional benefit is to have the deployment handled by the Rails assets pipeline (namely copying the compiled ember-cli files to public/assets and fingerprinting them).However, for a greenfield app, if one wants to go the
ember-cli
way, then I get the feeling it's much better to just treat Rails as an API and not attempt to integrateember-cli
with Rails, as it looks like it doesn't really make much sense because of the fact ember-cli duplicates a lot of functionality that Rails provides and sometimes they even conflict and don't play well together. Am I right?If someone could enlighten me, I'd be very grateful!
The text was updated successfully, but these errors were encountered: