SlideShare a Scribd company logo
JavaScript on HP webOS: Enyo and Node.js
The JavaScriptBehind HP webOS:Enyo and Node.jsBen CombeeSr. Developer Relations EngineerFrameworks Team, Palm GBU
JavaScript on HP webOS: Enyo and Node.js
http://j.mp/winHPVeerSign up by noon to win a HP Veer phone
webOS Service BusJS ServiceCompiled App“Hybrid” AppWeb AppBuilt-in webOS ServicesNode.js Service RuntimeWeb App Runtime (WebKit + v8)Compiled App RuntimeActivity ManagerUI System ManagerLow-level OS Components (Linux)HP webOS Architecture
The Philosophy of Enyo
Target Application Developers
Enyo Applications8
Enyo Applications9
Enyo Applications10
Enyo Applications11
Code Reuse Through Componentshttp://www.flickr.com/photos/hugosimmelink/1506521934
Interoperate with GUI Tools like Ares
Prefer JavaScript Over HTML{ “js” }><html>
HFlexBoxVFlexBoxAbsoluteNestedSupport Flexible Layouts
Support Device and Desktop
Anatomy of an Enyo App17
Anatomy of a Enyo Applicationappinfo.jsonStandard webOS application metadata, not needed for use in browserindex.htmlInitial page loaded by system manager, pulls in enyo framework and creates app objectdepends.jsLoaded by enyo.js, JS code to declare what other files are needed for your appapp.jsMain application objectapp.cssAny styles needed specifically for your application
appinfo.json{ "id": "com.palmdts.enyo.helloworld“,  "version": "1.0.0",  "vendor": "HP“,  "type": "web“,  "main": "index.html“,  "title": "EnyoHelloWorld“,  "icon": "icon.png“,  "uiRevision": 2 }
app.jsenyo.kind({  name: "enyo.Canon.HelloWorld",  kind: enyo.Control,content: "Hello World!"});This declares a new constructor “HelloWorld”, defined as a property of the enyo.Canon object.Your app is it’s own kind, and it gets rendered into your document body by script in your index.htmlKinds can own other objects in a complex hierarchy of controls and events
components: [  {kind: "AppMenu", components: [    {caption: "Show on One Page", onclick: "showOnePage"}]},{kind: "VFlexBox", width: "320px",style: "border-right: 1px solid gray;",components: [ {kind: "RadioGroup", style: "padding: 10px;",onChange: "radioGroupChange", components: [ {caption: "Packages", flex: 1},{caption: "Index", flex: 1} ]},{kind: "Pane", flex: 1, onclick: "tocClick",className: "selectable",domAttributes: {"enyo-pass-events": true}, ……Example of Application Structure
index.html<!doctype html><html><head>  <title>enyoHelloWorld</title>  <script src=“../0.10/framework/enyo.js”></script></head><body>  <script type="text/javascript">    new enyo.Canon.HelloWorld().renderInto(document.body);  </script></body></html>Can add launch=“debug” to <script> tag to load all framework source
Kinds and InheritanceEach kind has a parent kindWhen overridding a method from parent, can callthis.inherited(arguments) to call parent’s implementationenyo.Object is base of the treeset/get/changed methods created for each propertyenyo.Component is base of all items that go into app treeComponents can own a nested collection of objectsComponents have a “$” hash of all owned objects by name, e.g.this.$.button.setEnabled(true)
Lots of APIsObject Oriented Programming & ComponentsDOM Utilities & User Interface GenerationButtons & Input ControlsDialogs, Popups, and ToastersLists and RepeatersWeb Services and DatabasesGlobalizationwebOS Platform Support
Support webOS Special FeaturesWrappers for Palm System ServicesSupport for talking to application-provided node.js servicesMocking of Palm services for desktop development/testingNotifications using dashboardMultiple card/window managementIFRAME-based cross-app launchingOBJECT-based hybrid applicationsWireless Printing support
JavaScript on HP webOS: Enyo and Node.js
Node.js and System Services
webOS Service BusJS ServiceCompiled App“Hybrid” AppWeb AppBuilt-in webOS ServicesNode.js Service RuntimeWeb App Runtime (WebKit + v8)Compiled App RuntimeActivity ManagerUI System ManagerLow-level OS Components (Linux)HP webOS Architecture
webOS as a Mobile Browser OSwebOS device is a combination browser, server, and cacheApps run in cards (think tabs in your desktop browser)Secret to effective multitasking!Apps can talk to system services, application services, or outside web serversLocal services use Palm system bus for instead of HTTP29
webOS Service BusOnly exposed on the devicePoint to point connectionsNamed services using palm:// URL formatJSON required for data transportSubscription support for getting status updatesBuilt-in security and application authenticationCan be used for both web and PDK applications30
Example: Opening a URL# luna-send -P -n 1 -a com.palmdts.launcher palm://com.palm.applicationManager/open '{"target":"http://2011.texasjavascript.com/"}'{ "processId": "success", "returnValue": true }Public and private busesURL-based targets, JSON-based payloadsCan get one or many responsesluna-send is the services equivalent of “curl”31
Why Write a Service?Run code without showing a card user interfaceProcess lots of data without blocking the UIFull access to the USB file systemCache data from web services for use when offlineIntegration with HP Synergy system to extend contacts, calendar, email, messaging, and media sharing32
Implementing Your Own ServicesNode.js 0.2.3 used as service execution engineservices.json file maps service IDs to JavaScript constructorsServices can use node.js built-in methods or webOS-specific Foundation classesService calls use webOS Futures framework to manage request & responsesNo support for binary node.js extensions, but can run separate apps bundled with service using ChildProcess APIServices shut down when inactive to save power & memory33
Fortune Cookie Demo!
developer.hpwebos.compdc@palm.com
http://j.mp/winHPVeerSign up by noon to win a HP Veer phone
JavaScript on HP webOS: Enyo and Node.js

More Related Content

PDF
CapitolJS: Enyo, Node.js, & the State of webOS
PPT
Developing Applications for WebOS
PDF
JS for Mobile: The Enyo Framework (jsconf.us 2011)
PDF
Building a Next Generation Mobile Browser using Web technologies
PPTX
Html5 features: location, history and offline apps
PDF
Sencha touchonbb10 bootcamp
PDF
Sg conference multiplatform_apps_adam_stanley
PDF
Web Apps and more
CapitolJS: Enyo, Node.js, & the State of webOS
Developing Applications for WebOS
JS for Mobile: The Enyo Framework (jsconf.us 2011)
Building a Next Generation Mobile Browser using Web technologies
Html5 features: location, history and offline apps
Sencha touchonbb10 bootcamp
Sg conference multiplatform_apps_adam_stanley
Web Apps and more

What's hot (20)

PDF
Building Desktop RIAs with PHP, HTML & Javascript in AIR
PPT
Building Single Page Application (SPA) with Symfony2 and AngularJS
PPTX
HTML5 WebWorks
PDF
Getting started with PhoneGap
PPTX
Transforming the web into a real application platform
PDF
Web APIs & Apps - Mozilla
PPT
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
PDF
Modern JavaScript Frameworks: Angular, React & Vue.js
PDF
Develop mobile applications with Flex
PDF
Utiliser Webpack dans une application Symfony
PDF
Frontend Monoliths: Run if you can!
PDF
Uni Tour Germany 11.2009
PDF
Architecture of the Web browser
PDF
A Work Day Of A Web Developer
PDF
REST easy with API Platform
PDF
DEV-1430 IBM Connections Integration
PDF
Symfony Live 2018 - Développez votre frontend avec ReactJS et Symfony Webpack...
PDF
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
PDF
WebWorks Development for BlackBerry PlayBook and Smartphones
PDF
October OpenNTF Webinar - What we like about Domino/Notes 12, recommended new...
Building Desktop RIAs with PHP, HTML & Javascript in AIR
Building Single Page Application (SPA) with Symfony2 and AngularJS
HTML5 WebWorks
Getting started with PhoneGap
Transforming the web into a real application platform
Web APIs & Apps - Mozilla
Workshop: Symfony2 Intruduction: (Controller, Routing, Model)
Modern JavaScript Frameworks: Angular, React & Vue.js
Develop mobile applications with Flex
Utiliser Webpack dans une application Symfony
Frontend Monoliths: Run if you can!
Uni Tour Germany 11.2009
Architecture of the Web browser
A Work Day Of A Web Developer
REST easy with API Platform
DEV-1430 IBM Connections Integration
Symfony Live 2018 - Développez votre frontend avec ReactJS et Symfony Webpack...
"BlackBerry Webworks : Apps for The Smartphone and Tablet"
WebWorks Development for BlackBerry PlayBook and Smartphones
October OpenNTF Webinar - What we like about Domino/Notes 12, recommended new...
Ad

Similar to JavaScript on HP webOS: Enyo and Node.js (20)

KEY
webOS: The Web? We Haz It.
PPT
Palm WebOS Overview
KEY
PDF
Introduction to Node js for beginners + game project
PDF
Node.js - async for the rest of us.
PDF
What is Node.js? (ICON UK)
PPTX
Introduction to Node.js
KEY
OSCON 2011 - Node.js Tutorial
KEY
Writing robust Node.js applications
KEY
node.js: Javascript's in your backend
DOCX
Node js getting started
PDF
Всеволод Струкчинский: Node.js
KEY
Introduction to Palm's Mojo SDK
PDF
Enyo Hackathon Presentation
KEY
A language for the Internet: Why JavaScript and Node.js is right for Internet...
PDF
Developing realtime apps with Drupal and NodeJS
KEY
NodeJS
PDF
soft-shake.ch - Hands on Node.js
PDF
Introduction to Node.js: What, why and how?
KEY
Node.js
webOS: The Web? We Haz It.
Palm WebOS Overview
Introduction to Node js for beginners + game project
Node.js - async for the rest of us.
What is Node.js? (ICON UK)
Introduction to Node.js
OSCON 2011 - Node.js Tutorial
Writing robust Node.js applications
node.js: Javascript's in your backend
Node js getting started
Всеволод Струкчинский: Node.js
Introduction to Palm's Mojo SDK
Enyo Hackathon Presentation
A language for the Internet: Why JavaScript and Node.js is right for Internet...
Developing realtime apps with Drupal and NodeJS
NodeJS
soft-shake.ch - Hands on Node.js
Introduction to Node.js: What, why and how?
Node.js
Ad

Recently uploaded (20)

PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Architecture types and enterprise applications.pdf
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
Hybrid model detection and classification of lung cancer
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Web App vs Mobile App What Should You Build First.pdf
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Architecture types and enterprise applications.pdf
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Hybrid model detection and classification of lung cancer
Developing a website for English-speaking practice to English as a foreign la...
Enhancing emotion recognition model for a student engagement use case through...
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
OMC Textile Division Presentation 2021.pptx
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
A comparative study of natural language inference in Swahili using monolingua...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
Programs and apps: productivity, graphics, security and other tools
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A novel scalable deep ensemble learning framework for big data classification...
Web App vs Mobile App What Should You Build First.pdf
Final SEM Unit 1 for mit wpu at pune .pptx
Group 1 Presentation -Planning and Decision Making .pptx
1. Introduction to Computer Programming.pptx
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
Univ-Connecticut-ChatGPT-Presentaion.pdf

JavaScript on HP webOS: Enyo and Node.js

  • 2. The JavaScriptBehind HP webOS:Enyo and Node.jsBen CombeeSr. Developer Relations EngineerFrameworks Team, Palm GBU
  • 5. webOS Service BusJS ServiceCompiled App“Hybrid” AppWeb AppBuilt-in webOS ServicesNode.js Service RuntimeWeb App Runtime (WebKit + v8)Compiled App RuntimeActivity ManagerUI System ManagerLow-level OS Components (Linux)HP webOS Architecture
  • 12. Code Reuse Through Componentshttp://www.flickr.com/photos/hugosimmelink/1506521934
  • 13. Interoperate with GUI Tools like Ares
  • 14. Prefer JavaScript Over HTML{ “js” }><html>
  • 17. Anatomy of an Enyo App17
  • 18. Anatomy of a Enyo Applicationappinfo.jsonStandard webOS application metadata, not needed for use in browserindex.htmlInitial page loaded by system manager, pulls in enyo framework and creates app objectdepends.jsLoaded by enyo.js, JS code to declare what other files are needed for your appapp.jsMain application objectapp.cssAny styles needed specifically for your application
  • 19. appinfo.json{ "id": "com.palmdts.enyo.helloworld“, "version": "1.0.0", "vendor": "HP“, "type": "web“, "main": "index.html“, "title": "EnyoHelloWorld“, "icon": "icon.png“, "uiRevision": 2 }
  • 20. app.jsenyo.kind({ name: "enyo.Canon.HelloWorld", kind: enyo.Control,content: "Hello World!"});This declares a new constructor “HelloWorld”, defined as a property of the enyo.Canon object.Your app is it’s own kind, and it gets rendered into your document body by script in your index.htmlKinds can own other objects in a complex hierarchy of controls and events
  • 21. components: [ {kind: "AppMenu", components: [ {caption: "Show on One Page", onclick: "showOnePage"}]},{kind: "VFlexBox", width: "320px",style: "border-right: 1px solid gray;",components: [ {kind: "RadioGroup", style: "padding: 10px;",onChange: "radioGroupChange", components: [ {caption: "Packages", flex: 1},{caption: "Index", flex: 1} ]},{kind: "Pane", flex: 1, onclick: "tocClick",className: "selectable",domAttributes: {"enyo-pass-events": true}, ……Example of Application Structure
  • 22. index.html<!doctype html><html><head> <title>enyoHelloWorld</title> <script src=“../0.10/framework/enyo.js”></script></head><body> <script type="text/javascript"> new enyo.Canon.HelloWorld().renderInto(document.body); </script></body></html>Can add launch=“debug” to <script> tag to load all framework source
  • 23. Kinds and InheritanceEach kind has a parent kindWhen overridding a method from parent, can callthis.inherited(arguments) to call parent’s implementationenyo.Object is base of the treeset/get/changed methods created for each propertyenyo.Component is base of all items that go into app treeComponents can own a nested collection of objectsComponents have a “$” hash of all owned objects by name, e.g.this.$.button.setEnabled(true)
  • 24. Lots of APIsObject Oriented Programming & ComponentsDOM Utilities & User Interface GenerationButtons & Input ControlsDialogs, Popups, and ToastersLists and RepeatersWeb Services and DatabasesGlobalizationwebOS Platform Support
  • 25. Support webOS Special FeaturesWrappers for Palm System ServicesSupport for talking to application-provided node.js servicesMocking of Palm services for desktop development/testingNotifications using dashboardMultiple card/window managementIFRAME-based cross-app launchingOBJECT-based hybrid applicationsWireless Printing support
  • 28. webOS Service BusJS ServiceCompiled App“Hybrid” AppWeb AppBuilt-in webOS ServicesNode.js Service RuntimeWeb App Runtime (WebKit + v8)Compiled App RuntimeActivity ManagerUI System ManagerLow-level OS Components (Linux)HP webOS Architecture
  • 29. webOS as a Mobile Browser OSwebOS device is a combination browser, server, and cacheApps run in cards (think tabs in your desktop browser)Secret to effective multitasking!Apps can talk to system services, application services, or outside web serversLocal services use Palm system bus for instead of HTTP29
  • 30. webOS Service BusOnly exposed on the devicePoint to point connectionsNamed services using palm:// URL formatJSON required for data transportSubscription support for getting status updatesBuilt-in security and application authenticationCan be used for both web and PDK applications30
  • 31. Example: Opening a URL# luna-send -P -n 1 -a com.palmdts.launcher palm://com.palm.applicationManager/open '{"target":"http://2011.texasjavascript.com/"}'{ "processId": "success", "returnValue": true }Public and private busesURL-based targets, JSON-based payloadsCan get one or many responsesluna-send is the services equivalent of “curl”31
  • 32. Why Write a Service?Run code without showing a card user interfaceProcess lots of data without blocking the UIFull access to the USB file systemCache data from web services for use when offlineIntegration with HP Synergy system to extend contacts, calendar, email, messaging, and media sharing32
  • 33. Implementing Your Own ServicesNode.js 0.2.3 used as service execution engineservices.json file maps service IDs to JavaScript constructorsServices can use node.js built-in methods or webOS-specific Foundation classesService calls use webOS Futures framework to manage request & responsesNo support for binary node.js extensions, but can run separate apps bundled with service using ChildProcess APIServices shut down when inactive to save power & memory33

Editor's Notes

  • #3: 1.2 Ghz for TouchPad and 1.4 Ghz for Pre3 Pre 3’s unified shaders can render 4 full precision vec4 floating point MADDs for either vertex or fragment operations per clock, plus 4 full precision scalar operations per clock, and that TouchPad has 2x the shader performance and 2x the texl performance of Pre3.
  • #4: We have a lot of new hardware coming upWith the next few devices, we will have a variety of resolutions and aspect ratios (800x480, 1024x768, 320x400). We will also support different texture compression formats and opengl extensions.
  • #5: Developers can use Enyo to create compelling, fantastic tablet applications that can be leveraged across multiple mobile platforms, and the largest software platform of all – the web.Thank you, and now Jason will wrap things up.
  • #6: Launched in June 2009 with Palm Pre and Mojo frameworkMojo was completed quickly and optimized around the 320x480 screen with hardware keyboardMojo 2 effort started coincident with webOS 2.0Some rewrite, but mainly focused on performance
  • #14: With HP purchase, we had time to re-evaluate framework landscapeTeam led by Matt McNulty worked on Ares development toolOriginal engineers were Scott Miles, Steve Orvell, and Frankie FuWrapped Mojo in a version of the Opus.js framework to make it compatible with web-based interface builderOpus was inspired by DojoEnyo grew out of need to make Ares code faster, more flexible
  • #16: HFlexBox – lay out my child widgets horizontally, using CSS3 Flexbox[Click} VFlexBox – lay out my child widgets vertically[Click] Absolute – lay out my child widgets using absolute positioningMostly as a safety net for developers just in case – in practice rarely used for same reasons as on web – inflexible[Click] These can be nested and combined to achieve advanced layouts, which allow for tablet- and phone-friendly user interfaces from the same code base!Panels – like the email app that I first showed at the webOS Dev Day in Novmber, panels adjust automatically to fit various screen sizes, adjusting to a single-panel view which can be swiped or cross-faded on smaller screens, from a multi-panel view on large screens NEXT: FLEXIBLE SIZING
  • #17: 1.2 Ghz for TouchPad and 1.4 Ghz for Pre3 Pre 3’s unified shaders can render 4 full precision vec4 floating point MADDs for either vertex or fragment operations per clock, plus 4 full precision scalar operations per clock, and that TouchPad has 2x the shader performance and 2x the texl performance of Pre3.
  • #18: Launched in June 2009 with Palm Pre and Mojo frameworkMojo was completed quickly and optimized around the 320x480 screen with hardware keyboardMojo 2 effort started coincident with webOS 2.0Some rewrite, but mainly focused on performance
  • #36: Developers can use Enyo to create compelling, fantastic tablet applications that can be leveraged across multiple mobile platforms, and the largest software platform of all – the web.Thank you, and now Jason will wrap things up.
  • #37: Developers can use Enyo to create compelling, fantastic tablet applications that can be leveraged across multiple mobile platforms, and the largest software platform of all – the web.Thank you, and now Jason will wrap things up.