SlideShare a Scribd company logo
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Build a React App
#devnetcreate workshop
API Evangelist @CiscoDevNet
@SteveSfartz, stsfartz@cisco.com
Stève Sfartz
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• API Evangelist @CiscoDevNet - Europe
• REST & Microservices Architecture
• Cisco Spark API & Collaboration Endpoints xAPI
• hosted @CiscoROI: Paris Innovation Center
• node.js mainly, a bit of #golang
• France and all around Europe
• github: //ObjectIsAdvantag
/Cisco/DevNet/SteveSfartz
“vision without
execution is
hallucination”
stsfartz@cisco.com
@SteveSfartz
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Discover React development and Cisco Collaboration Endpoints
(CE9.2.1+) programmability.
• Throughout the workshop, you'll first learn to compute Meeting Room
Analytics from real-time events sent by Meeting Room Device’s
Camera.
• We'll then go through the code of a React App that shows a map of
DevNet Create 2018 location, and update it to display how many
developers are attending each workshop.
• Pre-requisites: you have 1 to 3 years of professional development
experienceand a laptop with a pre-configured Node.js v6+
development environment.
Build a React app
… that shows live activity at DevNet Create
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• React
• RoomKits
• xAPI
• Node.js
https://github.com/ObjectIsAdvantag/roomkit-react-map
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Pre-requisites
• Interacting with Room Series from code
• Creating a React Map
• static HTML
• static React
• injecting Data
• Live Map
Agenda
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Pre-requisites
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• https://github.com/CiscoDevNet/Create2018 - Stève Sfartz
• Check you have node v6+ installed on your laptop via node -v command,
OR install latest version of node on your machine from https://nodejs.org
• Extra command line tools: git client, npm, Firefox, postman
• Sign at https://developer.ciscospark.com with your Cisco Spark account
credentials
• Join the Space attached to the Workshop https://eurl.io/#BJC1Z--jM
Technical Requirements
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• node –v (nodejs.org), v6+, v8 preferred
• npm –v
• git -–version
• a code editor (Visual Studio Code, Atom...)
• Cisco Spark support space: https://eurl.io/#BJC1Z--jM
Pre-requites
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Interacting with Room Series
from code
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• http://cs.co/roomdevices
• Connect to RoomKitsWifi
• http://192.168.2.4/web/signin
• ssh with integrator role
> xstatus RoomAnalytics PeopleCount
• listen to events
> xfeedback register /Status/RoomAnalytics/PeopleCount
Meet a Room Kit
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• REST API (xml over http)
• https://github.com/CiscoDevNet/postman-xapi
• jsxapi
• https://github.com/ObjectIsAdvantag/xapi-samples/blob/master/jsxapi/7-
feedback-peoplecount.js
> JSXAPI_DEVICE_URL="ssh://192.168.2.4"
JSXAPI_USERNAME='integrator' JSXAPI_PASSWORD='integrator' node 7-
feedback-peoplecount.js
Run from code
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• https://github.com/ObjectIsAdvantag/roomkit-collector
• edit device.json
• Run collector
> DEBUG=api*,collector* node server.js
• Run mock version
> cd api
> node mock.js
RoomKit Collector
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Connect to the RoomKit Sandbox
Sandbox
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
A bit of React
Crash course
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
About React
https://www.kirupa.com/react/introducing_react.htm
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Since it came out in 2013, React has also steadily found its way into
popular web sites and apps that you probably use.
• Besides Facebook and Instagram, some of the notable ones include
the BBC, Khan Academy, PayPal, Reddit, The New York Times,
Yahoo, and many more.
• https://github.com/facebook/react/wiki/Sites-Using-React
Facts
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Traditional Web Apps
(server side Web)
SPA
(Single Page Apps)
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
SPA
• In a single page application, the bulk
of your time will be spent keeping
your data in-sync with your UI
• Manipulating the DOM is really
REALLY slow.
• Working with HTML templates can be
a pain
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Automatic UI State Management
• Lightning-fast DOM Manipulation
• In-memory Virtual DOM
• APIs to Create Truly Composable Uis
• Visuals Defined Entirely in JavaScript
• no framework-specific templating command
React
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Developing for React
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Dealing with JS
• Babel JavaScript compiler
• Converting JSX
• Node.JS CI/CD toolchain
• Conversion at runtime
React Toolchain
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Conversion at Runtime
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Static conversation: CI/CD ToolChain
https://www.kirupa.com/react/setting_up_react_environment.htm
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Utility: create-react-app
> npm install -g create-react-app
> create-react-app helloworld
> cd helloworld
# for development
> npm start #
# for packaging
> npm run build
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Module bundler for Javascript applications
• Takes in various assets (JS, CSS, Fonts, Images, HTML…)
• Transforms, minifies and optimizes to serve one bundle to the
browser
• JS library with an extensible architecture (loaders & plugins)
• Builds a dependency graph from webpack.config.js
WebPack
https://github.com/webpack
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Your First App
https://www.kirupa.com/react/building_your_first_react_app.htm
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• The render method takes two arguments:
• The HTML-like elements (aka JSX) you wish to output
• The location in the DOM that React will render the JSX into
React Basics
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
React Components
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Component LifeCycle Methods
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Synthetic Events
Generic properties MouseEvent properties KeyBoardEvent properties
https://reactjs.org/docs/events.html
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Working with Redux
https://www.kirupa.com/react/using_redux_with_react.htm
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Share state with Redux store
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Learn React by Kirupa
• https://www.kirupa.com/react/using_redux_with_react.htm
• Fetching Data in React
• https://www.robinwieruch.de/react-fetching-data/
• Higher order components
• https://www.robinwieruch.de/gentle-introduction-higher-order-components/
Resources
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Creating a React Map
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
React Map Starter Kit
https://github.com/ObjectIsAdvantag/roomkit-react-map
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Live Map
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
• Postman collections for xAPI
• https://github.com/CiscoDevNet/postman-xapi
• Code samples, React tutos, RoomKit Map and Collector
• https://github.com/ObjectIsAdvantag
• Dev Center
• http://cs.co/roomdevices
• Twitter
• @SteveSfartz
Resources
© 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential
Thank you
stsfartz@cisco.com
twitter: @SteveSfartz
github: @ObjectIsAdvantag

More Related Content

PDF
React lecture
PPTX
Thinking in react
PPTX
React/Redux
PPTX
Introduction to Facebook React
PPTX
React web development
PDF
React
PPTX
React hooks
PDF
Inside GitHub with Chris Wanstrath
React lecture
Thinking in react
React/Redux
Introduction to Facebook React
React web development
React
React hooks
Inside GitHub with Chris Wanstrath

What's hot (20)

PDF
Clean architecture - Protecting the Domain
PDF
Model View Presenter
PDF
Redux Toolkit - Quick Intro - 2022
PDF
The 12 Factors for Building Cloud-Native Software
PPTX
Microservice architecture design principles
PPTX
Its time to React.js
PPTX
React JS: A Secret Preview
PDF
Gitlab flow
PDF
Microservices Tutorial for Beginners | All You Need to Get Started
PPTX
React hooks
PDF
Michael Vidyakin: Assessing Organizational Readiness (UA)
PDF
Solid NodeJS with TypeScript, Jest & NestJS
PDF
Clean Architecture
PDF
Micro Frontends Architecture - Jitendra kumawat (Guavus)
PPTX
React Native
PPSX
SOLID Principles and The Clean Architecture
PDF
An Introduction to Redux
PPTX
React js
PDF
Clean architecture
PDF
React&redux
Clean architecture - Protecting the Domain
Model View Presenter
Redux Toolkit - Quick Intro - 2022
The 12 Factors for Building Cloud-Native Software
Microservice architecture design principles
Its time to React.js
React JS: A Secret Preview
Gitlab flow
Microservices Tutorial for Beginners | All You Need to Get Started
React hooks
Michael Vidyakin: Assessing Organizational Readiness (UA)
Solid NodeJS with TypeScript, Jest & NestJS
Clean Architecture
Micro Frontends Architecture - Jitendra kumawat (Guavus)
React Native
SOLID Principles and The Clean Architecture
An Introduction to Redux
React js
Clean architecture
React&redux
Ad

Similar to DevNetCreate Workshop - build a react app - React crash course (20)

PDF
Emulators as an Emerging Best Practice for API Providers
PPTX
Rome 2017: Building advanced voice assistants and chat bots
PPTX
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
PDF
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
PPTX
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
PPTX
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
PDF
Build advanced chat bots - Steve Sfartz - Codemotion Amsterdam 2017
PPTX
Meeting rooms are talking. Are you listening
PPTX
Javascript Essentials - Cisco Live Barcelona 2019
PPTX
Meeting rooms are talking! are you listening?
PDF
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
PPTX
Building a REST API Microservice for the DevNet API Scavenger Hunt
PDF
Container Native Development Tools - Talk by Mickey Boxell
PPTX
ASP .Net Core SPA Templates
PDF
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
PDF
Cisco Connect Toronto 2018 DevNet Overview
PDF
introduction to kubernetes slide deck by Roach
PDF
Embed Spark calling SDK in Your App - Olivier PROFFIT - Cisco Live Berlin 2017
PPT
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
PPTX
Build Your First SharePoint Framework Webpart
Emulators as an Emerging Best Practice for API Providers
Rome 2017: Building advanced voice assistants and chat bots
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Building advanced Chats Bots and Voice Interactive Assistants - Stève Sfartz ...
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
Stève Sfartz - Meeting rooms are talking! Are you listening? - Codemotion Ber...
Build advanced chat bots - Steve Sfartz - Codemotion Amsterdam 2017
Meeting rooms are talking. Are you listening
Javascript Essentials - Cisco Live Barcelona 2019
Meeting rooms are talking! are you listening?
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Building a REST API Microservice for the DevNet API Scavenger Hunt
Container Native Development Tools - Talk by Mickey Boxell
ASP .Net Core SPA Templates
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
Cisco Connect Toronto 2018 DevNet Overview
introduction to kubernetes slide deck by Roach
Embed Spark calling SDK in Your App - Olivier PROFFIT - Cisco Live Berlin 2017
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Build Your First SharePoint Framework Webpart
Ad

More from Cisco DevNet (20)

PDF
DEVNET-2138 - Managing OpenAPI Documents at Scale - clus24.pdf
PPTX
18 facets of the OpenAPI specification - Cisco Live US 2023
PDF
The 12 facets of the OpenAPI standard.pdf
PPTX
the 12 facets of OpenAPI
PPTX
Webex APIs for Administrators - CL20B - DEVNET-2610
PPTX
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
PPTX
Customizing Cisco Collaboration Devices - CL20B - DEVNET-2071
PDF
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
PDF
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
PDF
when Apps meet Infrastructure - CodeMotionMilan2018 Keynote - Cisco DevNet - ...
PPTX
Advanced Postman for Better APIs - Web Summit 2018 - Cisco DevNet
PPTX
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
PPTX
Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...
PPTX
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
PPTX
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
PPTX
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
PPTX
Embedding Messages and Video Calls in your apps
PPTX
BotCommons: Metadata for Bots - Devoxx 2017
PPTX
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
PPTX
Phone Communications in Javascript with Tropo Serverless
DEVNET-2138 - Managing OpenAPI Documents at Scale - clus24.pdf
18 facets of the OpenAPI specification - Cisco Live US 2023
The 12 facets of the OpenAPI standard.pdf
the 12 facets of OpenAPI
Webex APIs for Administrators - CL20B - DEVNET-2610
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
Customizing Cisco Collaboration Devices - CL20B - DEVNET-2071
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
when Apps meet Infrastructure - CodeMotionMilan2018 Keynote - Cisco DevNet - ...
Advanced Postman for Better APIs - Web Summit 2018 - Cisco DevNet
Microservices & Serverless Architecture Principles Applied - Cisco Live Orlan...
Integrated, Automated Video Room Systems - Webex Devices - Cisco Live Orlando...
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Golang 101 for IT-Pros - Cisco Live Orlando 2018 - DEVNET-1808
Embedding Messages and Video Calls in your apps
BotCommons: Metadata for Bots - Devoxx 2017
Breizhcamp: Créer un bot, pas si simple. Faisons le point.
Phone Communications in Javascript with Tropo Serverless

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Big Data Technologies - Introduction.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectral efficient network and resource selection model in 5G networks
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Chapter 3 Spatial Domain Image Processing.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Dropbox Q2 2025 Financial Results & Investor Presentation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
The AUB Centre for AI in Media Proposal.docx
Spectroscopy.pptx food analysis technology
Big Data Technologies - Introduction.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm

DevNetCreate Workshop - build a react app - React crash course

  • 1. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Build a React App #devnetcreate workshop API Evangelist @CiscoDevNet @SteveSfartz, stsfartz@cisco.com Stève Sfartz
  • 2. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • API Evangelist @CiscoDevNet - Europe • REST & Microservices Architecture • Cisco Spark API & Collaboration Endpoints xAPI • hosted @CiscoROI: Paris Innovation Center • node.js mainly, a bit of #golang • France and all around Europe • github: //ObjectIsAdvantag /Cisco/DevNet/SteveSfartz “vision without execution is hallucination” stsfartz@cisco.com @SteveSfartz
  • 3. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Discover React development and Cisco Collaboration Endpoints (CE9.2.1+) programmability. • Throughout the workshop, you'll first learn to compute Meeting Room Analytics from real-time events sent by Meeting Room Device’s Camera. • We'll then go through the code of a React App that shows a map of DevNet Create 2018 location, and update it to display how many developers are attending each workshop. • Pre-requisites: you have 1 to 3 years of professional development experienceand a laptop with a pre-configured Node.js v6+ development environment. Build a React app … that shows live activity at DevNet Create
  • 4. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • React • RoomKits • xAPI • Node.js https://github.com/ObjectIsAdvantag/roomkit-react-map
  • 5. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Pre-requisites • Interacting with Room Series from code • Creating a React Map • static HTML • static React • injecting Data • Live Map Agenda
  • 6. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Pre-requisites
  • 7. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • https://github.com/CiscoDevNet/Create2018 - Stève Sfartz • Check you have node v6+ installed on your laptop via node -v command, OR install latest version of node on your machine from https://nodejs.org • Extra command line tools: git client, npm, Firefox, postman • Sign at https://developer.ciscospark.com with your Cisco Spark account credentials • Join the Space attached to the Workshop https://eurl.io/#BJC1Z--jM Technical Requirements
  • 8. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • node –v (nodejs.org), v6+, v8 preferred • npm –v • git -–version • a code editor (Visual Studio Code, Atom...) • Cisco Spark support space: https://eurl.io/#BJC1Z--jM Pre-requites
  • 9. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Interacting with Room Series from code
  • 10. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • http://cs.co/roomdevices • Connect to RoomKitsWifi • http://192.168.2.4/web/signin • ssh with integrator role > xstatus RoomAnalytics PeopleCount • listen to events > xfeedback register /Status/RoomAnalytics/PeopleCount Meet a Room Kit
  • 11. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • REST API (xml over http) • https://github.com/CiscoDevNet/postman-xapi • jsxapi • https://github.com/ObjectIsAdvantag/xapi-samples/blob/master/jsxapi/7- feedback-peoplecount.js > JSXAPI_DEVICE_URL="ssh://192.168.2.4" JSXAPI_USERNAME='integrator' JSXAPI_PASSWORD='integrator' node 7- feedback-peoplecount.js Run from code
  • 12. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • https://github.com/ObjectIsAdvantag/roomkit-collector • edit device.json • Run collector > DEBUG=api*,collector* node server.js • Run mock version > cd api > node mock.js RoomKit Collector
  • 13. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Connect to the RoomKit Sandbox Sandbox
  • 14. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential A bit of React Crash course
  • 15. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential About React https://www.kirupa.com/react/introducing_react.htm
  • 16. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Since it came out in 2013, React has also steadily found its way into popular web sites and apps that you probably use. • Besides Facebook and Instagram, some of the notable ones include the BBC, Khan Academy, PayPal, Reddit, The New York Times, Yahoo, and many more. • https://github.com/facebook/react/wiki/Sites-Using-React Facts
  • 17. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Traditional Web Apps (server side Web) SPA (Single Page Apps)
  • 18. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential SPA • In a single page application, the bulk of your time will be spent keeping your data in-sync with your UI • Manipulating the DOM is really REALLY slow. • Working with HTML templates can be a pain
  • 19. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Automatic UI State Management • Lightning-fast DOM Manipulation • In-memory Virtual DOM • APIs to Create Truly Composable Uis • Visuals Defined Entirely in JavaScript • no framework-specific templating command React
  • 20. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Developing for React
  • 21. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Dealing with JS • Babel JavaScript compiler • Converting JSX • Node.JS CI/CD toolchain • Conversion at runtime React Toolchain
  • 22. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Conversion at Runtime
  • 23. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Static conversation: CI/CD ToolChain https://www.kirupa.com/react/setting_up_react_environment.htm
  • 24. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Utility: create-react-app > npm install -g create-react-app > create-react-app helloworld > cd helloworld # for development > npm start # # for packaging > npm run build
  • 25. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Module bundler for Javascript applications • Takes in various assets (JS, CSS, Fonts, Images, HTML…) • Transforms, minifies and optimizes to serve one bundle to the browser • JS library with an extensible architecture (loaders & plugins) • Builds a dependency graph from webpack.config.js WebPack https://github.com/webpack
  • 26. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Your First App https://www.kirupa.com/react/building_your_first_react_app.htm
  • 27. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • The render method takes two arguments: • The HTML-like elements (aka JSX) you wish to output • The location in the DOM that React will render the JSX into React Basics
  • 28. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential React Components
  • 29. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Component LifeCycle Methods
  • 30. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Synthetic Events Generic properties MouseEvent properties KeyBoardEvent properties https://reactjs.org/docs/events.html
  • 31. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Working with Redux https://www.kirupa.com/react/using_redux_with_react.htm
  • 32. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Share state with Redux store
  • 33. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Learn React by Kirupa • https://www.kirupa.com/react/using_redux_with_react.htm • Fetching Data in React • https://www.robinwieruch.de/react-fetching-data/ • Higher order components • https://www.robinwieruch.de/gentle-introduction-higher-order-components/ Resources
  • 34. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Creating a React Map
  • 35. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential React Map Starter Kit https://github.com/ObjectIsAdvantag/roomkit-react-map
  • 36. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Live Map
  • 37. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential • Postman collections for xAPI • https://github.com/CiscoDevNet/postman-xapi • Code samples, React tutos, RoomKit Map and Collector • https://github.com/ObjectIsAdvantag • Dev Center • http://cs.co/roomdevices • Twitter • @SteveSfartz Resources
  • 38. © 2017 Cisco and/or its affiliates. All rights reserved. Cisco Confidential Thank you stsfartz@cisco.com twitter: @SteveSfartz github: @ObjectIsAdvantag

Editor's Notes

  • #6: 0. Postman tour - Create workspace "Develop@Cisco" - Create request https://developer.ciscospark.com/endpoint-people-me-get.html - Generating code run node.js script 1. Creating a collection - Add to collection "Postman Tour" - Add environment variables spark_token - Add another request https://developer.ciscospark.com/endpoint-rooms-post.html 2. Documentation your collection - Add description to the existing REST requests - Select your collection and click "View in Web" - Pick an environment - Publish => there is more 3. Running your collection - Select your collection and click "Run" - Pick 3 iterations, 500ms delay, Run => let's add tests (passed 0/0) 4. Add scripting - Add a test for Get Person Details - Run the REST request (2/2) - Add a test for Create a room - Run the REST request (2/2) - Add a DELETE room request => run the collection again (Passed 5/5) 5. Test automation - Create a monitor => need a paying plan - Install newman - Export your collection and run newman newman run "Postman Tour .postman_collection.json" --global-var "spark_token=XXXXXXXXXXXX" 6. Load other postman collections - Spark collection => ordered list - xAPI collection => XML sample 7. Free time - Analyse Meraki collection - Create your own 8. Wrap up, and To go further - Run in postman button - Swagger import
  • #11: Count people GREATER THAN