Things are moving fast. Sometimes you might even feel that you own comfort zone is getting of control. But in a Mobile-First, Cloud-First world, things are changing to a crazy pace and to stay on the top of your game, you need keep up with the latest and greatest technologies that are available out there. By staying up to date, you will give to yourself new options that will let you be more productive, write better code and push you in a more open and more collaborative world.
With the official shipment of Angular 4 and the current release of the SharePoint Framework, it is now the time to start moving towards those new technologies in your SharePoint Solutions.
In this session, we will cover the modern tool belt of the SharePoint developer by covering the SharePoint Framework as the new surface to express yourself, Angular as a Framework to enable you to build complete applications within your SharePoint modern experiences and Azure Function as the perfect server-side companion for all your Office 365 & Azure development.
This very demo-intensive session will make sure that at the end you get those 3 key takeaways :
- Understand the role of the SharePoint Framework, Angular and Azure Functions in this Cloud-First, Mobile-First world
- Have a complete sample where the modern tool belt is relevant and useful in a real-world scenario
- Change the way you will think for your next SharePoint project
6. 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!?)
7. 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
18. 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
19. Our scenario
• Using the PnP PowerShell Cmdlets
• Connecting to the Microsoft Graph and to an Azure AD Application
• Creating a ModernTeam Site (in under 15 seconds) based on a set of
parameters
• Boom!
21. 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
22. 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 !
23. Downsides
• Can’t use the CLI to build new components and slow to compile
• Can’t use AOT to reduce the bundle size
• Lots of “hacks” in code that make this approach…
• Clearly not SPCAF compliant!
24. Lessons learned
• Never use any class or ids from the DOM. Always use theViewChild
attribute.
• You can use html templates using the require() approach.Try to do
that, 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!
25. And… Should I use it in production?
• As of today, this approach is the only approach that works.
• Use it to experiment, to learn the SharePoint Framework and
Angular altogether.
• Will require a lot of maintenance with new versions of SPFx… In
short, I would not go all in right now… But…
30. Sharing is caring
• Use hashtags to share your experience
• #Office365Dev
• #MicrosoftGraph
• #AzureFunctions
• #SPFx
• Log issues & questions to the GitHub Repositories