SlideShare una empresa de Scribd logo
1 de 55
Progressive Web Apps
and React
Mike Melusky – Philly.NET August 16, 2017
Motivation for the Talk
• Keeping up with the Javascript ecosystem and front end web can be
intimidating
 E.g. Ember, Angular, Erlang, Elixir, Yarn, Reason, Typescript, Flow, Redux …
• Geared more for traditional ASP.NET MVC developers who haven’t had the
chance to work with
• Presence of Javascript in development of native “apps” (e.g. Ionic)
Prerequisites
• HTML
• Javascript
• nodejs
• Basic CLI knowledge (very simple)
• IDE of your choice (Atom, Webstorm, Visual Studio Code, et al.)
About the Speaker
• Mike Melusky (@mrjavascript)
 Software Developer at Audacious Inquiry in Baltimore
 Instructor at Penn State and Franklin and Marshall College
Topics
• Introduction to Progressive Web Apps
• RESTful APIs
• AJAX
• CSS Frameworks
• Javascript Libraries (React in particular)
 React Components
 React Navigation between Views
 Infinite Scrolling
• Web App Manifest
• Service Workers
• Final Steps
Progressive Web Apps
Progressive Web Apps
• A Progressive Web App (PWA) is a web app that uses
modern web capabilities to deliver an app-like experience to users
• You can deploy your app as a PWA as well as Native app and take advantage
of both channels
Progressive Web Apps
RESTful APIs and
AJAX
RESTful APIs
• REST (REpresentational State Transfer) APIs and web services provide an
easy way to communicate with a backend architecture without the need to
understand or mess with the architecture itself
• To put it more simply, as a frontend developer, you are going to be
interacting with one or more endpoints (i.e. URIs) that are part of an API
that resides on a server, cluster or similar backend, that someone else has
created for you
• If the API is well-designed, you will be given clear and concise
documentation on how to go about requesting, creating and editing resources
on the backend (provided that you are properly authorized), without ever
having to write backend code
• This effectively allows frontend developers to deal with just
the View and Controller parts of the MVC
AJAX
• AJAX (Asyncronous JavaScript And XML) has been around for years and
every web developer has used it in one way or another (most of us through
jQuery)
• Using AJAX, we can request resources from one or more places online (or
locally, if your page resides on the same server as your requested URI),
anytime we want, without our web applications slowing down or needing to
get all the data to start rendering
• Used to get content from a RESTful API, using AJAX calls
AJAX
Placeholder Content Resources
• JSON Placeholder—Placeholder text outputted in JSON format, covering
many common use-cases. Very easy to get started with, perfect to populate a
mockup web application such as the one we will be making.
• Unsplash It—Placeholder content is not complete without images and this is
the definitive place to get them. The documentation is really clear and easy-
to-follow, so you can get started in no-time.
• Random User Generator—Another high-quality resource, providing you
with generated user profiles that can be custom-tailored to your needs. It
allows for a plethora of options, but we will only need a select few in the
course of this post.
Presentation w/ CSS frameworks
• Most developers use Bootstrap, which is well-documented, has a nice, large
community and is feature-rich
• We’re going to use mini.css
• Before we can render anything on the screen, we should create an
application shell
• ** DEMO **
What is React?
What is React?
• Javascript framework for creating user interfaces
 Full single page web applications
 Just certain parts of a website (like a search form)
• Component-Based
• Very fast (Virtual DOM)
• Created By Facebook
Javascript Components
• Search component
• Directory component  HTML / DOM
• Signup component
Creating React Project in Webstorm
• ** DEMO **
React App in Webstorm
Create React App
•npm install -g create-react-app
React Native in Webstorm
React Native CLI
• npm install -g react-native-cli
Running the React App
• npm start
Running the Unit Tests
• npm test
Building for Production
• npm run build
React and the Virtual
DOM
JSX / ES6 / BABEL
• We write React Apps in… Browsers Understand…
 JSX -Vanilla JS
 ES6  BABEL
React Virtual DOM
React Components
React Components
• Components let you split the UI into independent, reusable pieces, and think
about each piece in isolation.
• Conceptually, components are like JavaScript functions. They accept
arbitrary inputs (called "props") and return React elements describing what
should appear on the screen.
React Components
React Components (ES6)
Rendering the React Component
Rendering the React Component
• Let's recap what happens in this example:
1. We call ReactDOM.render() with the <Welcome name="Sara" /> element.
2. React calls the Welcome component with {name: 'Sara'} as the props.
3. Our Welcome component returns a <h1>Hello, Sara</h1> element as the
result.
4. React DOM efficiently updates the DOM to match <h1>Hello, Sara</h1>.
React Components
• Most of our React code consists of components
 Search Bar component
 Sign-up component
 To-do list component
 List item component
 Add new item (form) component
 Interact with components using “props” and “state”
 ** DEMO **
Component State and Props
React CLI
• npm install -g react-create
• react-create component <component name> --jsx
Converting existing
app to React
Components
Converting to React Components
• ** DEMO **
Babel and React.createElement()
Converting to React Components
• Other features to add:
 Additional view and navigation
 Infinite Scrolling
Infinite Scrolling
Service Workers
Service Workers
• Service Worker is a recent web platform specification that allows you to
cache resources locally in order to make sure that your app still works, even
if the user is not connected to the internet
• Service workers handle three core events:
 install is fired on the first load and is used to perform the initial setup of the Service
Worker, such as setting up offline caches.
 activate is fired after the Service Worker is registered and has been successfully
installed.
 fetch is fired whenever an AJAX request is sent over the network and can be used to
serve cached resources (especially useful when offline).
Service Worker - Install
Service Worker – Activate
Service Worker - Fetch
Web App Manifest
Web App Manifest
• A requirement for a PWA is updating the manifest.json file.
• This file consists of your application’s name, short name, icons, et al.
Web App Manifest
Final Steps and
Production Build
Final Steps
• Evaluate your Web App
 Google Lighthouse
 https://developers.google.com/web/tools/lighthouse/
 Google Mobile Speed Test
 https://testmysite.thinkwithgoogle.com/intl/en-us
Thank you
• “A Beginner’s Guide to Progressive Web Apps and the Front End Web” by
Angelos Chalaris
 https://hackernoon.com/a-beginners-guide-to-progressive-web-apps-the-frontend-
web-424b6d697e35
• “React Tutorials” by The Net Ninja:
 https://www.youtube.com/playlist?list=PL4cUxeGkcC9i0_2FF-WhtRIfIJ1lXlTZR
Additional Resources
• React Dev Tools (Chrome Extension):
 https://chrome.google.com/webstore/detail/react-developer-
tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en
• Swagger UI (API documentation):
 https://swagger.io/swagger-ui/
• Web App Manifest Generator:
 https://tomitm.github.io/appmanifest/
• UI Icons:
 http://fontawesome.io/
 https://feathericons.com/
• Icon Generator
 http://www.favicon-generator.org/
Even More Resources
• Preact – slimmed down alternative to React:
 https://preactjs.com/
• “The Service Worker Lifecycle”:
 https://developers.google.com/web/fundamentals/instant-and-offline/service-
worker/lifecycle
• React Documentation (via Facebook)
 https://facebook.github.io/react/docs/hello-world.html

Más contenido relacionado

La actualidad más candente

Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystifiededynamic
 
Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web AppIdo Green
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Zhentian Wan
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web AppSankalp Khandelwal
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web AppRobert Robinson
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web appsAkshay Sharma
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web AppSubodh Garg
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1Esraa Ammar
 
Spring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousSpring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousVMware Tanzu
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfShaiAlmog1
 

La actualidad más candente (20)

Progressive Web Apps(PWA)
Progressive Web Apps(PWA)Progressive Web Apps(PWA)
Progressive Web Apps(PWA)
 
Pwa demystified
Pwa demystifiedPwa demystified
Pwa demystified
 
Building a Progressive Web App
Building a  Progressive Web AppBuilding a  Progressive Web App
Building a Progressive Web App
 
Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)Introduction to Progressive web app (PWA)
Introduction to Progressive web app (PWA)
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
PWA
PWAPWA
PWA
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Introduction of Progressive Web App
Introduction of Progressive Web AppIntroduction of Progressive Web App
Introduction of Progressive Web App
 
PWA - Progressive Web App
PWA - Progressive Web AppPWA - Progressive Web App
PWA - Progressive Web App
 
Progressive web apps
Progressive web appsProgressive web apps
Progressive web apps
 
Progressive Web App
Progressive Web AppProgressive Web App
Progressive Web App
 
Progressive web app
Progressive web appProgressive web app
Progressive web app
 
SignalR With ASP.Net part1
SignalR With ASP.Net part1SignalR With ASP.Net part1
SignalR With ASP.Net part1
 
Web services SOAP
Web services SOAPWeb services SOAP
Web services SOAP
 
Micro frontend
Micro frontendMicro frontend
Micro frontend
 
Spring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the ObviousSpring Data JDBC: Beyond the Obvious
Spring Data JDBC: Beyond the Obvious
 
Neoload overview
Neoload overviewNeoload overview
Neoload overview
 
Angular PWA
Angular PWAAngular PWA
Angular PWA
 
Creating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdfCreating a Whatsapp Clone - Part I - Transcript.pdf
Creating a Whatsapp Clone - Part I - Transcript.pdf
 

Similar a Progressive Web Apps and React: Build PWAs with React Components

Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETAlan Hecht
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React nativeDhaval Barot
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsKranthi Lakum
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = JoyJohn Need
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
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
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesEamonn Boyle
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...MskDotNet Community
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with reduxGaurav Singh
 
React.js for Rails Developers
React.js for Rails DevelopersReact.js for Rails Developers
React.js for Rails DevelopersArkency
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online TrainingLearntek1
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxKulbir4
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.jsKasey McCurdy
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptxssuser35fdf2
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSirwan Afifi
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 

Similar a Progressive Web Apps and React: Build PWAs with React Components (20)

Intro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NETIntro to SPA using JavaScript & ASP.NET
Intro to SPA using JavaScript & ASP.NET
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
Fluxible
FluxibleFluxible
Fluxible
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
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
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Mastering react with redux
Mastering react with reduxMastering react with redux
Mastering react with redux
 
React.js for Rails Developers
React.js for Rails DevelopersReact.js for Rails Developers
React.js for Rails Developers
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
 
An introduction to Node.js
An introduction to Node.jsAn introduction to Node.js
An introduction to Node.js
 
Advanced Web Technology.pptx
Advanced Web Technology.pptxAdvanced Web Technology.pptx
Advanced Web Technology.pptx
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 

Más de Mike Melusky

Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET DevelopersMike Melusky
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!Mike Melusky
 
Building a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet coreBuilding a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet coreMike Melusky
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperMike Melusky
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Mike Melusky
 
Building xamarin.forms apps with prism and mvvm
Building xamarin.forms apps with prism and mvvmBuilding xamarin.forms apps with prism and mvvm
Building xamarin.forms apps with prism and mvvmMike Melusky
 
Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms BootcampMike Melusky
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Mike Melusky
 
An afternoon with angular 2
An afternoon with angular 2An afternoon with angular 2
An afternoon with angular 2Mike Melusky
 
An evening with Angular 2
An evening with Angular 2An evening with Angular 2
An evening with Angular 2Mike Melusky
 
Securing your azure web app with asp.net core data protection
Securing your azure web app with asp.net core data protectionSecuring your azure web app with asp.net core data protection
Securing your azure web app with asp.net core data protectionMike Melusky
 
Ember.js and .NET Integration
Ember.js and .NET IntegrationEmber.js and .NET Integration
Ember.js and .NET IntegrationMike Melusky
 
Building Native “apps” with Visual Studio 2015
Building Native “apps” with Visual Studio 2015Building Native “apps” with Visual Studio 2015
Building Native “apps” with Visual Studio 2015Mike Melusky
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NETMike Melusky
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressionsMike Melusky
 
An evening with querydsl
An evening with querydslAn evening with querydsl
An evening with querydslMike Melusky
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressionsMike Melusky
 
Fun with windows services
Fun with windows servicesFun with windows services
Fun with windows servicesMike Melusky
 
Philly.NET Code Camp 2014.1
Philly.NET Code Camp 2014.1Philly.NET Code Camp 2014.1
Philly.NET Code Camp 2014.1Mike Melusky
 

Más de Mike Melusky (20)

Container Orchestration for .NET Developers
Container Orchestration for .NET DevelopersContainer Orchestration for .NET Developers
Container Orchestration for .NET Developers
 
Containerize all the things!
Containerize all the things!Containerize all the things!
Containerize all the things!
 
Building a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet coreBuilding a Google Cloud Firestore API with dotnet core
Building a Google Cloud Firestore API with dotnet core
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Effective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and DapperEffective .NET Core Unit Testing with SQLite and Dapper
Effective .NET Core Unit Testing with SQLite and Dapper
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2
 
Building xamarin.forms apps with prism and mvvm
Building xamarin.forms apps with prism and mvvmBuilding xamarin.forms apps with prism and mvvm
Building xamarin.forms apps with prism and mvvm
 
Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)
 
An afternoon with angular 2
An afternoon with angular 2An afternoon with angular 2
An afternoon with angular 2
 
An evening with Angular 2
An evening with Angular 2An evening with Angular 2
An evening with Angular 2
 
Securing your azure web app with asp.net core data protection
Securing your azure web app with asp.net core data protectionSecuring your azure web app with asp.net core data protection
Securing your azure web app with asp.net core data protection
 
Ember.js and .NET Integration
Ember.js and .NET IntegrationEmber.js and .NET Integration
Ember.js and .NET Integration
 
Building Native “apps” with Visual Studio 2015
Building Native “apps” with Visual Studio 2015Building Native “apps” with Visual Studio 2015
Building Native “apps” with Visual Studio 2015
 
Emberjs and ASP.NET
Emberjs and ASP.NETEmberjs and ASP.NET
Emberjs and ASP.NET
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressions
 
An evening with querydsl
An evening with querydslAn evening with querydsl
An evening with querydsl
 
Fun with lambda expressions
Fun with lambda expressionsFun with lambda expressions
Fun with lambda expressions
 
Fun with windows services
Fun with windows servicesFun with windows services
Fun with windows services
 
Philly.NET Code Camp 2014.1
Philly.NET Code Camp 2014.1Philly.NET Code Camp 2014.1
Philly.NET Code Camp 2014.1
 

Último

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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
"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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

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!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
"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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
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
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Progressive Web Apps and React: Build PWAs with React Components

  • 1. Progressive Web Apps and React Mike Melusky – Philly.NET August 16, 2017
  • 2. Motivation for the Talk • Keeping up with the Javascript ecosystem and front end web can be intimidating  E.g. Ember, Angular, Erlang, Elixir, Yarn, Reason, Typescript, Flow, Redux … • Geared more for traditional ASP.NET MVC developers who haven’t had the chance to work with • Presence of Javascript in development of native “apps” (e.g. Ionic)
  • 3. Prerequisites • HTML • Javascript • nodejs • Basic CLI knowledge (very simple) • IDE of your choice (Atom, Webstorm, Visual Studio Code, et al.)
  • 4. About the Speaker • Mike Melusky (@mrjavascript)  Software Developer at Audacious Inquiry in Baltimore  Instructor at Penn State and Franklin and Marshall College
  • 5. Topics • Introduction to Progressive Web Apps • RESTful APIs • AJAX • CSS Frameworks • Javascript Libraries (React in particular)  React Components  React Navigation between Views  Infinite Scrolling • Web App Manifest • Service Workers • Final Steps
  • 7. Progressive Web Apps • A Progressive Web App (PWA) is a web app that uses modern web capabilities to deliver an app-like experience to users • You can deploy your app as a PWA as well as Native app and take advantage of both channels
  • 10. RESTful APIs • REST (REpresentational State Transfer) APIs and web services provide an easy way to communicate with a backend architecture without the need to understand or mess with the architecture itself • To put it more simply, as a frontend developer, you are going to be interacting with one or more endpoints (i.e. URIs) that are part of an API that resides on a server, cluster or similar backend, that someone else has created for you • If the API is well-designed, you will be given clear and concise documentation on how to go about requesting, creating and editing resources on the backend (provided that you are properly authorized), without ever having to write backend code • This effectively allows frontend developers to deal with just the View and Controller parts of the MVC
  • 11. AJAX • AJAX (Asyncronous JavaScript And XML) has been around for years and every web developer has used it in one way or another (most of us through jQuery) • Using AJAX, we can request resources from one or more places online (or locally, if your page resides on the same server as your requested URI), anytime we want, without our web applications slowing down or needing to get all the data to start rendering • Used to get content from a RESTful API, using AJAX calls
  • 12. AJAX
  • 13. Placeholder Content Resources • JSON Placeholder—Placeholder text outputted in JSON format, covering many common use-cases. Very easy to get started with, perfect to populate a mockup web application such as the one we will be making. • Unsplash It—Placeholder content is not complete without images and this is the definitive place to get them. The documentation is really clear and easy- to-follow, so you can get started in no-time. • Random User Generator—Another high-quality resource, providing you with generated user profiles that can be custom-tailored to your needs. It allows for a plethora of options, but we will only need a select few in the course of this post.
  • 14. Presentation w/ CSS frameworks • Most developers use Bootstrap, which is well-documented, has a nice, large community and is feature-rich • We’re going to use mini.css • Before we can render anything on the screen, we should create an application shell • ** DEMO **
  • 16. What is React? • Javascript framework for creating user interfaces  Full single page web applications  Just certain parts of a website (like a search form) • Component-Based • Very fast (Virtual DOM) • Created By Facebook
  • 17. Javascript Components • Search component • Directory component  HTML / DOM • Signup component
  • 18. Creating React Project in Webstorm • ** DEMO **
  • 19. React App in Webstorm
  • 20. Create React App •npm install -g create-react-app
  • 21. React Native in Webstorm
  • 22. React Native CLI • npm install -g react-native-cli
  • 23. Running the React App • npm start
  • 24. Running the Unit Tests • npm test
  • 26. React and the Virtual DOM
  • 27. JSX / ES6 / BABEL • We write React Apps in… Browsers Understand…  JSX -Vanilla JS  ES6  BABEL
  • 30. React Components • Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. • Conceptually, components are like JavaScript functions. They accept arbitrary inputs (called "props") and return React elements describing what should appear on the screen.
  • 33. Rendering the React Component
  • 34. Rendering the React Component • Let's recap what happens in this example: 1. We call ReactDOM.render() with the <Welcome name="Sara" /> element. 2. React calls the Welcome component with {name: 'Sara'} as the props. 3. Our Welcome component returns a <h1>Hello, Sara</h1> element as the result. 4. React DOM efficiently updates the DOM to match <h1>Hello, Sara</h1>.
  • 35. React Components • Most of our React code consists of components  Search Bar component  Sign-up component  To-do list component  List item component  Add new item (form) component  Interact with components using “props” and “state”  ** DEMO **
  • 37. React CLI • npm install -g react-create • react-create component <component name> --jsx
  • 38. Converting existing app to React Components
  • 39. Converting to React Components • ** DEMO **
  • 41. Converting to React Components • Other features to add:  Additional view and navigation  Infinite Scrolling
  • 44. Service Workers • Service Worker is a recent web platform specification that allows you to cache resources locally in order to make sure that your app still works, even if the user is not connected to the internet • Service workers handle three core events:  install is fired on the first load and is used to perform the initial setup of the Service Worker, such as setting up offline caches.  activate is fired after the Service Worker is registered and has been successfully installed.  fetch is fired whenever an AJAX request is sent over the network and can be used to serve cached resources (especially useful when offline).
  • 45. Service Worker - Install
  • 46. Service Worker – Activate
  • 49. Web App Manifest • A requirement for a PWA is updating the manifest.json file. • This file consists of your application’s name, short name, icons, et al.
  • 52. Final Steps • Evaluate your Web App  Google Lighthouse  https://developers.google.com/web/tools/lighthouse/  Google Mobile Speed Test  https://testmysite.thinkwithgoogle.com/intl/en-us
  • 53. Thank you • “A Beginner’s Guide to Progressive Web Apps and the Front End Web” by Angelos Chalaris  https://hackernoon.com/a-beginners-guide-to-progressive-web-apps-the-frontend- web-424b6d697e35 • “React Tutorials” by The Net Ninja:  https://www.youtube.com/playlist?list=PL4cUxeGkcC9i0_2FF-WhtRIfIJ1lXlTZR
  • 54. Additional Resources • React Dev Tools (Chrome Extension):  https://chrome.google.com/webstore/detail/react-developer- tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en • Swagger UI (API documentation):  https://swagger.io/swagger-ui/ • Web App Manifest Generator:  https://tomitm.github.io/appmanifest/ • UI Icons:  http://fontawesome.io/  https://feathericons.com/ • Icon Generator  http://www.favicon-generator.org/
  • 55. Even More Resources • Preact – slimmed down alternative to React:  https://preactjs.com/ • “The Service Worker Lifecycle”:  https://developers.google.com/web/fundamentals/instant-and-offline/service- worker/lifecycle • React Documentation (via Facebook)  https://facebook.github.io/react/docs/hello-world.html