SlideShare une entreprise Scribd logo
1  sur  45
1   © 2011 Hewlett-Packard Development Company, L.P.
The JavaScript
                                       Behind HP webOS:
                                        Enyo and Node.js
Ben Combee,
API Czar & Developer Advocate
Frameworks Team, webOS Software Group




2   © 2011 Hewlett-Packard Development Company, L.P.
$99
                                                       16GB




3   © 2011 Hewlett-Packard Development Company, L.P.
$149
                                                       32GB




4   © 2011 Hewlett-Packard Development Company, L.P.
$250
                                                       eBay
                                                       L@@K!
                                                       LIMITED
                                                       EDITION

5   © 2011 Hewlett-Packard Development Company, L.P.
6   © 2011 Hewlett-Packard Development Company, L.P.
HP webOS Architecture

                                                             webOS Service Bus

                                                                                         JS Service
        Web App                                        “Hybrid” App       Compiled App
                                                                                                       Built-in
                                                                                          Node.js     webOS
                                                                                          Service     Services
          Web App Runtime                                             Compiled App
                                                                                          Runtime
           (WebKit + v8)                                                Runtime


                                             UI System Manager                            Activity Manager


                                                       Low-level OS Components (Linux)



7   © 2011 Hewlett-Packard Development Company, L.P.
8   © 2011 Hewlett-Packard Development Company, L.P.
Why Should I Care?

“…webOS, the OS itself, is an incredibly efficient Web-oriented
  operating system. But sitting on top of webOS is even more important,
  and that’s the development environment called Enyo …. It is the
  leading Web app development environment today. We can deploy
  Web applications on webOS. We can deploy on top of Android, iOS, or
  Windows. So what this gives the development community is a
  common platform for which they can develop applications and deploy
  them on the operating system of choice”
                   -- Shane Robison
                      Exec VP and Chief Strategy and Technology Officer, HP

(http://www.crn.com/news/applications-os/231601470/hp-committed-to-webos-as-enterprise-development-platform.htm)




9   © 2011 Hewlett-Packard Development Company, L.P.
                                                                                                       9
Enyo Applications




10   © 2011 Hewlett-Packard Development Company, L.P.
                                                        10
Enyo Applications




11   © 2011 Hewlett-Packard Development Company, L.P.
                                                        11
Enyo Applications




12   © 2011 Hewlett-Packard Development Company, L.P.
                                                        12
Enyo Applications




13   © 2011 Hewlett-Packard Development Company, L.P.
                                                        13
Enyo Applications




14   © 2011 Hewlett-Packard Development Company, L.P.
                                                        14
Enyo Applications




15   © 2011 Hewlett-Packard Development Company, L.P.
                                                        15
Enyo Applications




16   © 2011 Hewlett-Packard Development Company, L.P.
                                                        16
Enyo Applications




17   © 2011 Hewlett-Packard Development Company, L.P.
                                                        17
Enyo Applications




18   © 2011 Hewlett-Packard Development Company, L.P.
                                                        18
Target Application Developers




19   © 2011 Hewlett-Packard Development Company, L.P.
Code Reuse Through Components




                                                        http://www.flickr.com/photos/hugosimmelink/1506521934
20   © 2011 Hewlett-Packard Development Company, L.P.
Prefer JavaScript Over HTML




{ “js” } > <html>

21   © 2011 Hewlett-Packard Development Company, L.P.
Support Flexible Layouts




     HFlexBox                                           VFlexBox   Absolute   Nested



22   © 2011 Hewlett-Packard Development Company, L.P.
Interoperate with GUI Tools like Ares




23   © 2011 Hewlett-Packard Development Company, L.P.
Anatomy of an Enyo App




24   © 2011 Hewlett-Packard Development Company, L.P.
                                                        24
Anatomy of a Enyo Application
– appinfo.json
     •   Standard webOS application metadata, not needed for use in browser

– index.html
     •   Initial page loaded by system manager, pulls in enyo framework and creates app
         object

– depends.js
     •   Loaded by enyo.js, JS code to declare what other files are needed for your app

– app.js
     •   Main application object

– app.css
     •   Any styles needed specifically for your application




25   © 2011 Hewlett-Packard Development Company, L.P.
appinfo.json
{ "id": "com.palmdts.enyo.helloworld“,
   "version": "1.0.0",
   "vendor": "HP“,
   "type": "web“,
   "main": "index.html“,
   "title": "Enyo HelloWorld“,
   "icon": "icon.png“,
   "uiRevision": 2 }




26   © 2011 Hewlett-Packard Development Company, L.P.
app.js
enyo.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.html
– Kinds can own other objects in a complex hierarchy of controls and
  events




27   © 2011 Hewlett-Packard Development Company, L.P.
Example of Application Structure
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},
……




28   © 2011 Hewlett-Packard Development Company, L.P.
index.html
<!doctype html>
 <html><head>
   <title>enyo HelloWorld</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




29   © 2011 Hewlett-Packard Development Company, L.P.
Kinds and Inheritance
– Each kind has a parent kind
– When overridding a method from parent, can call
  this.inherited(arguments) to call parent’s implementation
– enyo.Object is base of the tree
– set/get/changed methods created for each property
– enyo.Component is base of all items that go into app tree
– Components can own a nested collection of objects
– Components have a “$” hash of all owned objects by name, e.g.
  this.$.button.setEnabled(true)




30   © 2011 Hewlett-Packard Development Company, L.P.
Lots of APIs
– Object Oriented Programming & Components
– DOM Utilities & User Interface Generation
– Buttons & Input Controls
– Dialogs, Popups, and Toasters
– Lists and Repeaters
– Web Services and Databases
– Globalization
– webOS Platform Support



31   © 2011 Hewlett-Packard Development Company, L.P.
32   © 2011 Hewlett-Packard Development Company, L.P.
We’re Still Hard at Work

– Improving webOS for TouchPad software updates
– Making Enyo work better on iOS and Android
– Supporting Enyo as great app environment for the desktop browser
– Building World-class developer tools with Ares 2




33   © 2011 Hewlett-Packard Development Company, L.P.
                                                        33
34   © 2011 Hewlett-Packard Development Company, L.P.
Node.js and System Services




35   © 2011 Hewlett-Packard Development Company, L.P.
HP webOS Architecture

                                                              webOS Service Bus

                                                                                          JS Service
         Web App                                        “Hybrid” App       Compiled App
                                                                                                        Built-in
                                                                                           Node.js     webOS
                                                                                           Service     Services
           Web App Runtime                                             Compiled App
                                                                                           Runtime
            (WebKit + v8)                                                Runtime


                                              UI System Manager                            Activity Manager


                                                        Low-level OS Components (Linux)



36   © 2011 Hewlett-Packard Development Company, L.P.
webOS as a Mobile Browser OS

– webOS device is a combination browser, server, and cache
– Apps run in cards (think tabs in your desktop browser)
– Secret to effective multitasking!
– Apps can talk to system services, application services, or outside web
  servers
– Local services use Palm system bus for instead of HTTP




37   © 2011 Hewlett-Packard Development Company, L.P.
                                                        37
webOS Service Bus

– Only exposed on the device
– Point to point connections
– Named services using palm:// URL format
– JSON required for data transport
– Subscription support for getting status updates
– Built-in security and application authentication
– Can be used for both web and PDK applications




38   © 2011 Hewlett-Packard Development Company, L.P.
                                                        38
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 buses
– URL-based targets, JSON-based payloads
– Can get one or many responses
– luna-send is the services equivalent of “curl”




39   © 2011 Hewlett-Packard Development Company, L.P.
                                                        39
Why Write a Service?

– Run code without showing a card user interface
– Process lots of data without blocking the UI
– Full access to the USB file system
– Cache data from web services for use when offline
– Integration with HP Synergy to provision contacts, calendar, email,
  messaging, and media sharing




40   © 2011 Hewlett-Packard Development Company, L.P.
                                                        40
Implementing Your Own Services

– Node.js 0.2.3 used as service execution engine
– node 0.4.11 coming in next webOS update
– services.json file maps service IDs to JavaScript constructors
– Services can use node.js built-in methods or webOS-specific
  Foundation classes
– Service calls use a futures-based framework to manage request &
  responses
– Services shut down when inactive to save power & memory




41   © 2011 Hewlett-Packard Development Company, L.P.
                                                        41
Fortune Cookie Demo!




42   © 2011 Hewlett-Packard Development Company, L.P.
developer.hpwebos.com

                                            pdc@palm.com


43   © 2011 Hewlett-Packard Development Company, L.P.
@webOSzombie

                                                        MOAR TOUCHPADS BEING
                                                        MADE!!!!!!!!! WEBOS ZOMBIE IS
                                                        UNSTOPPABLE AAAHHH!!!

                                                        NOTHING SAYS "DEAD
                                                        PLATFORM" QUITE LIKE
                                                        PEOPLE LINING UP TO BUY IT




44   © 2011 Hewlett-Packard Development Company, L.P.
45   © 2011 Hewlett-Packard Development Company, L.P.

Contenu connexe

Tendances

Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Sergii Shymko
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGapMihai Corlan
 
RIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdgRIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdgZiyad Bazed
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularMark Leusink
 
Modern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.jsModern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.jsJonas Bandi
 
Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with FlexConFoo
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkitPaul Jensen
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and moreYan Shi
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Jonas Bandi
 
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...Daniel Meixner
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconAntonio Peric-Mazar
 
Using API platform to build ticketing system (translations, time zones, ...) ...
Using API platform to build ticketing system (translations, time zones, ...) ...Using API platform to build ticketing system (translations, time zones, ...) ...
Using API platform to build ticketing system (translations, time zones, ...) ...Antonio Peric-Mazar
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabiFour Technolab Pvt. Ltd.
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studiobryan costanich
 

Tendances (19)

Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2Composer for Magento 1.x and Magento 2
Composer for Magento 1.x and Magento 2
 
PHP on Windows
PHP on WindowsPHP on Windows
PHP on Windows
 
Getting started with PhoneGap
Getting started with PhoneGapGetting started with PhoneGap
Getting started with PhoneGap
 
BlackBerry WebWorks
BlackBerry WebWorksBlackBerry WebWorks
BlackBerry WebWorks
 
RIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdgRIM Casual Meetup - Bandung #DevIDBdg
RIM Casual Meetup - Bandung #DevIDBdg
 
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and AngularEscaping the yellow bubble - rewriting Domino using MongoDb and Angular
Escaping the yellow bubble - rewriting Domino using MongoDb and Angular
 
Modern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.jsModern JavaScript Frameworks: Angular, React & Vue.js
Modern JavaScript Frameworks: Angular, React & Vue.js
 
Develop mobile applications with Flex
Develop mobile applications with FlexDevelop mobile applications with Flex
Develop mobile applications with Flex
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
REST easy with API Platform
REST easy with API PlatformREST easy with API Platform
REST easy with API Platform
 
Web Apps and more
Web Apps and moreWeb Apps and more
Web Apps and more
 
Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!Frontend Monoliths: Run if you can!
Frontend Monoliths: Run if you can!
 
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...
DotNet Cologne 2015 - Windows 10 AppDev, Teil1: App Developer Basics- (Daniel...
 
Using API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonyconUsing API Platform to build ticketing system #symfonycon
Using API Platform to build ticketing system #symfonycon
 
Using API platform to build ticketing system (translations, time zones, ...) ...
Using API platform to build ticketing system (translations, time zones, ...) ...Using API platform to build ticketing system (translations, time zones, ...) ...
Using API platform to build ticketing system (translations, time zones, ...) ...
 
ASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour TechnolabASP Dot Net Software Development in India - iFour Technolab
ASP Dot Net Software Development in India - iFour Technolab
 
Cross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual StudioCross-Platform Mobile Development in Visual Studio
Cross-Platform Mobile Development in Visual Studio
 
Transforming the web into a real application platform
Transforming the web into a real application platformTransforming the web into a real application platform
Transforming the web into a real application platform
 
HTML5 WebWorks
HTML5 WebWorksHTML5 WebWorks
HTML5 WebWorks
 

Similaire à CapitolJS: Enyo, Node.js, & the State of webOS

Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile developmentMichael Chaize
 
Developing mobile applications for i using open source tools Venna 2012
Developing mobile applications for i using open source tools  Venna 2012Developing mobile applications for i using open source tools  Venna 2012
Developing mobile applications for i using open source tools Venna 2012COMMON Europe
 
Building Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGapBuilding Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGapSimon MacDonald
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupSanjay Patel
 
Android Development with Flash Platform
Android Development with Flash PlatformAndroid Development with Flash Platform
Android Development with Flash PlatformMihai Corlan
 
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...Laura Miller
 
App developer as a Web developer (ROROSyd - Jul 15)
App developer as a Web developer (ROROSyd - Jul 15)App developer as a Web developer (ROROSyd - Jul 15)
App developer as a Web developer (ROROSyd - Jul 15)Sameera Gayan
 
Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2Vinh Nguyen
 
Web development meetingup
Web development meetingupWeb development meetingup
Web development meetingupPiTechnologies
 
Ionic vs flutter best platform for hybrid app development
Ionic vs flutter  best platform for hybrid app developmentIonic vs flutter  best platform for hybrid app development
Ionic vs flutter best platform for hybrid app developmentMarkovate
 
Html5 overview
Html5 overviewHtml5 overview
Html5 overviewappbackr
 
Native script vs react native for native app development in 2022
Native script vs react native for native app development in 2022Native script vs react native for native app development in 2022
Native script vs react native for native app development in 2022Katy Slemon
 
Adobe flex at jax london 2011
Adobe flex at  jax london 2011Adobe flex at  jax london 2011
Adobe flex at jax london 2011Michael Chaize
 
Forrester reviews the KonyOne platform
Forrester reviews the KonyOne platformForrester reviews the KonyOne platform
Forrester reviews the KonyOne platformKony, Inc.
 
Integrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterIntegrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterBrian Huff
 

Similaire à CapitolJS: Enyo, Node.js, & the State of webOS (20)

Flex 4.5 and mobile development
Flex 4.5 and mobile developmentFlex 4.5 and mobile development
Flex 4.5 and mobile development
 
Developing mobile applications for i using open source tools Venna 2012
Developing mobile applications for i using open source tools  Venna 2012Developing mobile applications for i using open source tools  Venna 2012
Developing mobile applications for i using open source tools Venna 2012
 
Building Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGapBuilding Native Mobile Applications with PhoneGap
Building Native Mobile Applications with PhoneGap
 
Hybrid Mobile Apps - Meetup
Hybrid Mobile Apps - MeetupHybrid Mobile Apps - Meetup
Hybrid Mobile Apps - Meetup
 
Android Development with Flash Platform
Android Development with Flash PlatformAndroid Development with Flash Platform
Android Development with Flash Platform
 
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
IONIC VS. REACT NATIVE – WHICH FRAMEWORK IS BETTER FOR CROSS-PLATFORM MOBILE ...
 
Hybridapp
HybridappHybridapp
Hybridapp
 
Montpellier - Flex UG
Montpellier - Flex UGMontpellier - Flex UG
Montpellier - Flex UG
 
App developer as a Web developer (ROROSyd - Jul 15)
App developer as a Web developer (ROROSyd - Jul 15)App developer as a Web developer (ROROSyd - Jul 15)
App developer as a Web developer (ROROSyd - Jul 15)
 
Worklight technical intro v2
Worklight technical intro v2Worklight technical intro v2
Worklight technical intro v2
 
Web development meetingup
Web development meetingupWeb development meetingup
Web development meetingup
 
Mobile Web Apps
Mobile Web AppsMobile Web Apps
Mobile Web Apps
 
Ionic vs flutter best platform for hybrid app development
Ionic vs flutter  best platform for hybrid app developmentIonic vs flutter  best platform for hybrid app development
Ionic vs flutter best platform for hybrid app development
 
webinos whitepaper
webinos whitepaperwebinos whitepaper
webinos whitepaper
 
Html5 overview
Html5 overviewHtml5 overview
Html5 overview
 
Native script vs react native for native app development in 2022
Native script vs react native for native app development in 2022Native script vs react native for native app development in 2022
Native script vs react native for native app development in 2022
 
Adobe flex at jax london 2011
Adobe flex at  jax london 2011Adobe flex at  jax london 2011
Adobe flex at jax london 2011
 
Project Zero Php Quebec
Project Zero Php QuebecProject Zero Php Quebec
Project Zero Php Quebec
 
Forrester reviews the KonyOne platform
Forrester reviews the KonyOne platformForrester reviews the KonyOne platform
Forrester reviews the KonyOne platform
 
Integrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenterIntegrating ADF Mobile with WebCenter
Integrating ADF Mobile with WebCenter
 

Dernier

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Dernier (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

CapitolJS: Enyo, Node.js, & the State of webOS

  • 1. 1 © 2011 Hewlett-Packard Development Company, L.P.
  • 2. The JavaScript Behind HP webOS: Enyo and Node.js Ben Combee, API Czar & Developer Advocate Frameworks Team, webOS Software Group 2 © 2011 Hewlett-Packard Development Company, L.P.
  • 3. $99 16GB 3 © 2011 Hewlett-Packard Development Company, L.P.
  • 4. $149 32GB 4 © 2011 Hewlett-Packard Development Company, L.P.
  • 5. $250 eBay L@@K! LIMITED EDITION 5 © 2011 Hewlett-Packard Development Company, L.P.
  • 6. 6 © 2011 Hewlett-Packard Development Company, L.P.
  • 7. HP webOS Architecture webOS Service Bus JS Service Web App “Hybrid” App Compiled App Built-in Node.js webOS Service Services Web App Runtime Compiled App Runtime (WebKit + v8) Runtime UI System Manager Activity Manager Low-level OS Components (Linux) 7 © 2011 Hewlett-Packard Development Company, L.P.
  • 8. 8 © 2011 Hewlett-Packard Development Company, L.P.
  • 9. Why Should I Care? “…webOS, the OS itself, is an incredibly efficient Web-oriented operating system. But sitting on top of webOS is even more important, and that’s the development environment called Enyo …. It is the leading Web app development environment today. We can deploy Web applications on webOS. We can deploy on top of Android, iOS, or Windows. So what this gives the development community is a common platform for which they can develop applications and deploy them on the operating system of choice” -- Shane Robison Exec VP and Chief Strategy and Technology Officer, HP (http://www.crn.com/news/applications-os/231601470/hp-committed-to-webos-as-enterprise-development-platform.htm) 9 © 2011 Hewlett-Packard Development Company, L.P. 9
  • 10. Enyo Applications 10 © 2011 Hewlett-Packard Development Company, L.P. 10
  • 11. Enyo Applications 11 © 2011 Hewlett-Packard Development Company, L.P. 11
  • 12. Enyo Applications 12 © 2011 Hewlett-Packard Development Company, L.P. 12
  • 13. Enyo Applications 13 © 2011 Hewlett-Packard Development Company, L.P. 13
  • 14. Enyo Applications 14 © 2011 Hewlett-Packard Development Company, L.P. 14
  • 15. Enyo Applications 15 © 2011 Hewlett-Packard Development Company, L.P. 15
  • 16. Enyo Applications 16 © 2011 Hewlett-Packard Development Company, L.P. 16
  • 17. Enyo Applications 17 © 2011 Hewlett-Packard Development Company, L.P. 17
  • 18. Enyo Applications 18 © 2011 Hewlett-Packard Development Company, L.P. 18
  • 19. Target Application Developers 19 © 2011 Hewlett-Packard Development Company, L.P.
  • 20. Code Reuse Through Components http://www.flickr.com/photos/hugosimmelink/1506521934 20 © 2011 Hewlett-Packard Development Company, L.P.
  • 21. Prefer JavaScript Over HTML { “js” } > <html> 21 © 2011 Hewlett-Packard Development Company, L.P.
  • 22. Support Flexible Layouts HFlexBox VFlexBox Absolute Nested 22 © 2011 Hewlett-Packard Development Company, L.P.
  • 23. Interoperate with GUI Tools like Ares 23 © 2011 Hewlett-Packard Development Company, L.P.
  • 24. Anatomy of an Enyo App 24 © 2011 Hewlett-Packard Development Company, L.P. 24
  • 25. Anatomy of a Enyo Application – appinfo.json • Standard webOS application metadata, not needed for use in browser – index.html • Initial page loaded by system manager, pulls in enyo framework and creates app object – depends.js • Loaded by enyo.js, JS code to declare what other files are needed for your app – app.js • Main application object – app.css • Any styles needed specifically for your application 25 © 2011 Hewlett-Packard Development Company, L.P.
  • 26. appinfo.json { "id": "com.palmdts.enyo.helloworld“, "version": "1.0.0", "vendor": "HP“, "type": "web“, "main": "index.html“, "title": "Enyo HelloWorld“, "icon": "icon.png“, "uiRevision": 2 } 26 © 2011 Hewlett-Packard Development Company, L.P.
  • 27. app.js enyo.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.html – Kinds can own other objects in a complex hierarchy of controls and events 27 © 2011 Hewlett-Packard Development Company, L.P.
  • 28. Example of Application Structure 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}, …… 28 © 2011 Hewlett-Packard Development Company, L.P.
  • 29. index.html <!doctype html> <html><head> <title>enyo HelloWorld</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 29 © 2011 Hewlett-Packard Development Company, L.P.
  • 30. Kinds and Inheritance – Each kind has a parent kind – When overridding a method from parent, can call this.inherited(arguments) to call parent’s implementation – enyo.Object is base of the tree – set/get/changed methods created for each property – enyo.Component is base of all items that go into app tree – Components can own a nested collection of objects – Components have a “$” hash of all owned objects by name, e.g. this.$.button.setEnabled(true) 30 © 2011 Hewlett-Packard Development Company, L.P.
  • 31. Lots of APIs – Object Oriented Programming & Components – DOM Utilities & User Interface Generation – Buttons & Input Controls – Dialogs, Popups, and Toasters – Lists and Repeaters – Web Services and Databases – Globalization – webOS Platform Support 31 © 2011 Hewlett-Packard Development Company, L.P.
  • 32. 32 © 2011 Hewlett-Packard Development Company, L.P.
  • 33. We’re Still Hard at Work – Improving webOS for TouchPad software updates – Making Enyo work better on iOS and Android – Supporting Enyo as great app environment for the desktop browser – Building World-class developer tools with Ares 2 33 © 2011 Hewlett-Packard Development Company, L.P. 33
  • 34. 34 © 2011 Hewlett-Packard Development Company, L.P.
  • 35. Node.js and System Services 35 © 2011 Hewlett-Packard Development Company, L.P.
  • 36. HP webOS Architecture webOS Service Bus JS Service Web App “Hybrid” App Compiled App Built-in Node.js webOS Service Services Web App Runtime Compiled App Runtime (WebKit + v8) Runtime UI System Manager Activity Manager Low-level OS Components (Linux) 36 © 2011 Hewlett-Packard Development Company, L.P.
  • 37. webOS as a Mobile Browser OS – webOS device is a combination browser, server, and cache – Apps run in cards (think tabs in your desktop browser) – Secret to effective multitasking! – Apps can talk to system services, application services, or outside web servers – Local services use Palm system bus for instead of HTTP 37 © 2011 Hewlett-Packard Development Company, L.P. 37
  • 38. webOS Service Bus – Only exposed on the device – Point to point connections – Named services using palm:// URL format – JSON required for data transport – Subscription support for getting status updates – Built-in security and application authentication – Can be used for both web and PDK applications 38 © 2011 Hewlett-Packard Development Company, L.P. 38
  • 39. 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 buses – URL-based targets, JSON-based payloads – Can get one or many responses – luna-send is the services equivalent of “curl” 39 © 2011 Hewlett-Packard Development Company, L.P. 39
  • 40. Why Write a Service? – Run code without showing a card user interface – Process lots of data without blocking the UI – Full access to the USB file system – Cache data from web services for use when offline – Integration with HP Synergy to provision contacts, calendar, email, messaging, and media sharing 40 © 2011 Hewlett-Packard Development Company, L.P. 40
  • 41. Implementing Your Own Services – Node.js 0.2.3 used as service execution engine – node 0.4.11 coming in next webOS update – services.json file maps service IDs to JavaScript constructors – Services can use node.js built-in methods or webOS-specific Foundation classes – Service calls use a futures-based framework to manage request & responses – Services shut down when inactive to save power & memory 41 © 2011 Hewlett-Packard Development Company, L.P. 41
  • 42. Fortune Cookie Demo! 42 © 2011 Hewlett-Packard Development Company, L.P.
  • 43. developer.hpwebos.com pdc@palm.com 43 © 2011 Hewlett-Packard Development Company, L.P.
  • 44. @webOSzombie MOAR TOUCHPADS BEING MADE!!!!!!!!! WEBOS ZOMBIE IS UNSTOPPABLE AAAHHH!!! NOTHING SAYS "DEAD PLATFORM" QUITE LIKE PEOPLE LINING UP TO BUY IT 44 © 2011 Hewlett-Packard Development Company, L.P.
  • 45. 45 © 2011 Hewlett-Packard Development Company, L.P.