What do you think about of using ember.js in a non-spa?

Hi, I’m new in Ember.js, i have some questions:

  1. What do you think about of using Ember.js in a non-spa?.
  2. Could I lose some functionality?.
  3. Ember.js are thinking to work this way?

Thanks!

  1. You can but there is no advantage loading Ember.js in every route.
  2. It will be harder to share data between routes.
  3. You can perhaps say that using Ember Fastboot without booting Ember on the frontend works in a non-spa way. This is not what Fastboot is intended for and I don’t think people work this way.

You can use something like WordPress on the backend and still use Ember.js on the frontend but it will still be a spa. See this site that works with WordPress and Ember: http://kerstenconstructie.com/

Yes, there have been some discussions around making it smaller and lighter. Details are still being worked out, but I may shift a few clients to it if/when it arrives, as I don’t always need full SPA functionality.

But nothing has been announced or shipped yet … :wink:

Thanks to both!

I understand it’s best to create a SPA, at least until there is news :slight_smile:

Cheers!

Ember is definitely for SPA. I think what you are thinking is having the template engine work standalone. In which case, there are plan to decouple Glimmer engine from Ember so that you can use it alone (without router, controller, or data binding)

If you don’t want a SPA there are plenty of great alternatives out there. Better to choose something else rather than waiting for a SPA framework like ember to change to meet your requirements.

There is nothing wrong with building a non-SPA using Ember. At least in the future you would have to option to convert your app to being partially client side rendered.

Relevant talk: DrupalCon New Orleans 2016: Amazing User Experiences with Drupal and Ember - YouTube

1 Like

I’d say you should just forget the word SPA. I use Ember for everything. The pipeline is wonderful and worrying about a 700k site is not something I do. No matter how simple your site is, Ember makes creating things faster and then you have all the tools available when you inevitably get more complex.

Hi @sheriffderek you have a example how use ember in this case?. Thanks!

It’s very possible that I don’t understand your questions. Can you tell me about your goal? Ember’s (htmlbars)templates are technically rendered in the single index.html, but it has a serious URL based architecture. You can enter the app from any URL and it’s not like the SPA’s of the past that may not have maintained state like this.

@sheriffderek basically how use ember.js like non-spa. An example of what you say, I see almost all the examples as SPA.

When I think about a SPA, I think about the word “Application” - and that makes me think about something that “Does” something. This is an example of a ‘website’ that does nothing but show some copy like a classic HTML document. Ember Twiddle + you can add fast-boot and then the first page will be rendered server-side

1 Like

We migrate an old server rendered monolith to SPA, but it is still a mix, one page is server rendered, other page is an Ember app. One option, you build up your own customized build tool, load javascript with Require.js or System.js, or you write your own loader. An option that you create separate Ember.js projects with ember-cli, and you can share common elements using Ember Engine… You probably don’t need Ember Data. But if your plan to migrate your server rendered monolith to a SPA (monolith), you can add Ember Data later… Use Ember if you build SPA otherwise you need only components. Ember components follows React conventions. Actually, if you don’t really need the power of Ember Router, Ember Data, ember-cli and the whole addon ecosystem, React is good choice.

@sheriffderek @zoltan Thanks for the example and explanation.

I guess the updated answer would now be - that you can use ‘Ember’ by using ‘glimmer’ to incorporate Ember-style rendered components into non-ember app situations: https://glimmerjs.com/

2 Likes