SlideShare a Scribd company logo
REACT SPOTLIGHTREACT SPOTLIGHT
AGENDAAGENDA
1. Component Testing
2. React && TypeScript
3. Gatsby, React, and GraphQL
4. The Delicate Power of Webpack and Babel
5. Component Library
COMPONENT TESTINGCOMPONENT TESTING
Systems are too coupled to be effectively unit tested
(Integration Tests)
Focus on behaviour
Avoid testing third party library functions
Unit tests work well in
isolation
Small group of units to
test their behavior as a
whole, verifying that
they coherently work
together
Testing the data layer
with UI
INTEGRATION TESTINGINTEGRATION TESTING
INTEGRATION TESTINTEGRATION TEST
updateUser = (body) => {
const { user, updateUser } = this.props
const newUser = {
...user,
...body
}
return updateUser(newUser)
.then(() => {
this.setState({ fetching: false})
})
}
INTEGRATION TESTINTEGRATION TEST
it('should call updateUser with first name updated', () => {
const expectedUser = {
firstName: 'Howdy',
lastName: 'Partner'
}
wrapper.instance().updateUser({ firstName: 'Howdy' })
expect(wrapper.instance().props.updateUser).toHaveBeenCalled
})
FOCUS ON BEHAVIOURFOCUS ON BEHAVIOUR
export const searchFromList = (searchKey, list) => {
const matchName = (item, searchKey) => {
const actualText = _.isString(item) ? item.toLowerCase() :
const searchText = searchKey.toLowerCase()
return actualText.includes(searchText)
}
const matchTag = (item, searchKey) => {
return !_.isString(item) && item.tags && item.tags.filter(
}
return searchKey.length ? _.filter(list, (item) => matchName
}
FOCUS ON BEHAVIOURFOCUS ON BEHAVIOUR
describe('searchFromList', () => {
const canada = { name: 'Canada', tags: ['earth', 'northAmeri
const usa = { name: 'USA', tags: ['earth', 'northAmerica'] }
const mexico = { name: 'Mexico', tags: ['earth', 'northAmeri
const messagingList = [canada, usa, mexico]
it('match name with search key', () => {
expect(searchFromList('can', messagingList)).toEqual([cana
expect(searchFromList('uSa', messagingList)).toEqual([usa]
})
})
Less errors due to type
checking
Catch errors early in
editor
Provides clearer vision
REACT && TYPESCRIPTREACT && TYPESCRIPT
FULLY ANNOTATED TYPESCRIPTFULLY ANNOTATED TYPESCRIPT
function add(a: number, b: number) : number {
return a + b;
}
INTERFACESINTERFACES
interface Person {
name: string;
hobbies: string[];
}
const teachers: Teacher[] = [
{
name: 'Ryan',
courses: ['Reading', 'Writing']
},
{
name: 'Simon',
courses: ['Basketball', 'Gym']
},{
name: 'Jordan',
courses: ['Music', 'Art']
}
];
REACT PROPTYPESREACT PROPTYPES
EventItem.propTypes = {
title: PropTypes.string.isRequired,
capacity: PropTypes.number.isRequired,
date: PropTypes.Date.isRequired
}
function EventItem(props) (
<div>
<h2>{props.title}</h2>
...
</div>
);
REACT PROPTYPES IN TYPESCRIPTREACT PROPTYPES IN TYPESCRIPT
interface Props {
title: string;
capacity: number;
date: Date;
}
function EventItem(props: Props) (
<div>
<h2>{props.title}</h2>
...
</div>
);
React-based, GraphQL
powered, static site
generator
JAM Stack
Out of box tools: fast
page loads, service
workers, code splitting,
intelligent image
loading, data prefetch
GATSBY, REACT, AND GRAPHQLGATSBY, REACT, AND GRAPHQL
HOW IT WORKSHOW IT WORKS
GRAPHQLGRAPHQL
THE DELICATE POWER OF WEBPACK ANDTHE DELICATE POWER OF WEBPACK AND
BABELBABEL
TREE SHAKINGTREE SHAKING
CODE SPLITTINGCODE SPLITTING
Process of taking one large bundle containing your
entire app, and splitting them up into multiple
smaller bundles which contain separate parts of
your app.
Route-based splitting vs. Component-based
splitting
Before A er
BUNDLE SPLITTINGBUNDLE SPLITTING
COMPONENT LIBRARYCOMPONENT LIBRARY
Reusable NPM Package
Storybook or Styleguidist
Living styleguide
Automated releases and deploys

More Related Content

What's hot

Lab1-DB-Cassandra
Lab1-DB-CassandraLab1-DB-Cassandra
Lab1-DB-Cassandra
Lilia Sfaxi
 
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talkMooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
Jose Luis Martínez
 
Command box migrations Into The Box 2018
Command box migrations Into The Box 2018 Command box migrations Into The Box 2018
Command box migrations Into The Box 2018
Ortus Solutions, Corp
 
Mule esb object_to_jackson_json
Mule esb object_to_jackson_jsonMule esb object_to_jackson_json
Mule esb object_to_jackson_json
Davide Rapacciuolo
 
Lenguaje de programación jn
Lenguaje de programación jnLenguaje de programación jn
Lenguaje de programación jn
Jhiselys Vásquez
 
TDD in the wild
TDD in the wildTDD in the wild
TDD in the wild
Brainhub
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
Learnbay Datascience
 
Coding convention php
Coding convention phpCoding convention php
Coding convention php
japan_works
 
与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库
YUCHENG HU
 
CodeIgniter
CodeIgniter CodeIgniter
CodeIgniter
Mohamed Syam
 
Gigigo Ruby Workshop
Gigigo Ruby WorkshopGigigo Ruby Workshop
Gigigo Ruby Workshop
Alex Rupérez
 
Getting Started With MongoDB
Getting Started With MongoDBGetting Started With MongoDB
Getting Started With MongoDB
Bill Kunneke
 
Object oriented programming in php
Object oriented programming in phpObject oriented programming in php
Object oriented programming in php
Aashiq Kuchey
 
ActiveRecord
ActiveRecordActiveRecord
ActiveRecord
Blazing Cloud
 
Why couchdb is cool
Why couchdb is coolWhy couchdb is cool
Why couchdb is cool
Gabriele Lana
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignment
Akash gupta
 
PHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHPPHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHP
Dave Stokes
 

What's hot (20)

Lab1-DB-Cassandra
Lab1-DB-CassandraLab1-DB-Cassandra
Lab1-DB-Cassandra
 
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talkMooseX::Datamodel - Barcelona Perl Workshop Lightning talk
MooseX::Datamodel - Barcelona Perl Workshop Lightning talk
 
3
33
3
 
Command box migrations Into The Box 2018
Command box migrations Into The Box 2018 Command box migrations Into The Box 2018
Command box migrations Into The Box 2018
 
Mule esb object_to_jackson_json
Mule esb object_to_jackson_jsonMule esb object_to_jackson_json
Mule esb object_to_jackson_json
 
Lenguaje de programación jn
Lenguaje de programación jnLenguaje de programación jn
Lenguaje de programación jn
 
TDD in the wild
TDD in the wildTDD in the wild
TDD in the wild
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Mongo db
Mongo dbMongo db
Mongo db
 
Coding convention php
Coding convention phpCoding convention php
Coding convention php
 
与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库与 PHP 和 Perl 使用 MySQL 数据库
与 PHP 和 Perl 使用 MySQL 数据库
 
CodeIgniter
CodeIgniter CodeIgniter
CodeIgniter
 
Gigigo Ruby Workshop
Gigigo Ruby WorkshopGigigo Ruby Workshop
Gigigo Ruby Workshop
 
Getting Started With MongoDB
Getting Started With MongoDBGetting Started With MongoDB
Getting Started With MongoDB
 
Object oriented programming in php
Object oriented programming in phpObject oriented programming in php
Object oriented programming in php
 
ActiveRecord
ActiveRecordActiveRecord
ActiveRecord
 
Why couchdb is cool
Why couchdb is coolWhy couchdb is cool
Why couchdb is cool
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Book integrated assignment
Book integrated assignmentBook integrated assignment
Book integrated assignment
 
PHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHPPHP Database Programming Basics -- Northeast PHP
PHP Database Programming Basics -- Northeast PHP
 

Similar to React Spotlight 2018

HELP IN JAVACreate a main method and use these input files to tes.pdf
HELP IN JAVACreate a main method and use these input files to tes.pdfHELP IN JAVACreate a main method and use these input files to tes.pdf
HELP IN JAVACreate a main method and use these input files to tes.pdf
fatoryoutlets
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
Calvin Cheng
 
All you need to know about JavaScript Functions
All you need to know about JavaScript FunctionsAll you need to know about JavaScript Functions
All you need to know about JavaScript Functions
Oluwaleke Fakorede
 
Spsl vi unit final
Spsl vi unit finalSpsl vi unit final
Spsl vi unit final
Sasidhar Kothuru
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
Sasidhar Kothuru
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
Rafael Casuso Romate
 
Modern JavaScript - Modern ES6+ Features
Modern JavaScript - Modern ES6+ FeaturesModern JavaScript - Modern ES6+ Features
Modern JavaScript - Modern ES6+ Features
Nikki Dingding
 
Scala Quick Introduction
Scala Quick IntroductionScala Quick Introduction
Scala Quick Introduction
Damian Jureczko
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scalaparag978978
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
Jonas Bonér
 
jRuby: The best of both worlds
jRuby: The best of both worldsjRuby: The best of both worlds
jRuby: The best of both worlds
Christopher Spring
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 
Reliable Javascript
Reliable Javascript Reliable Javascript
Reliable Javascript
Glenn Stovall
 
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
WebStackAcademy
 

Similar to React Spotlight 2018 (20)

HELP IN JAVACreate a main method and use these input files to tes.pdf
HELP IN JAVACreate a main method and use these input files to tes.pdfHELP IN JAVACreate a main method and use these input files to tes.pdf
HELP IN JAVACreate a main method and use these input files to tes.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
Spock and Geb
Spock and GebSpock and Geb
Spock and Geb
 
Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)Functional Programming for OO Programmers (part 2)
Functional Programming for OO Programmers (part 2)
 
All you need to know about JavaScript Functions
All you need to know about JavaScript FunctionsAll you need to know about JavaScript Functions
All you need to know about JavaScript Functions
 
Spsl vi unit final
Spsl vi unit finalSpsl vi unit final
Spsl vi unit final
 
Spsl v unit - final
Spsl v unit - finalSpsl v unit - final
Spsl v unit - final
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
 
Modern JavaScript - Modern ES6+ Features
Modern JavaScript - Modern ES6+ FeaturesModern JavaScript - Modern ES6+ Features
Modern JavaScript - Modern ES6+ Features
 
Scala Quick Introduction
Scala Quick IntroductionScala Quick Introduction
Scala Quick Introduction
 
Pragmatic Real-World Scala
Pragmatic Real-World ScalaPragmatic Real-World Scala
Pragmatic Real-World Scala
 
Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)Pragmatic Real-World Scala (short version)
Pragmatic Real-World Scala (short version)
 
jRuby: The best of both worlds
jRuby: The best of both worldsjRuby: The best of both worlds
jRuby: The best of both worlds
 
Prototype Framework
Prototype FrameworkPrototype Framework
Prototype Framework
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
Reliable Javascript
Reliable Javascript Reliable Javascript
Reliable Javascript
 
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
Core Java Programming Language (JSE) : Chapter IX - Collections and Generic F...
 

Recently uploaded

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Anthony Dahanne
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 

Recently uploaded (20)

Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 

React Spotlight 2018

  • 2. AGENDAAGENDA 1. Component Testing 2. React && TypeScript 3. Gatsby, React, and GraphQL 4. The Delicate Power of Webpack and Babel 5. Component Library
  • 3. COMPONENT TESTINGCOMPONENT TESTING Systems are too coupled to be effectively unit tested (Integration Tests) Focus on behaviour Avoid testing third party library functions
  • 4. Unit tests work well in isolation Small group of units to test their behavior as a whole, verifying that they coherently work together Testing the data layer with UI INTEGRATION TESTINGINTEGRATION TESTING
  • 5. INTEGRATION TESTINTEGRATION TEST updateUser = (body) => { const { user, updateUser } = this.props const newUser = { ...user, ...body } return updateUser(newUser) .then(() => { this.setState({ fetching: false}) }) }
  • 6. INTEGRATION TESTINTEGRATION TEST it('should call updateUser with first name updated', () => { const expectedUser = { firstName: 'Howdy', lastName: 'Partner' } wrapper.instance().updateUser({ firstName: 'Howdy' }) expect(wrapper.instance().props.updateUser).toHaveBeenCalled })
  • 7. FOCUS ON BEHAVIOURFOCUS ON BEHAVIOUR export const searchFromList = (searchKey, list) => { const matchName = (item, searchKey) => { const actualText = _.isString(item) ? item.toLowerCase() : const searchText = searchKey.toLowerCase() return actualText.includes(searchText) } const matchTag = (item, searchKey) => { return !_.isString(item) && item.tags && item.tags.filter( } return searchKey.length ? _.filter(list, (item) => matchName }
  • 8. FOCUS ON BEHAVIOURFOCUS ON BEHAVIOUR describe('searchFromList', () => { const canada = { name: 'Canada', tags: ['earth', 'northAmeri const usa = { name: 'USA', tags: ['earth', 'northAmerica'] } const mexico = { name: 'Mexico', tags: ['earth', 'northAmeri const messagingList = [canada, usa, mexico] it('match name with search key', () => { expect(searchFromList('can', messagingList)).toEqual([cana expect(searchFromList('uSa', messagingList)).toEqual([usa] }) })
  • 9.
  • 10. Less errors due to type checking Catch errors early in editor Provides clearer vision REACT && TYPESCRIPTREACT && TYPESCRIPT
  • 11. FULLY ANNOTATED TYPESCRIPTFULLY ANNOTATED TYPESCRIPT function add(a: number, b: number) : number { return a + b; }
  • 12.
  • 13. INTERFACESINTERFACES interface Person { name: string; hobbies: string[]; }
  • 14. const teachers: Teacher[] = [ { name: 'Ryan', courses: ['Reading', 'Writing'] }, { name: 'Simon', courses: ['Basketball', 'Gym'] },{ name: 'Jordan', courses: ['Music', 'Art'] } ];
  • 15. REACT PROPTYPESREACT PROPTYPES EventItem.propTypes = { title: PropTypes.string.isRequired, capacity: PropTypes.number.isRequired, date: PropTypes.Date.isRequired } function EventItem(props) ( <div> <h2>{props.title}</h2> ... </div> );
  • 16. REACT PROPTYPES IN TYPESCRIPTREACT PROPTYPES IN TYPESCRIPT interface Props { title: string; capacity: number; date: Date; } function EventItem(props: Props) ( <div> <h2>{props.title}</h2> ... </div> );
  • 17. React-based, GraphQL powered, static site generator JAM Stack Out of box tools: fast page loads, service workers, code splitting, intelligent image loading, data prefetch GATSBY, REACT, AND GRAPHQLGATSBY, REACT, AND GRAPHQL
  • 18. HOW IT WORKSHOW IT WORKS
  • 20. THE DELICATE POWER OF WEBPACK ANDTHE DELICATE POWER OF WEBPACK AND BABELBABEL
  • 21.
  • 23.
  • 24.
  • 25. CODE SPLITTINGCODE SPLITTING Process of taking one large bundle containing your entire app, and splitting them up into multiple smaller bundles which contain separate parts of your app. Route-based splitting vs. Component-based splitting
  • 26. Before A er BUNDLE SPLITTINGBUNDLE SPLITTING
  • 27. COMPONENT LIBRARYCOMPONENT LIBRARY Reusable NPM Package Storybook or Styleguidist Living styleguide Automated releases and deploys