SlideShare a Scribd company logo
Real-World Windows
8 Apps in JavaScript
Domenic Denicola


• https://github.com/domenic
• https://npmjs.org/~domenic
• https://github.com/NobleJS


Things I’ve done recently:
• http://es6isnigh.com
• Promises/A+
NOOK Study 2.1
http://www.barnesandnoble.com/nookstudy
170K+ LOC
The Advanced Basics
IMPORTANT STUFF THAT’S NOT OBVIOUS
Windows vs. WinJS
Windows: shared between all app types
Mostly non-applicable stuff: Xaml, JSON, threading, …

Gems you might have to deal with:
• Windows.Graphics.Display.DisplayProperties.resolutionScale
• Windows.UI.Notifications.ToastNotificationManager.createToastNotifier
• Windows.Globalization.DateTimeFormatting.DateTimeFormatter.shortDate.format

Useful-looking namespaces:
• Windows.Devices.Sensors, Windows.Storage.Pickers,
  Windows.Networking.PushNotifications, …
Windows vs. WinJS
WinJS: JavaScript specific
Good/useful:
• WinJS.Application: application lifecycle
• WinJS.Resources: resource strings
• WinJS.UI: controls

Bad/ugly:
• WinJS.Utilities, WinJS.Fragments, WinJS.Navigation, WinJS.UI.Pages: use other libs
• WinJS.Class, WinJS.Namespace: yet another class library
• WinJS.Binding: one-way databinding, WTF!
Let’s talk about those controls
<div data-win-control="WinJS.UI.AppBar">
    <button data-win-control="WinJS.UI.AppBarCommand"
            data-win-options="{ id: 'cmd',
                                label: 'Command',
                                icon: 'placeholder' }">
    </button>
</div>
Inert until WinJS.UI.processAll is called:
•   Then they morph into fully-functioning controls
•   In particular the element gets a winControl property
Let’s talk about those controls
 The good news:
• Implemented entirely in JavaScript, HTML, and CSS!
• Takes care of so much for you
• You can avoid the inline attributes (which can only refer to global variables) by using
  WinJS.UI.setOptions(element) after calling WinJS.UI.processAll(element).
Let’s talk about those controls
The bad news:
Demo time
Cooking with Gas
WHAT REAL APPS NEED THAT STUPID DEMO APPS DON’T
It’s 2012. What do we expect?
• A module system
• A package ecosystem
• A way to stop writing raw CSS/HTML/JS
• A build process!


Introducing: WinningJS-build
It’s 2012. How do we structure apps?
• We use a MV* framework:
   •   Angular
   •   Backbone
   •   Ember
   •   Knockout
   •   …

• BUT! We need to integrate with WinJS controls
   •   This needs custom solutions
   •   WinningJS UI is one, but it’s immature and based on Knockout.
   •   Come up with your own!

• Ditch the WinJS navigation/pages/fragments. We know how to solve these problems.
It’s 2012. How do we write code?
First, we write tests.


Too bad there’s no support for running them, at all.


This problem is not solved yet. Ideas:
• Stub everything, including the DOM/WinJS.*/Windows.*, and run your tests in Node.
• Create a “hidden screen” where you can manually run your tests.
• Automate somehow.
• We need more open-source efforts:
           • Libraries to wrap overcomplicated WinJS/Windows
           • Integration into other MV* frameworks
What’s     • Sample apps

Next     • We need tooling:
           • Better scaffolding and build tools
           • Improve and extend Visual Studio…
           • … or branch out and make it work in a text editor

         • We need to solve the testing problem!


         Talk to me. Let’s build something.

More Related Content

PPTX
The Final Frontier
PPTX
How to Win Friends and Influence Standards Bodies
PDF
jQueryTO: State of jQuery March 2013
PPTX
Word press plugin development
PDF
Beginner's Guide to Frontend Development: Comparing Angular, React, Ember, an...
PPTX
The Extensible Web
PPTX
The State of Frontend
PDF
Build the mobile web you want
The Final Frontier
How to Win Friends and Influence Standards Bodies
jQueryTO: State of jQuery March 2013
Word press plugin development
Beginner's Guide to Frontend Development: Comparing Angular, React, Ember, an...
The Extensible Web
The State of Frontend
Build the mobile web you want

What's hot (20)

PPTX
Christmas Trees Made with HTML CSS and JS
PDF
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
PPTX
Untangling spring week8
PDF
[DevDay2018] Javascript on the Rise - By Trang Tran, Co-founder & Manager at ...
PPTX
Untangling spring week10
PPTX
DevDay 2018 - Blazor
PPTX
Don't Over-React - just use Vue!
PPTX
Developing advanced universal apps using html & js
PPTX
The Windows Developer User Group - Sep 2012 Meetup
PDF
jQuery Conference San Diego 2014 - Web Performance
PDF
Keeping lab notes as a software developer
PDF
Rapid Prototyping With J Query
PPTX
Untangling spring week9
PDF
Drupal Day 2011 - Features: una vita felice
PPTX
Saying goodbye to localhost - developing in the cloud with Cloud9 IDE
PPTX
Untangling7
PDF
Mongodb, Node.js and You: PART I
KEY
PDF
Flourish2011
PPTX
The Metro Developer User Group: July 2012 Meetup
Christmas Trees Made with HTML CSS and JS
The Frontend Developer Landscape Explained and the Rise of Advanced Frontend ...
Untangling spring week8
[DevDay2018] Javascript on the Rise - By Trang Tran, Co-founder & Manager at ...
Untangling spring week10
DevDay 2018 - Blazor
Don't Over-React - just use Vue!
Developing advanced universal apps using html & js
The Windows Developer User Group - Sep 2012 Meetup
jQuery Conference San Diego 2014 - Web Performance
Keeping lab notes as a software developer
Rapid Prototyping With J Query
Untangling spring week9
Drupal Day 2011 - Features: una vita felice
Saying goodbye to localhost - developing in the cloud with Cloud9 IDE
Untangling7
Mongodb, Node.js and You: PART I
Flourish2011
The Metro Developer User Group: July 2012 Meetup
Ad

Viewers also liked (17)

PPTX
ES6 is Nigh
PPTX
Creating Truly RESTful APIs
PPTX
Client-Side Packages
PPTX
JavaScript on the Desktop
PDF
JavaScript - new features in ECMAScript 6
PPTX
Async Frontiers
PDF
Boom! Promises/A+ Was Born
PDF
ES6 - Next Generation Javascript
PPTX
PPTX
Promises, Promises
PDF
ES2015 / ES6: Basics of modern Javascript
PPTX
The jsdom
PDF
The New JavaScript: ES6
PDF
ES2015 (ES6) Overview
PDF
ES6: The Awesome Parts
PPTX
The State of JavaScript (2015)
PDF
Lecture 2: ES6 / ES2015 Slide
ES6 is Nigh
Creating Truly RESTful APIs
Client-Side Packages
JavaScript on the Desktop
JavaScript - new features in ECMAScript 6
Async Frontiers
Boom! Promises/A+ Was Born
ES6 - Next Generation Javascript
Promises, Promises
ES2015 / ES6: Basics of modern Javascript
The jsdom
The New JavaScript: ES6
ES2015 (ES6) Overview
ES6: The Awesome Parts
The State of JavaScript (2015)
Lecture 2: ES6 / ES2015 Slide
Ad

Similar to Real World Windows 8 Apps in JavaScript (20)

PPT
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
PDF
Develop an app for Windows 8 using HTML5
PPTX
Windows 8 for Web Developers
PPTX
WinJS at NYC Code Camp 2012
PPTX
Going Offline with JS
PDF
Use html5 to build what you want, where you want it
PPTX
Going offline with JS (DDD Sydney)
PPTX
Windows8 metro presentationupdated
PPTX
Windows 8 javascript apps – getting it right
PPTX
JavaScript in Universal Windows Platform apps
PPTX
Windows 8 & JavaScript
PPTX
Radu vunvulea building and testing windows 8 metro style applications using ...
PDF
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
PDF
Building native Win8 apps with YUI
PDF
Win j svsphonegap-damyan-petev-mihail-mateev
PDF
Windows 8 app template feedback
PPTX
Windows 8.1 term paper
PPTX
Building html5 apps using Cordova
PDF
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
PPTX
WebSite development using WinJS
Busy Developer's Guide to Windows 8 HTML/JavaScript Apps
Develop an app for Windows 8 using HTML5
Windows 8 for Web Developers
WinJS at NYC Code Camp 2012
Going Offline with JS
Use html5 to build what you want, where you want it
Going offline with JS (DDD Sydney)
Windows8 metro presentationupdated
Windows 8 javascript apps – getting it right
JavaScript in Universal Windows Platform apps
Windows 8 & JavaScript
Radu vunvulea building and testing windows 8 metro style applications using ...
WinJS, Apache Cordova & NFC - HTML5 apps for Android and Windows Phone
Building native Win8 apps with YUI
Win j svsphonegap-damyan-petev-mihail-mateev
Windows 8 app template feedback
Windows 8.1 term paper
Building html5 apps using Cordova
Develop High Performance Windows 8 Application with HTML5 and JavaScriptHigh ...
WebSite development using WinJS

More from Domenic Denicola (8)

PPTX
ES6 in Real Life
PPTX
Streams for the Web
PPTX
After Return of the Jedi
PPTX
The State of JavaScript
PPTX
The Promised Land (in Angular)
PDF
Unit Testing for Great Justice
PDF
Understanding the Node.js Platform
PPTX
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...
ES6 in Real Life
Streams for the Web
After Return of the Jedi
The State of JavaScript
The Promised Land (in Angular)
Unit Testing for Great Justice
Understanding the Node.js Platform
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Spectroscopy.pptx food analysis technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Cloud computing and distributed systems.
PPT
Teaching material agriculture food technology
PDF
Network Security Unit 5.pdf for BCA BBA.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
Spectroscopy.pptx food analysis technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Cloud computing and distributed systems.
Teaching material agriculture food technology
Network Security Unit 5.pdf for BCA BBA.

Real World Windows 8 Apps in JavaScript

  • 2. Domenic Denicola • https://github.com/domenic • https://npmjs.org/~domenic • https://github.com/NobleJS Things I’ve done recently: • http://es6isnigh.com • Promises/A+
  • 4. The Advanced Basics IMPORTANT STUFF THAT’S NOT OBVIOUS
  • 5. Windows vs. WinJS Windows: shared between all app types Mostly non-applicable stuff: Xaml, JSON, threading, … Gems you might have to deal with: • Windows.Graphics.Display.DisplayProperties.resolutionScale • Windows.UI.Notifications.ToastNotificationManager.createToastNotifier • Windows.Globalization.DateTimeFormatting.DateTimeFormatter.shortDate.format Useful-looking namespaces: • Windows.Devices.Sensors, Windows.Storage.Pickers, Windows.Networking.PushNotifications, …
  • 6. Windows vs. WinJS WinJS: JavaScript specific Good/useful: • WinJS.Application: application lifecycle • WinJS.Resources: resource strings • WinJS.UI: controls Bad/ugly: • WinJS.Utilities, WinJS.Fragments, WinJS.Navigation, WinJS.UI.Pages: use other libs • WinJS.Class, WinJS.Namespace: yet another class library • WinJS.Binding: one-way databinding, WTF!
  • 7. Let’s talk about those controls <div data-win-control="WinJS.UI.AppBar"> <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{ id: 'cmd', label: 'Command', icon: 'placeholder' }"> </button> </div> Inert until WinJS.UI.processAll is called: • Then they morph into fully-functioning controls • In particular the element gets a winControl property
  • 8. Let’s talk about those controls The good news: • Implemented entirely in JavaScript, HTML, and CSS! • Takes care of so much for you • You can avoid the inline attributes (which can only refer to global variables) by using WinJS.UI.setOptions(element) after calling WinJS.UI.processAll(element).
  • 9. Let’s talk about those controls The bad news:
  • 11. Cooking with Gas WHAT REAL APPS NEED THAT STUPID DEMO APPS DON’T
  • 12. It’s 2012. What do we expect? • A module system • A package ecosystem • A way to stop writing raw CSS/HTML/JS • A build process! Introducing: WinningJS-build
  • 13. It’s 2012. How do we structure apps? • We use a MV* framework: • Angular • Backbone • Ember • Knockout • … • BUT! We need to integrate with WinJS controls • This needs custom solutions • WinningJS UI is one, but it’s immature and based on Knockout. • Come up with your own! • Ditch the WinJS navigation/pages/fragments. We know how to solve these problems.
  • 14. It’s 2012. How do we write code? First, we write tests. Too bad there’s no support for running them, at all. This problem is not solved yet. Ideas: • Stub everything, including the DOM/WinJS.*/Windows.*, and run your tests in Node. • Create a “hidden screen” where you can manually run your tests. • Automate somehow.
  • 15. • We need more open-source efforts: • Libraries to wrap overcomplicated WinJS/Windows • Integration into other MV* frameworks What’s • Sample apps Next • We need tooling: • Better scaffolding and build tools • Improve and extend Visual Studio… • … or branch out and make it work in a text editor • We need to solve the testing problem! Talk to me. Let’s build something.

Editor's Notes

  • #2: Hook: “Microsoft 1.0”
  • #13: https://github.com/bnedu/beretta/blob/master/package.json#L14-47https://github.com/NobleJS/WinningJS-build