News for hackers. Stuff that matters.
Re:“Start Rails 5 development” by tinco on Saturday November 29, 2014 @06:51AM (#8673593)
Not to one-up you, just since apparently it's worth mentioning, I've been doing webdev for about 9 years, and at least from my perspective backend rendering is definitely going out the window.

I started as a Rails dev in 2008, did ASP.Net before that, and last year I've moved from Rails to a pimped up Grape, which is a framework suited more for developing API's. Maybe it's just the sort of apps I'm building (basically SaaS) but I don't see any backend rendering in my feature, if I'm building it, it's going to be either a SPA, or a static site. (I built my sisters' band a single page static site, very nice).

Latest project is using Polymer, and no Javascript framework at all. I think you're right, Angular is extremely ugly, and Ember seems to do too much. But plain Javascript has become very powerful and HTML5+CSS3 reduce the need for UI toolkits.

Maybe I'm crazy, but I don't see a super hard need for modules either, I define all dependencies at a single location, and just bind everything to window. The not binding things to window rule is only for library/component developers, if you're an app developer you should own window, make it your home and have everything as you expect it to be.

Anyway, what I'm hoping is that new Rails editions focus more on the SPA experience, they have been reluctant to. I use Grape, but I immediately pimped it out with all the niceties Rails has, including ActiveSupport and ActiveRecord, but also a console and decent logging.

What I do worry about is the amount of people embracing Node.JS over Ruby. It's crazy people would chose Javascript over any language at all in an environment they're not absolutely forced to. My fear is one day I'll be seeking a job, and all there is is shops building webapps in vanilla Javascript, wouldn't that just be a plain horror story?

Re:“Start Rails 5 development” by mattmanser on Saturday November 29, 2014 @08:09AM (#8673665)
Bind everything to window is the same as "put everything in global".

It simply is not a long term viable strategy, we've been there, we've done that, it does not work. Perhaps that's not what you mean.

Also plain javascript doesn't have observables in most browsers, and any SPA without an observable system can only reach a certain level of complexity.

TBH, what you write is still so far from reality, that plain javascript is enough, that I am a little hesitant to take your comment seriously.

Re:“Start Rails 5 development” by tinco on Saturday November 29, 2014 @08:21AM (#8673677)
To be fair, I live a bit in the future. I build apps for tech people who are running up to date browsers, and that don't face the consuming billions. On top of that, Polymer polyfills webcomponents and two-way databinding of templates.

Perhaps my apps haven't gotten big enough to see this binding in global thing fail, but I'm not sure how it would ever. You properly namespace everything right?

Re:“Start Rails 5 development” by mulander on Saturday November 29, 2014 @11:06AM (#8674070)
I recently came to a similar opinion[1] of Angular like both of you though I was evaluating AgnularDart.

I decided to stick with plain Dart mostly of the reasons you mentioned (JavaScript ecosystem feeling like a mess). Polymer does look great but feels a bit unstable (at least for Dart).

What I would really love to see is a simple front-end framework handling:

- routing

- view encapsulation

- basic animations (when views are altered/loaded)

- back-end requests - preferably swap-in-out (http, websockets)

I ended up basically doing the above by hand in plain Dart. The only part that I found ready made and working nicely so far is the routing part[2] from Angular.

[1] - http://homing-on-code.blogspot.com/2014/11/dart-one-year-lat...

[2] - https://pub.dartlang.org/packages/route_hierarchical

Re:“Start Rails 5 development” by murphm8 on Saturday November 29, 2014 @11:17AM (#8674099)
What about Backbone[1] and Marionette[2] for SPA? Do you have an opinion on those tools?

[1]http://backbonejs.org/

[2]http://marionettejs.com/

Re:“Start Rails 5 development” by PascalW on Saturday November 29, 2014 @01:09PM (#8674474)
This is what we use extensively at my work place to build cross platform mobile apps. It's very well suited for mobile apps since it's so lightweight.

We use it in combination with Cordova and some other stuff like Haml Coffee Assets and Fastclick.js.

Re:“Start Rails 5 development” by scoot on Saturday November 29, 2014 @10:19AM (#8673923)
Is this stack something you'd consider documenting? Coming from Rails, but increasingly moving towards SPAs with Rails as the API (hard to give up all the OOTB niceties), this sounds intriguing.
Re:“Start Rails 5 development” by tinco on Saturday November 29, 2014 @10:43AM (#8673998)
I definitely am going to do that as soon as we're going to start marketing the app. But at the moment the way we built it is not very repeatable, I'd love to see a project that builds out grape to be more like a standalone framework like rails is, maybe if we get time we could do that.
Re:“Start Rails 5 development” by cpursley on Friday December 05, 2014 @09:33AM (#8704656)
> I'd love to see a project that builds out grape to be more like a standalone framework like rails is

You should check out Napa by Bellycard. It takes Grape and brings it together with things we all love from Rails like ActiveRecord, Rake and generators that make for a productive framework.

https://github.com/bellycard/napa

Re:“Start Rails 5 development” by aj0strow on Saturday November 29, 2014 @05:26PM (#8675310)
I still have a lot to learn, but been off rails a few months and miss nothing -- http://www.ajostrow.me/articles/getting-over-rails
Re:“Start Rails 5 development” by scoot on Sunday December 07, 2014 @05:12PM (#8713785)
Sorry I missed your comment at the time you posted, and given the structure of HN, no sure you will see this reply, but thanks for posting that. Looks sure to make the transition smoother.
Re:“Start Rails 5 development” by jonnii on Saturday November 29, 2014 @10:23AM (#8673935)
When you say "Ember seems to do too much", can you give me an example? I'm interested in understanding why it has this reputation of being bloated.
Re:“Start Rails 5 development” by mixonic on Saturday November 29, 2014 @11:02AM (#8674057)
Ember, more strongly than any of the other solutions mentioned, pushes you to a browser application (or SPA) architecture. Usually developers who complain about bloat aren't thinking of web development in that context.

The number of challenges a framework should help a developer manage for a long-lived client-side JavaScript application is not trivial. It is absolutely true that Ember is heavier than other frameworks, but it has a specific style of development in mind. If someone chooses to build their app with an alternative, they often end up with a similar amount of code in other dependencies and application code.

And though we aren't there yet, we're working on ideas for modular loading of application code (via the pods patterns) and of Ember itself via tree shaking. This latter strategy leverages the fact that Ember's code and much app code is written in ES6, and thus we can identify and drop un-referenced code.

Re:“Start Rails 5 development” by digitalzombie on Saturday November 29, 2014 @05:12PM (#8675270)
If you ever inspect ember objects, they're huge, the properties/functions they have...

http://emberjs.com/api/classes/Ember.EachProxy.html

See the EachProxy class? Click on the class it extends.

http://emberjs.com/api/classes/Ember.Object.html

Oh look that object extends another class... apparently it uses Mixin to extend these classes maybe the apply function? If it's using prototype inheritance than looking up the prototype chain would be a performance hit IIRC.

I was doing Ember while during beta though. But during that time they were marketing Ember as smaller library and more performance than Angular.

The last bench mark I've seen, Ember library is much bigger and the performance was not that great compare to Angular...

Re:“Start Rails 5 development” by tinco on Saturday November 29, 2014 @10:40AM (#8673987)
I'm not certain if it's bloated, and if I was building a regular CRUD app I would probably have selected it over Angular. It just implemented some things I had the feeling I would do differently, i.e. I didn't want to pick a framework I would have to fight to get to work the way I wanted it to. Ember is being developed by some very smart guys so I would never dismiss it out of hand.