SlideShare a Scribd company logo
1 of 33
Download to read offline
Using TypeScript at
Dashlane
+ =
The programming language that we use
these days for our JavaScript projects
The Problem
Finding a Solution
Settling on TS
How it's been so far
The Problem
New Large-Scale Projects
These projects have to run in a JS
environment: the browser
J S is nice, but...
It's a dynamic language
No static type-checking
A lot of errors can go unnoticed when
developing
Quite easy to break other people's code
A Quick Example
f u n c t i o n t r a i n i n g F l i g h t ( f l i g h t P l a n , p i l o t ) {
i f ( r e q u e s t i n g F l y b y ) {
v a r c s = p i l o t . u n i t C a l l s i g n ( ) ;
r e t u r n ' N e g a t i v e , ' + c s + ' , t h e p a t t e r n i s f u l l ' ;
}
}
t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ;
/ / R e s u l t : ' N e g a t i v e , G h o s t r i d e r , t h e p a t t e r n i s f u l l '
A Quick Example
f u n c t i o n t r a i n i n g F l i g h t ( f l i g h t P l a n , f i g t e r J e t , p i l o t ) {
i f ( r e q u e s t i n g F l y b y ) {
v a r c s = p i l o t . u n i t C a l l s i g n ( ) ;
r e t u r n ' N e g a t i v e , ' + c s + ' , t h e p a t t e r n i s f u l l ' ;
}
}
/ / Somewhere e l s e in t h e c o d e , t h i s f u n c t i o n c a l l s t a y s unchanged
t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ;
The above code compiles fine, but fails at runtime:
Uncaught
r o p e r t y
ed
Ty p e Er r o r : Cannot r e a d p
' u n i t C a l l s i g n ' o f u n d e f i n
Not so nice...
What we'd rather have
A static type system, to catch this type of error early and
make collaboration easier on a large project Produce
more robust code, more resilient to changes Must still be
able to run in the browser
Finding a Solution
Compile-To-J S Languages
t r a i n i n g F l i g h t = ( f l i g h t P l a n , p i l o t ) - >
i f p i l o t . r e q u e s t i n g F l y B y
throw ' P a t t e r n I s F u l l '
t r a i n i n g F l i g h t somePlan , p i l o t
Write in another
language
Vanilla JS output
Compiler step
v a r t r a i n i n g F l i g h t ;
t r a i n i n g F l i g h t = f u n c t i o n ( f l i g h t P l a n , p i l o t ) {
i f ( p i l o t . r e q u e s t i n g F l y B y ) {
throw ' P a t t e r n I s F u l l ' ;
}
} ;
t r a i n i n g F l i g h t ( s o m e P l a n , p i l o t ) ;
Languages Galore...
...but not many matching
our requirements:
Statically typed
Actively supported
Good adoption & community support
Good toolchain
We narrowed it down to TS
and one main alternative...
ES6 (+ Flow)
ES6 is the next big version of
JavaScript
It fixes a number of JS quirks
It's being implemented in
modern browsers, but still
requires a compiler for now
Flow adds static typing to JS
Developed by Facebook
/* @flow * /
f u n c t i o n fo o ( x : s t r i n g , y : number) :
s t r i n r e t u r n x . l e n g t h * y ;
}
Still not the perfect answer
Without Flow, ES6 doesn't offer static type-checking
Flow is very young: no adoption/community
Little available typings for 3rd-party libraries Windows
support non-existing for a long time, now in its very early
stages
Settling on TS
Why
?
The TS language
A superset of JavaScript
A statically typed language
Open-source, developed by Microsoft
Static typing, OO constructs
enum engineType {
TURBINE,
TURBOJET,
TURBOFAN
}
i n t e r f a c e P l a n e {
engineType : EngineType
t a k e O f f : ( ) => vo i d ;
l a n d : ( ) => vo i d ;
}
c l a s s F14 implements P l a n e {
/ / C l a s s i m p l e m e nt at io n
}
f u n c t i o n ge t E n gi n e T yp e s ( p l a n e s: P l a n e [ ] ) : EngineType[] => {
r e t u r n p l a n e s . m a p ( p l a n e : Pl a n e => p l a n e . e n g i n e T yp e ) ;
}
New ES Features
i m p o r t { F i g h t e r J e t } from ' . / P l a n e s ' ; / / Module s yn t a x
/ / Spread o p e r a t o r
f u n c t i o n dogFight ( f i g h t e r : F i g h t e r J e t , . . . o p p o n e n t s : F i g h t e r J e t [ ] ) : F i g h t e r J e t
/ / New ` c o n s t ` and ` l e t ` keywords
c o n s t maxSpeed = 1000;
/ / D e s t r u c t u r i n g
l e t [ f i r s t O p p o n e n t , . . . r e s t ] = o p p o n e n t s ;
i f ( j e t 1 . h a s M i s s i l e L o c k ( f i r s t O p p o n e n t ) ) {
/ / Template s t r i n g s
c o n s o l e . l o g ( ` m i s s i l e l o c k a c q u i r e d on $ { f i r s t O p p o n e n t . p i l o t . c a l l s i g n } ` )
}
}
Working with 3rd-party code
i n t e r f a c e Async {
e a c h < T > ( a r r : T [ ] , i t e r a t o r : As yn c I t e r a t o r < T > , c a l l b a c k ? : E r r o r C a l l b a c k ) : vo i d ;
e a c h S e r i e s < T > ( a r r : T [ ] , i t e r a t o r : A s yn c I t e r a t o r < T >, c a l l b a c k ? : E r r o r C a l l b a c k ) : vo i d
/ / . . .
}
d e c l a r e v a r async : Async;
d e c l a r e module " a s yn c " {
e x p o r t = async ;
}
Integration with 3rd-party libraries through
definition files
Working with 3rd-party code
Public repository of typings available on github
Typings are maintained by the community Most
widely-used npm packages are available
Community & Support
Frequent releases (at
least every 2 months in
2015)
Active community
Adopted by several
companies and big
projects
How It's Been So Far
New projects being written directly in TS
Older projects being refactored to TS for
interoperability
Adoption
Pleasant to work with
Smooth learning curve
Big changes in the code base are much
easier
Tooling is awesome! Great with MS's Visual
Studio Code: IntelliSense, error reporting It's
still just JS! We can require() compiled
Maverick code from other vanilla JS modules
The Good Parts
A Quick Example
f u n c t i o n t r a i n i n g F l i g h t ( p l a n : F l i g h t P l a n , j e t : F i g h t e r J e t , p i l o t : F i g h t e r P i l o t) : s t r i n g
i f ( r e q u e s t i n g F l y b y ) {
l e t c s : s t r i n g = p i l o t . u n i t C a l l s i g n ( ) ;
r e t u r n ` N e g a t i v e , ${cs}, t h e p a t t e r n i s f u l l ` ;
}
}
/ / Missing t h e ' j e t ' p a r a m e t e r
t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ;
We now get a compile-time error:
In spite of the shared typings repositories,
working with external libraries can sometimes
be painful
Public typings not always up-to-date...
...correcting and sharing the corrected
typings can be a a chore
The Not-So-Good Parts
Questions?
We’re changing the world… one password at a time
Dashlane wants to make identity and payment simple and secure everywhere!
31
Want to be a part of life in the Dashlane?
Visit dashlane.com/jobs for all the info!
Dashlane is a premier, award-winning password manager and digital wallet,
intrinsically designed to make identity and payments simple and secure on every
website and every device.
We’re a rapidly growing, tech startup using the world’s best security and privacy
architecture to simplify the lives of more than 3 billion Internet users worldwide.
Since our first product launch in 2013, our brilliant team of engineers and developers
tirelessly work on new coding challenges, build code using the latest up-to-date
frameworks for native development across desktop and mobile, use cutting-edge
web service architecture, and are at the forefront of building applications that help
millions of people every day!
So far, all of our hard work has been paying off! Dashlane was recently recognized
by Google as one of the “Best of 2015” apps! Google also recognized our Android
password manager as an Editors’ Choice winner on the Google Play Store, and
selected Dashlane to demo its adoption of Android M fingerprint technology at
Google I/O!
We work with the latest technology!
Dashlane is dedicated to building high-quality user experiences on Mobile,
Desktop, and on the web using the latest up-to-date technologies and
languages.
See our code in action! Check out some of our projects on Github!
Github.com/Dashlane
In addition, each member of the Dashlane team can take some time to share his
insights in Tech Conferences and become a thought leader in the tech community.
32
Alexis Fogel
@ Droid Con
Goo.gl/7h4guk
Emmanuel Schalit
@ The Dublin
Web Summit
Goo.gl/M4H7vg
Emmanuel Schalit
@ Le Wagon
Goo.gl/kvPLG0
Desktop Mobile
Web App/Server Security
Ready to join #LifeInTheDashlane?
We’re filling our ranks from top to bottom with some of the smartest and
friendliest developers and engineers in the industry! Come join us! Visit
Dashlane.com/jobs to learn more about joining the Dashlane team!
Also visit us here:
September 2015 Confidential
33
Dashlane.com/stackoverflow Dashlane.com/linkedin
Dashlane.com/vimeo Dashlane.com/blog

More Related Content

What's hot

Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler DevelopmentLogan Chien
 
The challenges of file formats
The challenges of file formatsThe challenges of file formats
The challenges of file formatsAnge Albertini
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3Mosky Liu
 
TAUS USER CONFERENCE 2009, Normalization of translation memories
TAUS USER CONFERENCE 2009, Normalization of translation memoriesTAUS USER CONFERENCE 2009, Normalization of translation memories
TAUS USER CONFERENCE 2009, Normalization of translation memoriesTAUS - The Language Data Network
 
Life without CPAN
Life without CPANLife without CPAN
Life without CPANBob Ernst
 

What's hot (7)

Introduction to Compiler Development
Introduction to Compiler DevelopmentIntroduction to Compiler Development
Introduction to Compiler Development
 
The challenges of file formats
The challenges of file formatsThe challenges of file formats
The challenges of file formats
 
NLP Project Full Circle
NLP Project Full CircleNLP Project Full Circle
NLP Project Full Circle
 
Practicing Python 3
Practicing Python 3Practicing Python 3
Practicing Python 3
 
TAUS USER CONFERENCE 2009, Normalization of translation memories
TAUS USER CONFERENCE 2009, Normalization of translation memoriesTAUS USER CONFERENCE 2009, Normalization of translation memories
TAUS USER CONFERENCE 2009, Normalization of translation memories
 
50 shades of PHP
50 shades of PHP50 shades of PHP
50 shades of PHP
 
Life without CPAN
Life without CPANLife without CPAN
Life without CPAN
 

Viewers also liked

Dashlane Engineering Meeting Extract
Dashlane Engineering Meeting ExtractDashlane Engineering Meeting Extract
Dashlane Engineering Meeting ExtractDashlane
 
[Easy] LastPass Password Manager Tutorial
[Easy] LastPass Password Manager Tutorial[Easy] LastPass Password Manager Tutorial
[Easy] LastPass Password Manager TutorialAna Uy
 
U2F in Dashlane
U2F in DashlaneU2F in Dashlane
U2F in DashlaneDashlane
 
Stop Starting Start Finishing
Stop Starting Start FinishingStop Starting Start Finishing
Stop Starting Start FinishingDashlane
 
Scaling an Engineering Team
Scaling an Engineering TeamScaling an Engineering Team
Scaling an Engineering TeamDashlane
 
Portfolio & Roadmap: 2 tools to scale Agile
Portfolio & Roadmap: 2 tools to scale AgilePortfolio & Roadmap: 2 tools to scale Agile
Portfolio & Roadmap: 2 tools to scale AgileDashlane
 
Continuous Learning
Continuous LearningContinuous Learning
Continuous LearningDashlane
 

Viewers also liked (7)

Dashlane Engineering Meeting Extract
Dashlane Engineering Meeting ExtractDashlane Engineering Meeting Extract
Dashlane Engineering Meeting Extract
 
[Easy] LastPass Password Manager Tutorial
[Easy] LastPass Password Manager Tutorial[Easy] LastPass Password Manager Tutorial
[Easy] LastPass Password Manager Tutorial
 
U2F in Dashlane
U2F in DashlaneU2F in Dashlane
U2F in Dashlane
 
Stop Starting Start Finishing
Stop Starting Start FinishingStop Starting Start Finishing
Stop Starting Start Finishing
 
Scaling an Engineering Team
Scaling an Engineering TeamScaling an Engineering Team
Scaling an Engineering Team
 
Portfolio & Roadmap: 2 tools to scale Agile
Portfolio & Roadmap: 2 tools to scale AgilePortfolio & Roadmap: 2 tools to scale Agile
Portfolio & Roadmap: 2 tools to scale Agile
 
Continuous Learning
Continuous LearningContinuous Learning
Continuous Learning
 

Similar to Using TypeScript at Dashlane

Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docxherminaprocter
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docxodiliagilby
 
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet Pôle Systematic Paris-Region
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporationHenryk Konsek
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!Blanca Mancilla
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part維佋 唐
 
Faster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesFaster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesOSCON Byrum
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 DISID
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
GraphQL Relay Introduction
GraphQL Relay IntroductionGraphQL Relay Introduction
GraphQL Relay IntroductionChen-Tsu Lin
 
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017Amazon Web Services
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at ScaleDavid Simons
 
Ember js meetup treviso liquid-fire
Ember js meetup treviso liquid-fireEmber js meetup treviso liquid-fire
Ember js meetup treviso liquid-fireWilliam Bergamo
 
PHP Doesn't Suck - Notes
PHP Doesn't Suck - NotesPHP Doesn't Suck - Notes
PHP Doesn't Suck - NotesJohn Hobbs
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutesOwen Winkler
 
AWS Cloud Experience CA: Democratizando la Inteligencia Artificial
AWS Cloud Experience CA: Democratizando la Inteligencia ArtificialAWS Cloud Experience CA: Democratizando la Inteligencia Artificial
AWS Cloud Experience CA: Democratizando la Inteligencia ArtificialAmazon Web Services LATAM
 
Writing (Meteor) Code With Style
Writing (Meteor) Code With StyleWriting (Meteor) Code With Style
Writing (Meteor) Code With StyleStephan Hochhaus
 

Similar to Using TypeScript at Dashlane (20)

Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
 
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
Y o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docxY o u r  N a m e   L S P  2 0 0 - 3 2 0  ( c o u r s e  I .docx
Y o u r N a m e L S P 2 0 0 - 3 2 0 ( c o u r s e I .docx
 
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
PyData Paris 2015 - Track 3.2 Serge Guelton et Pierrick Brunet
 
Spring scala - Sneaking Scala into your corporation
Spring scala  - Sneaking Scala into your corporationSpring scala  - Sneaking Scala into your corporation
Spring scala - Sneaking Scala into your corporation
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
DevOps introduction
DevOps introductionDevOps introduction
DevOps introduction
 
JavaScript: Core Part
JavaScript: Core PartJavaScript: Core Part
JavaScript: Core Part
 
Faster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypesFaster! Faster! Accelerate your business with blazing prototypes
Faster! Faster! Accelerate your business with blazing prototypes
 
Meteor WWNRW Intro
Meteor WWNRW IntroMeteor WWNRW Intro
Meteor WWNRW Intro
 
Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016 Spring Roo 2.0 Preview at Spring I/O 2016
Spring Roo 2.0 Preview at Spring I/O 2016
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
GraphQL Relay Introduction
GraphQL Relay IntroductionGraphQL Relay Introduction
GraphQL Relay Introduction
 
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017
BigDL: Image Recognition Using Apache Spark with BigDL - MCL358 - re:Invent 2017
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
 
Ember js meetup treviso liquid-fire
Ember js meetup treviso liquid-fireEmber js meetup treviso liquid-fire
Ember js meetup treviso liquid-fire
 
JavaFX, because you're worth it
JavaFX, because you're worth itJavaFX, because you're worth it
JavaFX, because you're worth it
 
PHP Doesn't Suck - Notes
PHP Doesn't Suck - NotesPHP Doesn't Suck - Notes
PHP Doesn't Suck - Notes
 
WordPress in 30 minutes
WordPress in 30 minutesWordPress in 30 minutes
WordPress in 30 minutes
 
AWS Cloud Experience CA: Democratizando la Inteligencia Artificial
AWS Cloud Experience CA: Democratizando la Inteligencia ArtificialAWS Cloud Experience CA: Democratizando la Inteligencia Artificial
AWS Cloud Experience CA: Democratizando la Inteligencia Artificial
 
Writing (Meteor) Code With Style
Writing (Meteor) Code With StyleWriting (Meteor) Code With Style
Writing (Meteor) Code With Style
 

More from Dashlane

Dashlane Triple Track
Dashlane Triple TrackDashlane Triple Track
Dashlane Triple TrackDashlane
 
Dashlane Engineering Culture Book
Dashlane Engineering Culture BookDashlane Engineering Culture Book
Dashlane Engineering Culture BookDashlane
 
The State of Digital Identity
The State of Digital IdentityThe State of Digital Identity
The State of Digital IdentityDashlane
 
Dashlane Mission Teams
Dashlane Mission TeamsDashlane Mission Teams
Dashlane Mission TeamsDashlane
 
Continuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneContinuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneDashlane
 
The Dashlane Agile Journey
The Dashlane Agile JourneyThe Dashlane Agile Journey
The Dashlane Agile JourneyDashlane
 

More from Dashlane (6)

Dashlane Triple Track
Dashlane Triple TrackDashlane Triple Track
Dashlane Triple Track
 
Dashlane Engineering Culture Book
Dashlane Engineering Culture BookDashlane Engineering Culture Book
Dashlane Engineering Culture Book
 
The State of Digital Identity
The State of Digital IdentityThe State of Digital Identity
The State of Digital Identity
 
Dashlane Mission Teams
Dashlane Mission TeamsDashlane Mission Teams
Dashlane Mission Teams
 
Continuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneContinuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at Dashlane
 
The Dashlane Agile Journey
The Dashlane Agile JourneyThe Dashlane Agile Journey
The Dashlane Agile Journey
 

Recently uploaded

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdfSteve Caron
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldRoberto Pérez Alcolea
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfkalichargn70th171
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jNeo4j
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxRTS corp
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxAS Design & AST.
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...kalichargn70th171
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slidesvaideheekore1
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 

Recently uploaded (20)

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
[ CNCF Q1 2024 ] Intro to Continuous Profiling and Grafana Pyroscope.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Keeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository worldKeeping your build tool updated in a multi repository world
Keeping your build tool updated in a multi repository world
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdfPros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
Pros and Cons of Selenium In Automation Testing_ A Comprehensive Assessment.pdf
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4jGraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
GraphSummit Madrid - Product Vision and Roadmap - Luis Salvador Neo4j
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Advantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptxAdvantages of Cargo Cloud Solutions.pptx
Advantages of Cargo Cloud Solutions.pptx
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 
Mastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptxMastering Project Planning with Microsoft Project 2016.pptx
Mastering Project Planning with Microsoft Project 2016.pptx
 
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
The Ultimate Guide to Performance Testing in Low-Code, No-Code Environments (...
 
Introduction to Firebase Workshop Slides
Introduction to Firebase Workshop SlidesIntroduction to Firebase Workshop Slides
Introduction to Firebase Workshop Slides
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 

Using TypeScript at Dashlane

  • 2. The programming language that we use these days for our JavaScript projects
  • 3. The Problem Finding a Solution Settling on TS How it's been so far
  • 5. New Large-Scale Projects These projects have to run in a JS environment: the browser
  • 6. J S is nice, but... It's a dynamic language No static type-checking A lot of errors can go unnoticed when developing Quite easy to break other people's code
  • 7. A Quick Example f u n c t i o n t r a i n i n g F l i g h t ( f l i g h t P l a n , p i l o t ) { i f ( r e q u e s t i n g F l y b y ) { v a r c s = p i l o t . u n i t C a l l s i g n ( ) ; r e t u r n ' N e g a t i v e , ' + c s + ' , t h e p a t t e r n i s f u l l ' ; } } t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ; / / R e s u l t : ' N e g a t i v e , G h o s t r i d e r , t h e p a t t e r n i s f u l l '
  • 8. A Quick Example f u n c t i o n t r a i n i n g F l i g h t ( f l i g h t P l a n , f i g t e r J e t , p i l o t ) { i f ( r e q u e s t i n g F l y b y ) { v a r c s = p i l o t . u n i t C a l l s i g n ( ) ; r e t u r n ' N e g a t i v e , ' + c s + ' , t h e p a t t e r n i s f u l l ' ; } } / / Somewhere e l s e in t h e c o d e , t h i s f u n c t i o n c a l l s t a y s unchanged t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ; The above code compiles fine, but fails at runtime: Uncaught r o p e r t y ed Ty p e Er r o r : Cannot r e a d p ' u n i t C a l l s i g n ' o f u n d e f i n
  • 10. What we'd rather have A static type system, to catch this type of error early and make collaboration easier on a large project Produce more robust code, more resilient to changes Must still be able to run in the browser
  • 12. Compile-To-J S Languages t r a i n i n g F l i g h t = ( f l i g h t P l a n , p i l o t ) - > i f p i l o t . r e q u e s t i n g F l y B y throw ' P a t t e r n I s F u l l ' t r a i n i n g F l i g h t somePlan , p i l o t Write in another language Vanilla JS output Compiler step v a r t r a i n i n g F l i g h t ; t r a i n i n g F l i g h t = f u n c t i o n ( f l i g h t P l a n , p i l o t ) { i f ( p i l o t . r e q u e s t i n g F l y B y ) { throw ' P a t t e r n I s F u l l ' ; } } ; t r a i n i n g F l i g h t ( s o m e P l a n , p i l o t ) ;
  • 14. ...but not many matching our requirements: Statically typed Actively supported Good adoption & community support Good toolchain
  • 15. We narrowed it down to TS and one main alternative...
  • 16. ES6 (+ Flow) ES6 is the next big version of JavaScript It fixes a number of JS quirks It's being implemented in modern browsers, but still requires a compiler for now Flow adds static typing to JS Developed by Facebook /* @flow * / f u n c t i o n fo o ( x : s t r i n g , y : number) : s t r i n r e t u r n x . l e n g t h * y ; }
  • 17. Still not the perfect answer Without Flow, ES6 doesn't offer static type-checking Flow is very young: no adoption/community Little available typings for 3rd-party libraries Windows support non-existing for a long time, now in its very early stages
  • 19. The TS language A superset of JavaScript A statically typed language Open-source, developed by Microsoft
  • 20. Static typing, OO constructs enum engineType { TURBINE, TURBOJET, TURBOFAN } i n t e r f a c e P l a n e { engineType : EngineType t a k e O f f : ( ) => vo i d ; l a n d : ( ) => vo i d ; } c l a s s F14 implements P l a n e { / / C l a s s i m p l e m e nt at io n } f u n c t i o n ge t E n gi n e T yp e s ( p l a n e s: P l a n e [ ] ) : EngineType[] => { r e t u r n p l a n e s . m a p ( p l a n e : Pl a n e => p l a n e . e n g i n e T yp e ) ; }
  • 21. New ES Features i m p o r t { F i g h t e r J e t } from ' . / P l a n e s ' ; / / Module s yn t a x / / Spread o p e r a t o r f u n c t i o n dogFight ( f i g h t e r : F i g h t e r J e t , . . . o p p o n e n t s : F i g h t e r J e t [ ] ) : F i g h t e r J e t / / New ` c o n s t ` and ` l e t ` keywords c o n s t maxSpeed = 1000; / / D e s t r u c t u r i n g l e t [ f i r s t O p p o n e n t , . . . r e s t ] = o p p o n e n t s ; i f ( j e t 1 . h a s M i s s i l e L o c k ( f i r s t O p p o n e n t ) ) { / / Template s t r i n g s c o n s o l e . l o g ( ` m i s s i l e l o c k a c q u i r e d on $ { f i r s t O p p o n e n t . p i l o t . c a l l s i g n } ` ) } }
  • 22. Working with 3rd-party code i n t e r f a c e Async { e a c h < T > ( a r r : T [ ] , i t e r a t o r : As yn c I t e r a t o r < T > , c a l l b a c k ? : E r r o r C a l l b a c k ) : vo i d ; e a c h S e r i e s < T > ( a r r : T [ ] , i t e r a t o r : A s yn c I t e r a t o r < T >, c a l l b a c k ? : E r r o r C a l l b a c k ) : vo i d / / . . . } d e c l a r e v a r async : Async; d e c l a r e module " a s yn c " { e x p o r t = async ; } Integration with 3rd-party libraries through definition files
  • 23. Working with 3rd-party code Public repository of typings available on github Typings are maintained by the community Most widely-used npm packages are available
  • 24. Community & Support Frequent releases (at least every 2 months in 2015) Active community Adopted by several companies and big projects
  • 25. How It's Been So Far
  • 26. New projects being written directly in TS Older projects being refactored to TS for interoperability Adoption
  • 27. Pleasant to work with Smooth learning curve Big changes in the code base are much easier Tooling is awesome! Great with MS's Visual Studio Code: IntelliSense, error reporting It's still just JS! We can require() compiled Maverick code from other vanilla JS modules The Good Parts
  • 28. A Quick Example f u n c t i o n t r a i n i n g F l i g h t ( p l a n : F l i g h t P l a n , j e t : F i g h t e r J e t , p i l o t : F i g h t e r P i l o t) : s t r i n g i f ( r e q u e s t i n g F l y b y ) { l e t c s : s t r i n g = p i l o t . u n i t C a l l s i g n ( ) ; r e t u r n ` N e g a t i v e , ${cs}, t h e p a t t e r n i s f u l l ` ; } } / / Missing t h e ' j e t ' p a r a m e t e r t r a i n i n g F l i g h t ( s o m e P l a n , m a v e r i c k ) ; We now get a compile-time error:
  • 29. In spite of the shared typings repositories, working with external libraries can sometimes be painful Public typings not always up-to-date... ...correcting and sharing the corrected typings can be a a chore The Not-So-Good Parts
  • 31. We’re changing the world… one password at a time Dashlane wants to make identity and payment simple and secure everywhere! 31 Want to be a part of life in the Dashlane? Visit dashlane.com/jobs for all the info! Dashlane is a premier, award-winning password manager and digital wallet, intrinsically designed to make identity and payments simple and secure on every website and every device. We’re a rapidly growing, tech startup using the world’s best security and privacy architecture to simplify the lives of more than 3 billion Internet users worldwide. Since our first product launch in 2013, our brilliant team of engineers and developers tirelessly work on new coding challenges, build code using the latest up-to-date frameworks for native development across desktop and mobile, use cutting-edge web service architecture, and are at the forefront of building applications that help millions of people every day! So far, all of our hard work has been paying off! Dashlane was recently recognized by Google as one of the “Best of 2015” apps! Google also recognized our Android password manager as an Editors’ Choice winner on the Google Play Store, and selected Dashlane to demo its adoption of Android M fingerprint technology at Google I/O!
  • 32. We work with the latest technology! Dashlane is dedicated to building high-quality user experiences on Mobile, Desktop, and on the web using the latest up-to-date technologies and languages. See our code in action! Check out some of our projects on Github! Github.com/Dashlane In addition, each member of the Dashlane team can take some time to share his insights in Tech Conferences and become a thought leader in the tech community. 32 Alexis Fogel @ Droid Con Goo.gl/7h4guk Emmanuel Schalit @ The Dublin Web Summit Goo.gl/M4H7vg Emmanuel Schalit @ Le Wagon Goo.gl/kvPLG0 Desktop Mobile Web App/Server Security
  • 33. Ready to join #LifeInTheDashlane? We’re filling our ranks from top to bottom with some of the smartest and friendliest developers and engineers in the industry! Come join us! Visit Dashlane.com/jobs to learn more about joining the Dashlane team! Also visit us here: September 2015 Confidential 33 Dashlane.com/stackoverflow Dashlane.com/linkedin Dashlane.com/vimeo Dashlane.com/blog