Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

SPUnite17 TypeScript for SharePoint Developers

SharePoint Unite 2017 Session

  • Be the first to comment

SPUnite17 TypeScript for SharePoint Developers

  1. 1. Elio Struyf Waldek Mastykarz October 26th, 2017 TypeScript for SharePoint Developers
  2. 2. What is TypeScript?
  3. 3. It’s a strongly-typed superset of JavaScript
  4. 4. Benefits of using TypeScript • Allows for large-scale JavaScript applications • Follows ECMAScript future proposal • Supports plain-old JavaScript • Not excluding any JavaScript feature • Improved consistency • IDE support (e.g. Intellisense) • Compile-time type checking
  5. 5. Benefits of using TypeScript
  6. 6. Hey, show us some code!
  7. 7. How to use TypeScript in SharePoint projects
  8. 8. Where to use it? • SharePoint Framework • JSLink • Display templates • CEWP / SEWP • Custom actions • Single Page Application • Add-ins
  9. 9. Prerequisites VSCode • Node.js • npm • TypeScript compiler Visual Studio • TypeScript add-in for VS • NuGet • MSBuild targets configuration
  10. 10. When to use what? VSCode • SharePoint Framework • JSLink • Display templates • CEWP / SEWP • Custom actions • Single Page Application Visual Studio • SharePoint Framework • Add-ins
  11. 11. Using TypeScript in VSCode
  12. 12. - Install: npm install -g typescript - Create a TS file - Run: tsc index.ts --target ES5 - Use the JS file Steps to start writing
  13. 13. Tip: use a tsconfig.json file to simplify things
  14. 14. But, how do you get intellisense?
  15. 15. By declaration / definition files: *.d.ts
  16. 16. npm install @types/<module> --save-dev
  17. 17. Display Templates Demo
  18. 18. Using TypeScript in Visual Studio
  19. 19. But, how do you get intellisense?
  20. 20. Use NuGet to install definitions
  21. 21. Add-inDemo
  22. 22. Questions?

×