21
SharePoint Framework, Angular & Azure Functions The modern SharePoint developer tool belt Sébastien Levert

SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Embed Size (px)

Citation preview

Page 1: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

SharePoint Framework, Angular & Azure Functions

The modern SharePoint developer tool belt

Sébastien Levert

Page 2: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Sponsors

Page 3: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Hi! I’m Seb!

@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at

Page 4: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Agenda

Page 5: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

SPFx + Angular

Page 6: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Angular… But which version ?

• Works well with Angular 1.6

• Works OK with Angular 2

• Works awesome with Angular 4 (Did you just say Angular 4!?)

Page 7: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Is that even possible ?

• Some are thinking it is mission impossible… But it is! And it’s much more simpler than you think.

• You have the full power of Angular within you own SPFx webparts

• Multiple webparts can exist in a page, including their own routing configuration

Page 8: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

What are the limitations?

• Size of the bundle is huge, watch for performance issues!

• Webpack becomes slow when compiling your TypeScript code

• Not built in to SPFx, so you need to build your own wrapper (I have code for that!)

• Some variables are still global in Angular, it can become problematic in complex solutions.

Page 9: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Lessons learned

• Never use any class or ids from the DOM. Always use the ViewChild attribute.

• You can use html templates using the require() approach. Try to do that with React!

• When you have a strong AngularJS background, it feels just a little bit weird to move to Angular, but you will get used to it!

Page 10: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Technology

Page 11: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Why Azure Functions ?

• Cheap way to host any API in Azure

• You can use your favorite language

• Super cheap to run

• Perfect companion for any Single Page Application or any JavaScript component

Page 12: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Our scenario

• Using the PnP PowerShell Cmdlets

• Connecting to the Microsoft Graph and to an Azure AD Application

• Creating a Modern Team Site (in under 15 seconds) based on a set of parameters

• Boom!

Page 13: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Make it happen

Page 14: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

The full scenario

• Build a SharePoint Framework WebPart

• Use Angular as our main Framework

• Include 3 routes (Home, New Site and Site Information)

• Use Azure Function as my backend provisioning API

• Use the Office UI Fabric components

Page 15: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

What about the Office UI Fabric ?• Well… You have 2 choices : Build or Reuse

• My choice ? Reuse !

• But Seb… It’s Angular, I can’t reuse what does not exist…

• Well… The React components exist, just reuse them !

Page 16: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Next Steps

Page 17: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Resources

• https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/angular2-prototype• https://dev.office.com/sharepoint/docs/spfx/sharepoint-fr

amework-overview• http://dev.office.com/fabric#/components

Page 18: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Samples

• https://github.com/sebastienlevert/spfx-angular-poc

Page 19: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Share your experience

• Use hashtags to share your experience• #Office365Dev• #MicrosoftGraph• #AzureFunctions

• Log issues & questions to the GitHub Repositories

Page 20: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Sponsors

Page 21: SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Functions

Thank you!

@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at