r/angularjs • u/realityking89 • Oct 13 '14
[General] AngularJS 1.3 has been released
https://github.com/angular/angular.js/blob/v1.3.0/CHANGELOG.md8
3
u/rb15 Oct 13 '14
Awesome! Hope that means they'll now put more efforts on 2.0
4
u/live_love_laugh Oct 14 '14
Yes I really can't wait for that to come out. How close are they to getting a beta of 2.0? Does anybody know?
5
u/realityking89 Oct 14 '14
As far as I can tell 2.0 is still in the prototyping stage. I suspect pace is going to pick up, now that 1.3 is out of the way.
0
u/live_love_laugh Oct 14 '14
I hope so. Can't wait! What will it be you think? 6 months?
4
u/criveros Oct 14 '14
Caitlin Potter from the Angular Team said in Web Unleashed that it wouldn't be earlier than next summer. So.. 2 years is my best guess.
3
u/live_love_laugh Oct 14 '14
Too bad, patience is not my strongest trait
2
Oct 17 '14
Well, they are changing a bunch, so it should probably be well tested and stuff. Plus they don't have any idea on how to migrate your current projects (which seems very important to me).
1.3 is already a great step forward so this is already great news. 2.0 will have quite a long development i think, so don't count that it will be released any time soon. 2 years seems like a good guess
2
u/liquidpele Oct 20 '14
ouch... that's a pretty big mistake imho... projects get forgotten and replaced in time periods like that.
7
u/OverZealousCreations Oct 14 '14
I hate to be a downer, but from what I understand, AngularJS 2.0 requires ES6, which isn't even fully supported by any browsers. (In fact, it was only very recently that they froze the spec!)
Even after they roll out AngularJS 2.0, it's going be a long while before you can start using it directly, or you'll be required to use an ES6-to-ES5 compiler. These are OK, but they have some big limitations.
In all honesty, even though it is going to be a great upgrade, I don't see AngularJS 2.0 being a realistic choice for active projects in the next 6 months, probably even the next year.
2
Oct 17 '14
There's actually very little support: http://kangax.github.io/compat-table/es6/
It seems that it won't be usable for a long time as i doubt many products will have their browsers upgraded any time soon. So ES6 is gonna take a long time, which means 2.0 is pretty far away. And thus the 1.x branch is gonna stay for a while.
I like that they have a strategy for the future, but currently it can hardly be called a prototype (when a mere 5% is only working or layed out).
But what i don't like is that they won't be having any similarity towards the 1.x branch. Which makes you have to rewrite a lot of code to port it over or start from scratch. I would have to relearn a lot and i don't think that such major steps are good to take. It feels that they should separate it entirely than calling it 2.0.
1
u/jmcunningham Oct 14 '14
I you sure it requires ES6? I know it is to be written in ES6, but I assumed they would use an es6 to es5 compiler when producing the distributables. Or at least offer both an es5 and an es6 version.
1
u/OverZealousCreations Oct 14 '14 edited Oct 14 '14
OK, I remembered that wrong, they are planning on using ES6 for the source and compiling it via Traceur for the browser.
I hope they really fix Traceur up, though, because the last time I tested it (a few months ago), it was generating just god-awful code.
At the time, they were usingexception blocksto recreate block-level scoping (a.k.a.,let).(It turns out they've changed that, at least. The generated code is still awful in my opinion.) Not to mention it requires its own runtime, which is not part of Angular's core.I still expect it'll be over a year before AngularJS 2.0 should seriously be considered for non-trivial products.
Edit
I should mention that we're actually starting to use the6to5compiler in our main product right now. If you are very selective in which parts of ES6 you use, you can get clean input code with easy-to-read output, with no real overhead or extra libraries†.Most of the time 6to5's output looks like something I would have hand-coded.
I'd rather have 90% of the good parts of ES6, and acceptable output, than 99% of ES6 and horrible output.
† Except, of course, ES6 polyfills for missing functions or new classes, but these are optional and can be included or ignored on a case-by-case basis.
1
u/jmcunningham Oct 14 '14
what made you choose 6to5 over the other es6 to es5 compilers? I've been wanting to start experimenting with ES6 and maybe updating my angular seed project to ES6. But couldn't decide which compiler to use.
1
u/OverZealousCreations Oct 14 '14
You should read the GitHub Readme I linked to.
I don't see the point in peppering your code with ES6 syntax if the output is unreadable, and most of the other compilers are just that. 6to5 doesn't support everything, but not everything in ES6 can be translated to ES5 without making a mess.
Second, I don't see the need for a runtime.
Finally, it has source maps and is very easy to integrate into a gulp build process.
My goals were to improve code legibility through better syntax, rather than trying on everything that ES6 has to offer.
1
1
u/permabed Oct 14 '14
hello
as mentioned by /u/realityking89 , it's in prototyping stage and you can already take a look on various part of the futur framework :
The dependency injection : https://github.com/angular/di.js
Change detection : https://github.com/angular/watchtower.js
The router : https://github.com/angular/router
As a backend/front end dev, it's interesting to see their usage of ES6 (modules, classes...). I really hope to jump as quickly as possible to ES6 in order to have cleaner code and easier to maintain.
I'm also interested to see if it will force other browsers to support quickly those features if the framework is massively adopted. What is also interesting is that they are also using annotations (https://github.com/angular/di.js/blob/master/example/kitchen-di/dishwasher.js for example) which is not a part of ES6 last time i checked. Will they try to use angularJS 2.0 as a troyen horse to invite forcibly other actors to implements features like that? It will be a great point to see if ng 2 will keep ES6+. The client side is moving so much that it's becoming hard to predict something :p
5
u/dmackerman Oct 14 '14
Super cool. I have wonder how many of my open source modules like ui-bootstrap and angular strap are going to be broken. :)
1
u/Capaj Oct 14 '14
not so many actually. There are few breaking changes regarding to filters, but 90% of all features works the same as in 1.2.0 looking at it from POV.
1
u/YodaLoL Oct 14 '14
This is perfect. Now I just have to wait until Laravel 5.0 is released before I start my side project.
1
0
u/Xasos Oct 14 '14
How is it working out for you? I've been thinking about learning Laravel, but have stuck to Node as it interfaces well with my Angular code.
3
u/8Bytes Oct 14 '14 edited Oct 14 '14
It works out really well, I use angular front laravel back for all my projects these days (until I find time to learn django). Laravel does a lot of obnoxious things for you out of the box, like user auth, password reset, input sanitation, bcrypt pass hashing, ect. And it has a very nice SQL orm and route controller that makes designing rest APIs extremely easy.
Then using $resource I link angular to the rest api, and the project is live. I highly recommend it.
2
u/YodaLoL Oct 17 '14
I can recommend restangular over $resource.
Also, do you dev REST APIs with Laravel, do you have any tips/recommendations regarding that?
2
u/8Bytes Oct 17 '14
I've heard great thing about restangular, but I haven't run into a situation where in need it just yet, resource allows nested objects like /user/id/posts/id, which is most of my use cases.
Rest APIs are exceedingly simply in laravel. You have a routes file called routes.php. In that you define a route:
Route::resource ('user', 'UserController');This sets up around 7 routes for you, read he doc for details on what they all are. They will be routed to the code in the UserController.
Then make the UserController. There is already a User model for you to use, but for any noun other then user, you'll have to make your own.
In the UserController, use the User model to implement the SQL calls.
function index() { $users = User::all(); return Response:: json([ 'error': false, 'users': $users]); }Now you have an api call that handles an angular query request at /user.
1
u/YodaLoL Oct 17 '14
I'm familiar with Laravel, just never made a REST API with it. I've done it in Rails, which functions in almost the same way as you describe. Thanks for the answer :).
How do you auth users? Do you use HTTP Headers, cookies, something else? Is it easy to deal with actual auth in the code?
2
u/8Bytes Oct 17 '14 edited Oct 17 '14
I use http headers. The client stores their auth string as a cookie, and places it in the header of each request.
Then in laravel I simply check the header in the filter with:
Route::filter('auth.token', function($route, $request) { $payload = $request->header('X-Auth-Token'); $user = DB::table('users')->where('remember_token',$payload)->first(); if(!$payload || !$user) { $response = Response::json([ 'error' => true, 'message' => 'Not authenticated', 'code' => 401], 401 ); $response->header('Content-Type', 'application/json'); return $response; } });Then i group the routes that need auth behind:
//public routes ... Route::group(array('before' => 'auth.token'), function() { //protected routes ... });** How do you auth users in rails?
1
u/crimson117 Oct 14 '14
Where do you host a node backend website?
3
3
1
1
u/YodaLoL Oct 17 '14
I use a VPS on DigitalOcean. Really, really cheap and generally just awesome.
Also, if you're a student you can get the Github Student Pack and receive lots of free stuff, including $100 credit on DigitalOcean (20 months of free hosting with their cheapest plan).
0
Oct 17 '14
Why not use a Node backend?
2
u/YodaLoL Oct 17 '14
Portability mainly, even though I'm gonna host it on my VPS. I also prefer PHP/Python/Ruby backend over Node, atm. The asynchronousness of Node puts me off.
-10
Oct 14 '14
Skipping this update, waiting on 2.0.
6
u/Inspector-Space_Time Oct 14 '14
Why would you do that? You're going to miss some good features and will be waiting for a while.
1
u/YodaLoL Oct 14 '14
1
u/marktastic Oct 14 '14
Isn't that guy from Last Crusade? Who turned old in like 10 seconds?
Just saying that guy shouldn't be the mascot for "waiting too long"...
Your point is still valid though!
1
14
u/[deleted] Oct 14 '14
ngMessages and $async validators are the business!