Archives

Sencha & ECMAScript 2015

With just a few more days to go, before the release of Ext JS 6.2, (BTW, Can’t wait! Material Design theme, pinch to zoom, D3 integration, calendar component and much more…) Sencha is already busy with working on the next major version of Ext JS.

One of the things that’s gonna be huge, is ES2015 support for Ext JS. Our goal is not to rewrite the whole framework according the new ECMAScript standard. no. ..but we want you to be able to write ES2015 code together with your Sencha framework API calls. So you can leverage the advantages of cleaner JavaScript code in your own Sencha classes and controllers.
With that comes new tooling that includes a transpiler, to make sure your code runs in all the supported browsers, and probably will also support for TypeScript, Grunt/Gulp etc. It’s all at an early stage yet, but if you have questions, (and you’re in Europe the week of the 20th of September), you will have the chance to meet the Sencha product manager and engineers at the roadshows.

I will be there as well, presenting an ECMAScript 2015 masterclass. I will cover the top 10 new features of ECMAScript 2015, and teach you what’s new through code examples.

(Are you from the USA? - I will give the presentation at SenchaCon in Las Vegas, November this year.)

But there’s much more. And unfortunately not everything fits in my Top 10 / in an 45min talk. I like to share with you some more ES2015 code snippets, which are as cool, but didn’t make it in my final presentation. Have a look, this article contains info about:

Spread Operators

Maps & Sets

For Of Loops

Generators

Rest parameters & Spread Operator

Let’s say I have a function but I don’t know how many arguments I am gonna pass into it. Maybe 1, maybe 2, or maybe 15. (Not sure if you would want that tho... but you get the idea).

The spread operator looks like this: ...n. 3 dots and a variable which holds an array. That array contains all the parameters that you passed in. The rest parameters.
Let’s have a look how we did this before ES2015 and what’s new:

You can see the ES2015 is much nicer to write. It’s better performing, and it returns a true Array, where the old fashioned JavaScript arguments just contains an object that somehow fakes to be an Array.

You can use the spread operator in combination with Arrays for example:

Keys of WeakMaps are of the type Object only. Primitive data types as keys are not allowed (So a String, Number, Boolean, null, undefined or a ES2015 Symbols can not be used as a Weakmap key.). A Map can use primitive values for keys.

For-of loop

It is the most concise, direct syntax yet for looping through array elements and it avoids all the pitfalls of for–in loops, (which you would typically use for looping over object properties).Unlike forEach(), it works with break, continue, and return.

If you want to use it in production, you will need to make use of a transpiler like Babel, who can provide you a polyfill. (https://babeljs.io)

Want to learn more about ECMAScript 2015? Join me at the roadshows: https://www.sencha.com/company/roadshow
Beside ECMAScript 2015 and TypeScript fun, there will be much to talk about: How to Test your JavaScript code, Build Data analysing apps with Ext JS 6.2, new upcoming Sencha Tools, customer cases and much more...

Some Sencha news from me!

First of all, my book "Hands-on Sencha Touch" is finally printed.
I spent a lot of time, discussing the latest Sencha Touch framework and with this book it's possible to build mobile web applications.
Checkout the table of contents at: http://shop.oreilly.com/product/0636920030058.do

If you like my writing style. I am developing ideas for writing an advanced Ext JS 5 book!

Checkout our training schedule: http://www.sencha.com/training/
I will be teaching across all over Europe the next coming months:
London, Paris, Frankfurt, Munich, Milan, Zurich, Amsterdam and of course Live Online!
Interested? Leave a comment below, and I can give your some discount promo codes!

Introducing Ext JS 5 Beta

Last week was a very important week for Sencha. We recently introduced Ext JS 5 to the public.
It's now possible to try out the beta version!

As a Sencha employee I already had early access to this framework; that gave me enough time to play around with it. ..and I have to say... I love it!

Ext JS 5, is another step closer towards Sencha Touch. It shares a lot of code with Sencha Touch it allows the same code to power both desktop and touch device experiences, with a gesture system inspired by Sencha Touch.

Tablet support

MVVM application architecture

Another very important feature of Ext JS 5 is support for a popular alternative to MVC: MVVM (standing for Model-View-ViewModel). One of the big attractions to MVVM is data binding. With data binding, you no longer have to write all of the “glue” code to connect the model layer to the view and update the model when the view is modified.

That's not all. There are lots of other cool features. I summarized a list with all the new topics: