Vince365

    • 8/1/2018

    New SharePoint Framework PnP Samples available: using the Skype UCWA Web SDK to subscribe to people’s status

    TL;DR;

    I added two new SharePoint framework WebParts PnP sample to demonstrate how to use the Unified Communications Web API JavaScript SDK from Skype for business. This SDK allows you to do things like subscribe to a person status, start instant messaging conversations, calls…

    To get a look:

    Long version

    I recently had the occasion to make my first contribution to PnP (besides creating issues and helping investigate those). In these two new samples I show you how to you how to leverage the Skype UCWA SDK to subscribe and display people skype status.

    That skype status will update itself it changes (ie: the target user sets his/her status to something different in Skype for business or goes offline).

    This approach is better than the previous ones leveraging office integration, activeX or the SharePoint File User Status because:

    • It is cross platform (doesn’t need activeX, Internet Explorer, or security zones configuration)
    • It does not require Office to be installed on the machine or the user to be singed in Skype for Business
    • It updates with status changes
    • It does not need a file to be created and can be rendered anywhere on the page
      • (the file presence indicator is SharePoint talking to the Skype server and rendering some HTML, but it only does so in libraries)

    The UCWA

    The API itself is a bit peculiar a doesn’t necessary works like a “standard API” (OAuth + REST). The key differences being:

    • You can subscribe to some of the object model (status, conversations, audio/video feeds…)
    • Authentication is a bit (too) complex
      • It’s not standard and expects you to get a 403 in order to get the identity provider information
      • The discovery server also acts like a relay and the “API” is segmented in multiple resources (besides the permissions) which necessitates multiple rounds of authorization.
    • Not OData capable (we got used to that in the Microsoft world)

    All those differences impart the few SDK’s. The JS SDK (the one used in the samples) is a bit “old fashioned”. I really wish they spent some time:

    • Moving to UMD and not a global var
    • Providing npm packages and not a single bundle on the CDN
    • Providing types definitions
    • Providing better version information (+ semver)
    • Allowing developer to leverage their own auth libraries (like hellojs or msal) instead of the implementation the have bundled.

    Those are the main reasons why I’m side loading the script and not including it as an external dependency in the samples.

    Lastly, the documentation is a little bit all over the place, I’d suggest you corroborate the information even from official sources because it looks like some of the documentation hasn’t been updated. Here are the entry points:

     

    Microsoft Teams vs Skype

    The skype for business API’s are still not available through the Microsoft Graph. And Microsoft announced that Microsoft Teams is going to be the future for unified communications, instant messaging and so much more. However, Skype for business Server is going to keep being the backend (and at least provide some of the APIs) for a least a few years.

    • 5/1/2018

    Speaking at SharePoint Fest DC (Washington) 2018

    SharePoint Fest DC (Washington) 2018 is happening from March 26th to March 30th. This event will feature 2 days pre-conference workshops and 3 days of conference. You can find more information about it on the website. I’ve been selected amongst 44 other speakers to present this year two sessions:

    AZR204 – Microsoft Graph and SharePoint framework under steroids with Azure Functions

    Modern development means client side first, backend second. However, there are still cases where you might need some backend processing, for long running operations, heavy computing consuming tasks or security concerns.

    During that session we will learn how you can build server-less solutions to support modern development. We will determine together when it makes sense to offload things on the backend and when is does not. We will have a lot of examples working with the Microsoft Graph as well as the SharePoint Framework.

    Finally, we will see that server-less does not mean hacky solutions and that proper continuous integration and deployment processes can be implemented.”

    More information here.

    DEV 302 - Is it possible to do DevOps with the SharePoint framework?

    You had it all right with solutions and add-ins. Your release pipeline was set up. Do new technologies and methodologies mean starting over?

     

    Don’t panic I’m here to help! Together we’ll see how to set up a devops pipeline for SPFX developments with:

     Automated builds

     Automated deployments

     Automated tests

     Code quality check

    There will be a lot of demonstrations during this session and we’ll be mostly using Visual Studio Team Services/Team Foundation Server.

    This session is mostly meant for develops, architects, quality assurance people…

    More information here.

    I’m truly honored to be part of this prestigious event with so many other great SharePoint/Office 365 speakers. If you haven’t booked your ticket to the event yet, go ahead!

    See you there.

    • 3/1/2018

    Full version of lodash now available in the SharePoint Framework

    TL; DR;

    Microsoft replaced @types/es6-collections by the es2015.collection library in version 1.4.0 of the packages. Those had a conflicting definition of weakmap which caused issues with packages like lodash.

    Long version

    Microsoft recently release v1.4.0 of the SharePoint Framwork and it’s packages. It contains a lot of improvements and one of those probably went unnoticed by many of us.

    @types/es6-collections has been replaced by es2015.collection library (native, comes with the compiler/JS Engines). That package had a “special” definition of WeakMap (among other things) which was causing numerous packages not to work properly, include one of my favorites: lodash.

    To workaround that issue, Microsoft had to provide @microsoft/sp-lodash-subset which as it name indicates, is only a subset of lodash and didn’t provide useful methods like map.

    Which one should I use?

    This is something that’s hard to say at the moment, I’ll give you the pro’s and con’s instead for using the subset

    Pro’s:

    • The subset is lighter, which means faster load times for your users
    • The subset is maintained/checked by Microsoft, which means less likely to break SPFX

    Con’s

    • The subset doesn’t have all the lodash features, which means you might have to do more things manually
    • The subset is maintained by Microsoft, which means improvements in lodash won’t get to us as fast
    • The subset is not on a CDN, which can impact your load times depending on a lot of other considerations (HTTP2, quality of your CDN…)
    • The subset might not be around for long, considering it represents extra work for Microsoft, they might deprecate it to focus on other things

     

    Now all that being said, nothing prevents you from using both in parallel and the upgrade path (from subset to full version) is fairly easy once you’re on SPFX >= 1.4.0: it’s about a couple of text replace.