Microsoft's WinJS - New Cross-Platform Library
Written by Ian Elliot   
Friday, 19 September 2014

WinJS was Microsoft's JavaScript framework for the creation of "Metro" or WinRT apps. Recently it was open sourced and now, with the release of version 3.0, it has escaped the confines of WinRT to become a multi-platform framework.

 

winjs3logo

WinJS extended the basic HTML/CSS framework by making use of custom attributes and JavaScript to build new UI components and to implement databinding, promises and a number of other features.

If you were a Windows desktop programmer then its approach was both surprising and pleasing. I can't really know what sort of user base it attracted, but I suspect that most WinRT programmers chose to use either C# or C++, preferably with XAML as a markup language.

Even so, there seemed to be no reason why WinJS couldn't be modified to work in a standard HTML/CSS environment, e.g. a browser. Doing so would give it the advantage that you could create a WinRT UI and probably core code that could run in a browser as a web app.

This is exactly what has been done in WinJS 3.0. 

WinJS can now be used to create WinRT apps and web apps that will run under most desktop and mobile browsers and app environments such as Cordova. 

This is a remarkable new development and it makes WinRT and Windows Phone apps look far more attractive than they ever have. Suddenly a single framework allows you to run Windows Store apps in a browser and on a range of other mobile devices. And, given it is open source, Microsoft probably can't kill it off if it goes, from its point of view, horribly wrong. 

 

winjs3sample

 

Microsoft might well actually want this write-once run anywhere solution. Since Satya Nadella took over the company the emphasis on Azure as the universal supplier of services to anything that runs. WinJS may be the way to get Microsoft the role of the backend to any device.

Finally, the leaked information on the soon-to -be-previewed Windows 9 suggests that it can run WinRT apps on the desktop in a window. If this turns out to be true then WinJS will also provide a way to create installable web apps for Windows - something that has been missing since gadgets were removed in Windows 8. 

Overall WinJS suddenly provides a way to write an app that runs on a range of platforms that have previously been out of reach for a single code base. 

One of the nice things about WinJS is that it is well thought out and mostly well implemented. The latest version improves on the implementation by breaking the library up into modules. You now only load the modules that you actually use. This makes app creation cleaner and the WinJS framework easier to develop and extend. 

As well as all of this there are some improved universal control designs aimed at creating UIs that look identical on Phone, Tablet, PC and, I guess, the browser. 

You can also try WinJS without having to create your own project at try.buildwinjs.com.

With this one change WinJS goes from being a framework for creating apps targeting a very small market to one that does almost everything.

It is suddenly very worth considering as your universal app framework and it might even boost the profile of the WinRT app.

 winjs3logo

Banner


The Feds Want Us To Move On From C/C++
13/11/2024

The clamour for safe programming languages seems to be growing and becoming official. We have known for a while that C and C++ are dangerous languages so why has it become such an issue now and is it  [ ... ]



Looking Forward To NAO 7
03/11/2024

Introduced to the world in 2004 by its creator Bruno Maisonnier the kid-sized, autonomous humanoid robot NAO, turns 20 this year. At less than 2 ft tall, it is small in stature, but plays a big r [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 19 September 2014 )