Hey everyone. Totally new to Ember. I wanted to get started with it without ember-cli and I’m not sure which scripts I need from the builds page for both my dev environment and production and what the dependencies are. What version of jQuery do I need? Do I need Handlebars (and if so what version) or do I use ember-template-compiler, or do I have to get HTMLBars some other way? I’ve watched several tutorials but they all use Handlebars and I keep reading how HTMLBars has replaced it. Thanks!
If you can I would STRONGLY recommend you use ember-cli.
But if you must go without it you can checkout http://emberjs.jsbin.com/ It has what you need to get started.
Thanks! Didn’t know about the Ember-specific version of JSBin.
The reason I didn’t want to try ember-cli initially is because I am using a php framework (Laravel) and wasn’t sure how well the scaffolding and asset compilation stuff would integrate within Laravel’s project structure. Do I just need to spend more time with ember-cli? Does it work well if you already have a server-side framework in place? Lots of tutorials on ember-cli usually target creating a new ember app from scratch with the default scaffolding but never within the context of a server-side framework.
I had a very similar question that I asked on this thread. I encourage you to take a look at it.
It depends what level of integration you want. For instance if you want to have a mix of php and ember on one page you may want to checkout https://github.com/mitchlloyd/ember-islands. I haven’t tried it but it seems to help with that scenario. If you’re using ember as it’s own app and just want php for deploy familiarity / api then you should consider ember-cli-deploy. If that’s a bit too much for you, you could also experiment with moving your assets from the dist folder after calling ember build to your php folder. You could probably replicate what is in index.html in php and then just include the js and css files.
The app I am building has some pages that are traditional server-rendered. Then, there are other sections that will be a single page app, like the user user dashboard, account settings, etc, and this is where I’d like to use Ember. It will behave like any other single page Ember app. I just wont be run using ember server and the initial HTML payload will come from Laravel. This is why I just assumed using the standalone scripts would be easier than ember-cli. Am I wrong?
I think it maybe easier to use ember-cli and figure out how to take the output of ember build and integrating that into your existing server structure. At this point the community, addons, and learning resources are all moving towards ember-cli which will make the non ember-cli path increasingly difficult.
Personally I have 4 ember apps all served from one rails app using ember-cli-deploy.
Good point. Is your client-side a whole separate ember project and rails is just the API for those ember apps, or is it more like my scenario?
In theory I think it is like your app, but I’m guessing the proportions are different. I have 3 pages that are rails and the all the rest is ember. They don’t mix ie I just serve the index.html, I don’t use rails view stuff at all for the ember app pages.
So you have rails server and ember server running side by side?
No, I don’t use ember server at all in production, I use ember-cli-deploy. I build the assets using ember-cli then I deploy them to s3 and serve the index.html from rails via redis.
Hi! I started to google the same thing and I don’t want to make a repost on a new thread.
Is there an actual tutorial / example of ember-cli and how to work in development with PHP or any other server for example?
To be clear: I have some Apache in my localhost that serves as REST so I don’t need ember-cli acting as a server. What are the specific steps I need to do to use that.
That it’s, sorry, I’m not even interested in production deployment, I want to be able to work with the PHP server for development with ember-cli.
It’s that possible? how?
Thank you.
Ember doesn’t know or care what your back end looks like. At a minimum, you just need to be able to get an object to the model hook in your route. You can hard code it, use AJAX, SOAP, whatever. Ember Data adds the idea of caching and adapters, and the REST adapter adds some opinions about how the endpoints should be structured and how the return data should be formatted. At no point does Ember know or care how your data is stored, processed or output. I use php/mysql for some models, node/mongo for others within the same app.
On May 11, 2015, at 2:43 PM, Ariel_Lu noreply@emberjs.com wrote:
Not that I could find. I’m doing something similar, except that I’m using a different backend to implement the API used by the ember part of the app. So, roughly:
-
for now the ember stuff is experimental, hosted under /exp/ on my site
-
/exp/assets/ is rewritten to the dist/assets folder built by ember-cli
-
/exp/api/ is proxied to the new backend
-
/exp is rewritten to dist/index.html built by ember-cli
-
everything else is proxied over to the old Unicorn (Ruby on Rails) backend
The biggest pain was authentication and sharing of sessions. But it does all work seamlessly. It’s just a lot of processes to get running to get a dev sessions started: postgresql, pgbouncer, some in-house special backend processes, nginx, unicorn, elixir, ember build…
Just to clarify, Ember-cli is just a development tool which in the end helps you build and minify your application. You end up with and index.html, some js files and some css files (and maybe some images) which you can then deploy on your Laravel server. You don’t need to run ember-cli on the server, just serve the files
So after playing with ember-cli for a week, I realize how useful of a tool it is. I found a good stack overflow that shows how to move the build assets into Laravel javascript - Ember-CLI rundown using it with Laravel or other backend frameworks - Stack Overflow
(apologies for rezzing this thred)
As much as I have come to love Ember CLI I think this is a valid question that the Ember community needs to be ready to hear more of. Deploy seems to cover the case of where the Ember app is still kind of a silo served up from some random directory/route on the server.
That’s fine, but some projects will require more integration (as has been mentioned) such as the file being served by a server-side view engine with some config or initial state (as a for instance). That is not too terribly to figure out by hand, but the real problem is integrating into an existing CI setup.
A lot of our clients, for instance, use a team-city => octopus deploy pipeline which can be a bit finicky for .NET projects because you need to be able to have all the things referenced in your project file. Having some kind of grunt/gulp build process would be fine, but there’s not a good resource for how to pre-compile your templates and or still use an ember-cli like structure with ES6 modules when not using the CLI. I could live with having to manually move files into my application if I want to use an add-on (something the CLI does by ‘magically’ merging your folder structures) if it meant I could work with Ember inside the context of a Visual Studio project.