SlideShare uma empresa Scribd logo
1 de 25
SharePoint Saturday Belgium 2016 • October 15 • Brussels Track: Developer | Level: 200
Get Typing with Typescript
David Opdendries (MCT)
@sharepointdavid
PlatinumGoldSilver
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Agenda
• Typescript Introduction
• Typescript and Visual Studio 2015
• Promises
• Modular development with requirejs and Typescript
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript Intro
SharePoint Saturday Belgium 2016 • October 15 • Brussels
A Little About Typescript
• Is a typed superset of JavaScript that compiles into plain JavaScript
• Has ECMAScript 2015 / ES6 syntax but compiles into ES5 or newer
• Typescript makes use of type definitions to give you intellesence
• Typescript 1.0 November 2014
• Typescript 2.0 just got released.
SharePoint Saturday Belgium 2016 • October 15 • Brussels
What is Typescript - Example
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript compiles into JavaScript
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript supports…
• Namespaces
• Classes
• Interfaces
• Inheritance
• Generics
• Enums
• Static methods
https://www.typescriptlang.org/play/index.html
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript Configuration – tsconfig.json
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript definition files
• Provides information about the types.
• https://github.com/DefinitelyTyped/DefinitelyTyped has typing files
for all popular js libraries including the SharePoint JSOM libraries
• Use nuget or npm to download them
• Using typescript files
• Add /// <reference path="jquery.d.ts" /> to the top of your ts file
• Or add the file to the files array in your tsconfig.file.
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript Demo
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Promises
SharePoint Saturday Belgium 2016 • October 15 • Brussels
JavaScript Promises
• A nice clean way to deal with async tasks
• Can be used instead of callbacks. Aka "callback hell"
• No more large amounts of nested code
• Part of ES6
• Not supported in IE11
• Add Promise pollyfill to add support for IE11
• https://github.com/stefanpenner/es6-promise
• http://www.javascriptkit.com/javatutors/javascriptpromises.shtml
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Promise Example
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Promise Example continued
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Promises Demo
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Modular JavaScript
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Why JavaScript Modules
• Instead of having all your code in one file you have several files (or
modules)
• Prevents downloading of unnecessary bytes.
• Load JavaScript on the fly when you need them
• Several Popular libraries
• Require.js
• System.js
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Typescript config
• Set outDir so all typescript files
go to the same directory
• Set module to amd so typescript
compiler knows what type
loader is being used.
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Config
• ES6 promise
pollyfill
recommended.
• Data-main is the
entry point to your
require.js
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Main.ts
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Example of importing
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Promises Demo
SharePoint Saturday Belgium 2016 • October 15 • Brussels
Thank You!
Feedback
http://spsbe.be

Mais conteúdo relacionado

Mais procurados

Iasi code camp 12 october 2013 play oriented development - leon daniel
Iasi code camp 12 october 2013   play oriented development - leon danielIasi code camp 12 october 2013   play oriented development - leon daniel
Iasi code camp 12 october 2013 play oriented development - leon daniel
Daniel Leon
 

Mais procurados (18)

Multisite Implementation Within Nonprofit Organization by Wigid Triyadi
Multisite Implementation Within Nonprofit Organization by Wigid TriyadiMultisite Implementation Within Nonprofit Organization by Wigid Triyadi
Multisite Implementation Within Nonprofit Organization by Wigid Triyadi
 
Extending Piwik At R7.com
Extending Piwik At R7.comExtending Piwik At R7.com
Extending Piwik At R7.com
 
Introduction to Lectures in Apple iClub at DA-IICT
Introduction to Lectures in Apple iClub  at DA-IICTIntroduction to Lectures in Apple iClub  at DA-IICT
Introduction to Lectures in Apple iClub at DA-IICT
 
Intro to the SharePoint Framework Philly Code Camp Oct 2016
Intro to the SharePoint Framework Philly Code  Camp Oct 2016Intro to the SharePoint Framework Philly Code  Camp Oct 2016
Intro to the SharePoint Framework Philly Code Camp Oct 2016
 
ASP.NET 5
ASP.NET 5ASP.NET 5
ASP.NET 5
 
DublinJS: Titanium & Alloy
DublinJS: Titanium & AlloyDublinJS: Titanium & Alloy
DublinJS: Titanium & Alloy
 
How we build project for Open Source
How we build project for Open SourceHow we build project for Open Source
How we build project for Open Source
 
Get IT together
Get IT togetherGet IT together
Get IT together
 
SPS Brussels 2017
SPS Brussels 2017SPS Brussels 2017
SPS Brussels 2017
 
OSGi Web Development in Action
OSGi Web Development in ActionOSGi Web Development in Action
OSGi Web Development in Action
 
TYPO3 and t3kit overview
TYPO3 and t3kit overviewTYPO3 and t3kit overview
TYPO3 and t3kit overview
 
Html5
Html5Html5
Html5
 
Laravel workshop
Laravel workshopLaravel workshop
Laravel workshop
 
Developing XWiki
Developing XWikiDeveloping XWiki
Developing XWiki
 
Drupal's competition
Drupal's competitionDrupal's competition
Drupal's competition
 
Micro frontends with react and redux dev day
Micro frontends with react and redux   dev dayMicro frontends with react and redux   dev day
Micro frontends with react and redux dev day
 
Iasi code camp 12 october 2013 play oriented development - leon daniel
Iasi code camp 12 october 2013   play oriented development - leon danielIasi code camp 12 october 2013   play oriented development - leon daniel
Iasi code camp 12 october 2013 play oriented development - leon daniel
 
XWiki SAS: An open source company
XWiki SAS: An open source companyXWiki SAS: An open source company
XWiki SAS: An open source company
 

Destaque

Presentation - karaoke court
Presentation - karaoke courtPresentation - karaoke court
Presentation - karaoke court
Joanna Lim
 
Benjamin b
Benjamin bBenjamin b
Benjamin b
fbcat
 
Modelo propostas
Modelo propostasModelo propostas
Modelo propostas
chicosobral
 
Características de los seres vivos
Características de los seres vivosCaracterísticas de los seres vivos
Características de los seres vivos
tomypaladino
 
12th_mark_sheet[1]
12th_mark_sheet[1]12th_mark_sheet[1]
12th_mark_sheet[1]
Sandeep Sahu
 
Esquema tema 4
Esquema tema 4Esquema tema 4
Esquema tema 4
sarauno
 

Destaque (20)

Prototype to Product
Prototype to ProductPrototype to Product
Prototype to Product
 
Presentation - karaoke court
Presentation - karaoke courtPresentation - karaoke court
Presentation - karaoke court
 
Benjamin b
Benjamin bBenjamin b
Benjamin b
 
Modelo propostas
Modelo propostasModelo propostas
Modelo propostas
 
Anahi martinez
Anahi martinezAnahi martinez
Anahi martinez
 
L'electricitat atrau
L'electricitat atrauL'electricitat atrau
L'electricitat atrau
 
Características de los seres vivos
Características de los seres vivosCaracterísticas de los seres vivos
Características de los seres vivos
 
ELS FARS
ELS FARSELS FARS
ELS FARS
 
12th_mark_sheet[1]
12th_mark_sheet[1]12th_mark_sheet[1]
12th_mark_sheet[1]
 
Test
TestTest
Test
 
Combinado ciudad con royalton
Combinado ciudad con royaltonCombinado ciudad con royalton
Combinado ciudad con royalton
 
Esquema tema 4
Esquema tema 4Esquema tema 4
Esquema tema 4
 
31.10.2013 MONGOLIAN MINING CORPORATION, Battsengel Gotov
31.10.2013 MONGOLIAN MINING CORPORATION, Battsengel Gotov31.10.2013 MONGOLIAN MINING CORPORATION, Battsengel Gotov
31.10.2013 MONGOLIAN MINING CORPORATION, Battsengel Gotov
 
Kingdom of Saudi Arabia Publishing Industry Analysis: Challenges and Opportun...
Kingdom of Saudi Arabia Publishing Industry Analysis: Challenges and Opportun...Kingdom of Saudi Arabia Publishing Industry Analysis: Challenges and Opportun...
Kingdom of Saudi Arabia Publishing Industry Analysis: Challenges and Opportun...
 
Swimming pool Accessories catalogue
Swimming pool Accessories catalogueSwimming pool Accessories catalogue
Swimming pool Accessories catalogue
 
Typescript - a JS superset
Typescript - a JS supersetTypescript - a JS superset
Typescript - a JS superset
 
Getting Started with TypeScript
Getting Started with TypeScriptGetting Started with TypeScript
Getting Started with TypeScript
 
Typescript for the programmers who like javascript
Typescript for the programmers who like javascriptTypescript for the programmers who like javascript
Typescript for the programmers who like javascript
 
TypeScript kata: The TDD Style
TypeScript kata: The TDD StyleTypeScript kata: The TDD Style
TypeScript kata: The TDD Style
 
TypeScript
TypeScriptTypeScript
TypeScript
 

Semelhante a #spsbe Get Typing with Typescript

Upgrading from Full Trust Code to Add-In Model and SharePoint Framework
Upgrading from Full Trust Code to Add-In Model and SharePoint FrameworkUpgrading from Full Trust Code to Add-In Model and SharePoint Framework
Upgrading from Full Trust Code to Add-In Model and SharePoint Framework
BIWUG
 
Best practices for managing and operating your SharePoint farms
Best practices for managing and operating your SharePoint farmsBest practices for managing and operating your SharePoint farms
Best practices for managing and operating your SharePoint farms
BIWUG
 
The business and end user guide into the new and modern SharePoint
The business and end user guide into the new and modern SharePointThe business and end user guide into the new and modern SharePoint
The business and end user guide into the new and modern SharePoint
BIWUG
 
Microsoft Graph with ASP.NET MVC
Microsoft Graph with ASP.NET MVCMicrosoft Graph with ASP.NET MVC
Microsoft Graph with ASP.NET MVC
BIWUG
 
Extend your development skills set using MS Graph
Extend your development skills set using MS GraphExtend your development skills set using MS Graph
Extend your development skills set using MS Graph
BIWUG
 

Semelhante a #spsbe Get Typing with Typescript (20)

Upgrading from Full Trust Code to Add-In Model and SharePoint Framework
Upgrading from Full Trust Code to Add-In Model and SharePoint FrameworkUpgrading from Full Trust Code to Add-In Model and SharePoint Framework
Upgrading from Full Trust Code to Add-In Model and SharePoint Framework
 
Spsbe2016 extend your office 365 environement to cross-platform apps
Spsbe2016   extend your office 365 environement to cross-platform appsSpsbe2016   extend your office 365 environement to cross-platform apps
Spsbe2016 extend your office 365 environement to cross-platform apps
 
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
 
Power Users Guide to Office 365 - SharePoint Saturday Belgium 2016 #spsbe
Power Users Guide to Office 365 - SharePoint Saturday Belgium 2016 #spsbePower Users Guide to Office 365 - SharePoint Saturday Belgium 2016 #spsbe
Power Users Guide to Office 365 - SharePoint Saturday Belgium 2016 #spsbe
 
Best practices for managing and operating your SharePoint farms
Best practices for managing and operating your SharePoint farmsBest practices for managing and operating your SharePoint farms
Best practices for managing and operating your SharePoint farms
 
SharePoint Saturday Belgium 2017 - The Business and end-user guide into the n...
SharePoint Saturday Belgium 2017 - The Business and end-user guide into the n...SharePoint Saturday Belgium 2017 - The Business and end-user guide into the n...
SharePoint Saturday Belgium 2017 - The Business and end-user guide into the n...
 
The business and end user guide into the new and modern SharePoint
The business and end user guide into the new and modern SharePointThe business and end user guide into the new and modern SharePoint
The business and end user guide into the new and modern SharePoint
 
Use PowerShell superpower to tame your Office 365
Use PowerShell superpower to tame your Office 365Use PowerShell superpower to tame your Office 365
Use PowerShell superpower to tame your Office 365
 
aOS Day Brussels December 2016
aOS Day Brussels December 2016aOS Day Brussels December 2016
aOS Day Brussels December 2016
 
Microsoft Flow Advanced : tips, pitfalls, problems to be known before staring...
Microsoft Flow Advanced : tips, pitfalls, problems to be known before staring...Microsoft Flow Advanced : tips, pitfalls, problems to be known before staring...
Microsoft Flow Advanced : tips, pitfalls, problems to be known before staring...
 
Microsoft Flow Advanced: tips, pitfalls, problems
Microsoft Flow Advanced: tips, pitfalls, problemsMicrosoft Flow Advanced: tips, pitfalls, problems
Microsoft Flow Advanced: tips, pitfalls, problems
 
SharePoint and javascript – modern development
SharePoint and javascript – modern developmentSharePoint and javascript – modern development
SharePoint and javascript – modern development
 
SharePoint et Javascript - Modern development - Yannick Plenevaux - Christoph...
SharePoint et Javascript - Modern development - Yannick Plenevaux - Christoph...SharePoint et Javascript - Modern development - Yannick Plenevaux - Christoph...
SharePoint et Javascript - Modern development - Yannick Plenevaux - Christoph...
 
DevOps, PowerShell y Windows Containers - NET Conf UY v2016
DevOps, PowerShell y Windows Containers  - NET Conf UY v2016DevOps, PowerShell y Windows Containers  - NET Conf UY v2016
DevOps, PowerShell y Windows Containers - NET Conf UY v2016
 
SPS Brussels 2016 - From design to a modern style guide branding strategies...
SPS Brussels 2016 - From design to a modern style guide   branding strategies...SPS Brussels 2016 - From design to a modern style guide   branding strategies...
SPS Brussels 2016 - From design to a modern style guide branding strategies...
 
SPSBE2016 - Leverage the power of groups
SPSBE2016 - Leverage the power of groupsSPSBE2016 - Leverage the power of groups
SPSBE2016 - Leverage the power of groups
 
SPUnite17 Introducing Logic Apps
SPUnite17 Introducing Logic AppsSPUnite17 Introducing Logic Apps
SPUnite17 Introducing Logic Apps
 
Microsoft Graph with ASP.NET MVC
Microsoft Graph with ASP.NET MVCMicrosoft Graph with ASP.NET MVC
Microsoft Graph with ASP.NET MVC
 
Extending Teams & Groups
Extending Teams & GroupsExtending Teams & Groups
Extending Teams & Groups
 
Extend your development skills set using MS Graph
Extend your development skills set using MS GraphExtend your development skills set using MS Graph
Extend your development skills set using MS Graph
 

Mais de David Opdendries

Mais de David Opdendries (6)

Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
Azure SignalR - Another tool in the toolbeld
Azure SignalR - Another tool in the toolbeldAzure SignalR - Another tool in the toolbeld
Azure SignalR - Another tool in the toolbeld
 
SharePoint Saturday Vienna Slides
SharePoint Saturday Vienna Slides SharePoint Saturday Vienna Slides
SharePoint Saturday Vienna Slides
 
SharePoint Saturday Oslo - Introduction to Durable Functions in Azure
SharePoint Saturday Oslo - Introduction to Durable Functions in AzureSharePoint Saturday Oslo - Introduction to Durable Functions in Azure
SharePoint Saturday Oslo - Introduction to Durable Functions in Azure
 
SharePoint Saturday Johannesburg 2017
SharePoint Saturday Johannesburg 2017SharePoint Saturday Johannesburg 2017
SharePoint Saturday Johannesburg 2017
 
Supercharge your csom skills
Supercharge your csom skillsSupercharge your csom skills
Supercharge your csom skills
 

Último

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

#spsbe Get Typing with Typescript

  • 1. SharePoint Saturday Belgium 2016 • October 15 • Brussels Track: Developer | Level: 200 Get Typing with Typescript David Opdendries (MCT) @sharepointdavid
  • 3. SharePoint Saturday Belgium 2016 • October 15 • Brussels Agenda • Typescript Introduction • Typescript and Visual Studio 2015 • Promises • Modular development with requirejs and Typescript
  • 4. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript Intro
  • 5. SharePoint Saturday Belgium 2016 • October 15 • Brussels A Little About Typescript • Is a typed superset of JavaScript that compiles into plain JavaScript • Has ECMAScript 2015 / ES6 syntax but compiles into ES5 or newer • Typescript makes use of type definitions to give you intellesence • Typescript 1.0 November 2014 • Typescript 2.0 just got released.
  • 6. SharePoint Saturday Belgium 2016 • October 15 • Brussels What is Typescript - Example
  • 7. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript compiles into JavaScript
  • 8. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript supports… • Namespaces • Classes • Interfaces • Inheritance • Generics • Enums • Static methods https://www.typescriptlang.org/play/index.html
  • 9. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript Configuration – tsconfig.json
  • 10. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript definition files • Provides information about the types. • https://github.com/DefinitelyTyped/DefinitelyTyped has typing files for all popular js libraries including the SharePoint JSOM libraries • Use nuget or npm to download them • Using typescript files • Add /// <reference path="jquery.d.ts" /> to the top of your ts file • Or add the file to the files array in your tsconfig.file.
  • 11. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript Demo
  • 12. SharePoint Saturday Belgium 2016 • October 15 • Brussels Promises
  • 13. SharePoint Saturday Belgium 2016 • October 15 • Brussels JavaScript Promises • A nice clean way to deal with async tasks • Can be used instead of callbacks. Aka "callback hell" • No more large amounts of nested code • Part of ES6 • Not supported in IE11 • Add Promise pollyfill to add support for IE11 • https://github.com/stefanpenner/es6-promise • http://www.javascriptkit.com/javatutors/javascriptpromises.shtml
  • 14. SharePoint Saturday Belgium 2016 • October 15 • Brussels Promise Example
  • 15. SharePoint Saturday Belgium 2016 • October 15 • Brussels Promise Example continued
  • 16. SharePoint Saturday Belgium 2016 • October 15 • Brussels Promises Demo
  • 17. SharePoint Saturday Belgium 2016 • October 15 • Brussels Modular JavaScript
  • 18. SharePoint Saturday Belgium 2016 • October 15 • Brussels Why JavaScript Modules • Instead of having all your code in one file you have several files (or modules) • Prevents downloading of unnecessary bytes. • Load JavaScript on the fly when you need them • Several Popular libraries • Require.js • System.js
  • 19. SharePoint Saturday Belgium 2016 • October 15 • Brussels Typescript config • Set outDir so all typescript files go to the same directory • Set module to amd so typescript compiler knows what type loader is being used.
  • 20. SharePoint Saturday Belgium 2016 • October 15 • Brussels Config • ES6 promise pollyfill recommended. • Data-main is the entry point to your require.js
  • 21. SharePoint Saturday Belgium 2016 • October 15 • Brussels Main.ts
  • 22. SharePoint Saturday Belgium 2016 • October 15 • Brussels Example of importing
  • 23. SharePoint Saturday Belgium 2016 • October 15 • Brussels Promises Demo
  • 24. SharePoint Saturday Belgium 2016 • October 15 • Brussels Thank You!