News for hackers. Stuff that matters.
Re:Ember.js 2.7 and 2.8 beta released by erikrothoff on Tuesday July 26, 2016 @03:54AM (#12163993)
I remember seeing the blog post about Ember 2.0 being released around this time 1 year ago. Previously I was edging towards React and the built tools du jour. I started a new job which needed a rewritten frontend, so I went with Ember and am super happy. The CLI tools are fantastic, and coming from Rails the integrated test suite, generators and opinionated framework is such a breeze. I am super excited about what the future holds, and having a community working together on one project and goal is amazing.

Even though they don't have a huge commercial backing, a lot of medium-large companies are using Ember and improving the ecosystem. The core team are really smart people, and I am amazed at the smart stuff they build, yet how they have found a way of working to iterate so fast.

Re:Ember.js 2.7 and 2.8 beta released by orf on Tuesday July 26, 2016 @04:32AM (#12164154)
I'm in the same boat, it's one of the only tools I feel almost fanatical about sharing and spreading. It's really nice and it's a shame it doesn't get more love on HN.

The only downside is it takes a while to get your head around its object model and how to structure your apps in terms of computed properties and observers. Once that clicks though your in a nirvana of productiveness, and having toyed with the react ecosystem I've got to say that Embers learning curve is a lot nicer.

There is Glimmer 2 comming out soonish, fast boot taking off and the Ember engines RFC implemented in the next version. Things are looking good!

Re:Ember.js 2.7 and 2.8 beta released by k__ on Tuesday July 26, 2016 @06:30AM (#12164593)
> it's a shame it doesn't get more love on HN

Probably because it feels a bit like "the old way" for many. A big framework that covers all and brings its own tooling. Today, everyone uses its own stack to build. WebPack, Browserify, Rollup, tsc, Gulp, Make etc.

When I was using Ember, I used it with Gulp, Emblem, LiveScript etc.

Then they pulled this Ember-CLI stuff and some modules told me, that they depend on it. Suddendly I had to learn a new tool and tell it to do my bidding or else I couldn't use Ember add ons (painlessly).

I don't think it's a inherently bad idea, especially for a Framework as old as Ember, which reinvents itself constantly.

Re:Ember.js 2.7 and 2.8 beta released by addicted on Tuesday July 26, 2016 @01:06PM (#12167114)
Ember was around well before Ember-CLI became a thing and it still didn't get much love.

Seems to me the obvious answer is the obvious. Lack of marketing muscle that is provided by being part of a Google or a Facebook.

Re:Ember.js 2.7 and 2.8 beta released by tomdale on Tuesday July 26, 2016 @11:35AM (#12166345)
One thing that I'm really excited to start working on is aligning the Ember object model towards the new features coming in ES2016+. During the period of JavaScript-the-language stagnation, we had no choice but to add these features as runtime augmentation.

Now that the pace of evolution on TC39 and in the browsers is so much more vibrant, we can start pushing a lot of those features into the language itself.

That has two important side effects. One, it means huge swaths of code can be deleted from Ember. Two, and perhaps most importantly, it increases the chances people will already be familiar with those features once they try to pick up Ember, reducing the learning curve that much more.

Re:Ember.js 2.7 and 2.8 beta released by orf on Tuesday July 26, 2016 @12:43PM (#12166902)
> aligning the Ember object model towards the new features coming in ES2016+.

Any examples you can give? Anywhere I can read more about this?

Re:Ember.js 2.7 and 2.8 beta released by tomdale on Tuesday July 26, 2016 @12:57PM (#12167033)
For example, see Robert Jackson's addon for using decorator syntax to describe computed properties: https://github.com/rwjblue/ember-computed-decorators
Re:Ember.js 2.7 and 2.8 beta released by spion on Tuesday July 26, 2016 @06:46AM (#12164662)
How does the ember object model compare to MobX? https://mobxjs.github.io/mobx/getting-started.html

To me it looks like mobx provides all that is provided by ember models, but also adds unobtrusive syntax and automatic observable dependency tracking.

Re:Ember.js 2.7 and 2.8 beta released by staticelf on Tuesday July 26, 2016 @07:20AM (#12164791)
I really like Ember as well and uses it daily. However, if I could remake my decision I would not pick Ember today since it's too opinionated for the current project I am working on.

Our stack, as it turns out, is not really ember-friendly. For example, we need several endpoints for the same models which was a pain to get to. Also we don't use jsonapi which also is a pain if you use ember and so on.

We didn't know these things before picking the framework, but it's really opinionated which can be a good thing as long as you pick the same opinions and solutions as they do.

Developing in Ember for me means basically figuring out how to implement stuff that Ember already have out of the box since we cannot use some of that. But when we can, development is a breeze.

If anyone is thinking of using Ember for a new project, be really sure that Ember really is going to work with you and not against you.

Re:Ember.js 2.7 and 2.8 beta released by vertex-four on Tuesday July 26, 2016 @07:49AM (#12164908)
Note that Ember is not actually strongly tied to Ember Data - the model() function on a route can return any Ember promise, and you can save data however you want. If the rest of Ember is roughly what you want, implementing a custom method of getting Ember objects from API responses and vice versa is probably easier than trying to wrangle Ember Data into doing what you need.
Re:Ember.js 2.7 and 2.8 beta released by staticelf on Tuesday July 26, 2016 @08:01AM (#12164964)
We had a discussion if we should skip Ember Data or not but concluced that it seemed easier to write custom serializers and adapters for most models instead. Maybe it was an incorrect assessment but after a pretty steep learning curve I can at least say I know a lot about how ember works :)

Also, if you do not use Ember Data, you don't get to use the data part of the nice Ember plugin for web browsers.

Re:Ember.js 2.7 and 2.8 beta released by Touche on Tuesday July 26, 2016 @11:50AM (#12166451)
I don't follow your criticism then. Sounds like you have a really bizarre back-end setup and Ember provides you a low-level way to integrate it, so how is that "too opinionated"? Did you expect a high-level API that would work with this multiple endpoint setup?
Re:Ember.js 2.7 and 2.8 beta released by ehsanu1 on Tuesday July 26, 2016 @12:30PM (#12166784)
Clearly the criticism is that it was very muh harder than it had to be, due to the opinionated nature of Ember, even though it's possible. Eg, things you expect to work just not working, because some hidden convention is being violated, and requiring a bunch of hacks to make it work (making this example up btw, I haven't done any Ember).

I'm not sure I'd conclude that their backend is bizarre, sometimes things cannot be perfectly resource-oriented in a 1:1 fashion with the backend. I know I've needed to expose two different endpoints and frontend models for the same backend model, for good reasons.

Re:Ember.js 2.7 and 2.8 beta released by mnutt on Tuesday July 26, 2016 @01:24PM (#12167244)
If your data isn't resource-oriented, you are probably better off without ember-data. We started off using ember-data with an aggregated stats API and eventually found that just using regular ajax was much easier. No hacks needed, just define model() as an ajax call and don't pull in ember-data.

If you're using ember without ember-data, you don't have a "store" and ember-inspector's data-store inspector won't do anything. You'll probably end up having to look at network calls.

Ember is opinionated in plenty of ways, but I don't think reliance on ember-data is one of them.

Re:Ember.js 2.7 and 2.8 beta released by staticelf on Wednesday July 27, 2016 @03:49AM (#12171199)
This. I can say that maybe it would have been a better choice to go without Ember Data but since we started there is simply too much work to redo a lot of stuff instead of just continuing in the same path.

We didn't know ember had these conventions when we started working with it since it doesn't really advertise it and the problem first arises when you're trying to do something that feels easy but gets complicated due to Embers convention.

Re:Ember.js 2.7 and 2.8 beta released by Touche on Wednesday July 27, 2016 @11:01AM (#12173347)
> Clearly the criticism is that it was very much harder than it had to be, due to the opinionated nature of Ember, even though it's possible.

The opinion is just wrong, then. It wasn't harder because Ember is opinionated. It wouldn't have been any easier with React, which has no model layer at all.

Re:Ember.js 2.7 and 2.8 beta released by Longwelwind on Tuesday July 26, 2016 @03:56AM (#12163995)
Over-reliance on strings is a pattern that I've seen a lot in the Javascript environment. For example:

  var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
  arr.uniqBy('value');  // [{ value: 'a' }, { value: 'b' }]
Wouldn't be better to do something like this ?

  var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
  arr.uniqBy(element => element.value);  // [{ value: 'a' }, { value: 'b' }]
You have to write a little bit more (I could have used "e" instead of "element", though) but if you do a typo in the name of the property, it can be caught by a linter/compiler, and you don't get the feeling you're relying on Vodoo magic.

Are there any advantages to use a string instead of a "static" way of accessing the property ?

Re:Ember.js 2.7 and 2.8 beta released by orf on Tuesday July 26, 2016 @04:24AM (#12164116)
EmberJS uses strings as property paths. You can use 'foo.bar.firstObject.baz' as a unique key the same as any other function that takes a property paths (like a computed property). In Ember you write a lot of these so any small overhead like a lambda is a bit of a waste.

Also I don't think ember would work with functions instead of strings, the whole point of the strings is that the unique function is only called when one of the items in the property paths changes, and you can't get that from functions. You can only evaluate them.

Re:Ember.js 2.7 and 2.8 beta released by Longwelwind on Tuesday July 26, 2016 @06:51AM (#12164685)
Thanks, I didn't know that Ember did more than just fetching the value.

About time wasted, I feel like in the long run, you gain more time by writing statically analyzable code. If you make a typo in the string, you would have to build/transpile+launch the code in order to see the error. Additionaly, if you ever refactor the name of the property, the linter will directly tell you that "value" in the lambda must be changed.

Re:Ember.js 2.7 and 2.8 beta released by orf on Tuesday July 26, 2016 @08:55AM (#12165243)
I agree and one of the downsides is exactly this. I've felt this pain before :(

But there is no way around it - property keys are strings because they can be many layers deep (`foo.bar.test.abc`), and if any of those are undefined then the result is undefined. Also any of those properties (`foo`, `bar`, `test` or `abc`) could be themselves computed properties that depend on others. You also get features like `@each`, used for arrays like `[email protected]`.

Perhaps a good middleground would be to do something like C#'s LINQ stuff, where the lambdas are analysed and the values extracted.

Re:Ember.js 2.7 and 2.8 beta released by topaxi on Tuesday July 26, 2016 @04:10AM (#12164055)
The xxBy methods are just for convenience, usually you can provide your own function for each method.

Example:

    Ember.computed.map('myArray', function() {
      return foo.bar;
    })
vs.

    Ember.computed.mapBy('myArray', 'bar')
What you are asking for, would need a change to Ember.computed.uniq, allowing it to accept a custom function.
Re:Ember.js 2.7 and 2.8 beta released by pandler on Tuesday July 26, 2016 @04:28AM (#12164130)
> if you do a typo in the name of the property, it can be caught by a linter/compiler

There isn't really great linter/compiler support for ember anyways, mainly because of how you're forced to use getters and setters. In ember, your example would look like

    var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
    arr.uniqBy(element => element.get('value'));  // [{ value: 'a' }, { value: 'b' }]
The `element.get('value')` syntax makes it hard to do static analysis on your code. It's a bit of a pain point, but that design decision wasn't arbitrary and there are lengthy explanations for why they designed the framework like that.

> Are there any advantages to use a string instead of a "static" way of accessing the property ?

It's just shorthand for (what I imagine is) the most common use-case. Keep in mind that `uniqBy` is a property macro, which provide simplified apis for very specific use-cases. You always have the ability to write more complex, custom computed properties.

Re:Ember.js 2.7 and 2.8 beta released by akst on Wednesday July 27, 2016 @12:01AM (#12170450)
While I believe it would be nice to have a lambda version of this as it's a more general abstraction (and I believe there's something along those lines in ember), Ember makes a big emphasis on convention over configuration and this isn't limited to the build system but also it's runtime apis as well.

It's pretty common in ember to look up a property by string to set or get using the methods `get` and `set` on an ember object (ember has it's own object model[1]), and these property keys/strings can also express nested properties by spacing dots between nested property names. Like `user.get('organisation.name')` to get an user's organisation and the name of the organisation, this handles the situation when organisation is null, by returning null. So it's similar to `user.organisation?.name` in swift.

So for consistency sake and predictability sake ember also uses a string for this method. If we look at the implementation[2] you can see it use's a method called `guidFor`, it basically handles the whole null checking stuff, which in a lambda version would look something like

    var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
    arr.uniqBy(element => (element != null) ? element.value : null);
`guidFor`[3] also works for nested properties as well, so if you were looking for a property on `value` it would starts to get messy.

[1]: https://guides.emberjs.com/v2.1.0/object-model/

[2]: https://github.com/emberjs/ember.js/blob/45c92fb2c8931b4ca41...

[3]: https://github.com/emberjs/ember.js/blob/45c92fb2c8931b4ca41...

Re:Ember.js 2.7 and 2.8 beta released by cnlevy on Tuesday July 26, 2016 @04:22AM (#12164107)
Re:Ember.js 2.7 and 2.8 beta released by jjawssd on Tuesday July 26, 2016 @03:52AM (#12163983)
How does Ember fit into today's web ecosystem especially as it relates to React?
Re:Ember.js 2.7 and 2.8 beta released by erikrothoff on Tuesday July 26, 2016 @04:31AM (#12164144)
Ember is moving to a similar view model as React (though still having templates separated from logic) but isolated components with immutable state being passed down. React has a really vibrant ecosystems with lots of batteries to choose from, whereas Ember comes with batteries included. For example routing, test runners, controller/view logic concerns.

Ember also has an optional data package called ember-data, with the goal of being the defacto way of dealing with server side state. It's fairly opinionated, but swappable with other alternatives.

Re:Ember.js 2.7 and 2.8 beta released by nagarjun on Tuesday July 26, 2016 @07:07AM (#12164755)
I am really excited to see Engines getting some more recognition in this release. We are building https://tripcloud.io/ entirely with Ember and the application is starting to get bigger and bigger.

We have been waiting to see it stabilize a little so we can adopt it. Can we safely use it in production now?

Re:Ember.js 2.7 and 2.8 beta released by dgeb on Tuesday July 26, 2016 @02:26PM (#12167732)
Developers from several large public-facing sites have already told me that they're using engines in production. In fact, Kacey Coughlin is giving a talk tonight at the SF Ember meetup about LinkedIn's experience using engines [1]. Granted, the talk is titled "On the Bleeding Edge with Ember Engines", which fairly points out that there are some rough edges left to smooth over.

Still, I think it's a pretty good time to start exploring engines. I'd say that the feature should be quite stable by the time 2.8 stable ships. Plus, we should have a preliminary lazy-loading story finished by then, which has the potential to really impact your app's perceived performance.

[1] - http://www.meetup.com/Ember-SF/events/231368426/

Re:Ember.js 2.7 and 2.8 beta released by co_dh on Tuesday July 26, 2016 @09:18AM (#12165359)
I used Ember once, took over an Ember project from a very good Ember programmer. I found I have to duplicate the models from database, to ORM in backend, and Ember. Everytime I have to modify/add a database column, I have to modify 3 places. So I end up get ride of Ember and use Flask-Admin only. Even better, I get ride of the ORM in Flask too, using reflection. Then my code is 3 times less, and I feel happy.
Re:Ember.js 2.7 and 2.8 beta released by ben336 on Tuesday July 26, 2016 @09:33AM (#12165457)
if your project was capable of running as just a series of backend driven pages, Ember probably wasn't the right choice to start with. That isn't really what it is for.
Re:Ember.js 2.7 and 2.8 beta released by esistgut on Tuesday July 26, 2016 @08:56AM (#12165247)
Does Ember offer something similar to React Native for React or NativeScript for Angular 2?
Re:Ember.js 2.7 and 2.8 beta released by mrinterweb on Tuesday July 26, 2016 @12:23PM (#12166741)
I don't believe so. My opinion is that well optimized hybrid apps can often compete with the quality of native apps. It is not easy crafting a good hybrid app, and few good ones exist. Many of the low quality hybrid apps have given hybrid apps a bad reputation. Ember + cordova can be a good toolset for creating good hybrid apps.
Re:Ember.js 2.7 and 2.8 beta released by dbbk on Tuesday July 26, 2016 @01:00PM (#12167058)
Which one is it? "Hybrid apps can often compete", or "few good ones exist"?
Re:Ember.js 2.7 and 2.8 beta released by mrinterweb on Tuesday July 26, 2016 @07:37PM (#12169545)
LOL. I can see how that could be confusing. In theory a hybrid app could compete, if it was written well; yet, there are plenty of bad hybrid apps that give hybrid apps a bad name. I think it is a matter of effort that developers are willing to put into making a hybrid app. With a hybrid app, having good UI design is more of a challenge because they can not always leverage OS UI components, and when they try to mimic OS UI components, they never look quite right. With custom UI design, many users may never know if they are using a hybrid app or native. Obviously, hybrid apps are not an option for all types of apps, but I'd argue that hybrid is a viable option for many if not most types of apps. So long as the performance of the hybrid app is not noticeably slow to the end user, hybrid apps can be great apps.
Re:Ember.js 2.7 and 2.8 beta released by wldcordeiro on Tuesday July 26, 2016 @08:47PM (#12169797)
I saw that there is a an Ember addon to work with Electron[0], that's probably the closest thing I can think of.

[0] - https://github.com/felixrieseberg/ember-electron

Re:Ember.js 2.7 and 2.8 beta released by geekodour on Tuesday July 26, 2016 @07:21AM (#12164792)
This will be awesome
Re:Ember.js 2.7 and 2.8 beta released by jjawssd on Tuesday July 26, 2016 @03:51AM (#12163979)
Why does Ember matter?
Re:Ember.js 2.7 and 2.8 beta released by reinhardt1053 on Tuesday July 26, 2016 @04:10AM (#12164049)
The cool kids have jumped to other frameworks, but you would be surprised to know how many people are using it in production http://emberjs.com/ember-users/

That said,

if (Something is on the frontpage) { it matters for some users of the HN community. }

Re:Ember.js 2.7 and 2.8 beta released by eibrahim on Tuesday July 26, 2016 @11:25AM (#12166273)
I have been writing software for over 17 years and I did Angular for 2+ years before switching to ember. In the last 17 years, I have never been happier and more productive than I am today with ember. It does bother me that it is not as popular as it deserves.

I don't want to self promote but I am sure you can find my other posts, I am creating a web app once every 2 or 3 weeks with ember and firebase - the beauty of conventions over configurations and of opinionated frameworks.

There 50 ways to setup a react or angular project. There is ONE way to do it in ember. You can move into a new code base and know exactly where everything is. (ps: you could change the conventions if you wanted, but why would you do that!!!)

Re:Ember.js 2.7 and 2.8 beta released by awesomepeter on Tuesday July 26, 2016 @05:35AM (#12164400)
Why wouldn't it matter? It's an actively developed framework which many people really like. I'm actually baffled that it doesn't get mentioned more often.
Re:Ember.js 2.7 and 2.8 beta released by okket on Tuesday July 26, 2016 @06:40AM (#12164632)
A fair amount of posts on HN deal with the negative sides of things, so it could be a good sign that Ember does not get mentioned more often while growing >)
Re:Ember.js 2.7 and 2.8 beta released by gedy on Tuesday July 26, 2016 @10:33AM (#12165860)
It's one of the few framework options for an opinionated framework that has easy to use setup and tools for generating views, models, etc. Not every company or team has the time or interest to fiddle around with tweaking their setup and codebase for new JS UI projects.
Re:Ember.js 2.7 and 2.8 beta released by yeano on Tuesday July 26, 2016 @08:31AM (#12165120)
Yea..the biggest problem with Ember is an individuals ego,as if we care that he's a core committer on the projects he is. Gmafb
Re:Ember.js 2.7 and 2.8 beta released by machty on Tuesday July 26, 2016 @10:06AM (#12165674)
I haven't been on the core team in months
Re:Ember.js 2.7 and 2.8 beta released by briantmaurer on Tuesday July 26, 2016 @02:00PM (#12167537)
Might want to update your HN profile ;)