In continuation to my previous blog on “Evolution of SharePoint from Server side to Client Side” I have written this blog. In this blog, I am going to discuss in detail about the new SharePoint Framework along with its advantages, disadvantages and how it will add a value to the current SharePoint scenario.
So, let’s start!
SharePoint Framework (SPFx)
Finally, in SharePoint 2016, Microsoft came with another development model named as SharePoint Framework (SPFx). In SharePoint 2016, server object model is still supported but for on-premises farm only, only declarative sandbox solutions are allowed i.e. no code sandbox solutions, and Add-In model is still supported. Since SharePoint 2016 is majorly focusing on cloud or hybrid cloud environment now so it must come up with some approach which servers best on both i.e. on-prem as well as cloud. Also in recent trend, we had seen Microsoft is adapting cross platform and even making its tool cross platform (like PowerShell, MS Office), so why not a cross platform development technique for its cloud? SPFx could be one step into that direction.
Advantages:
- Client Side: As discussed above, the server side solutions can damage a site collection to an entire SharePoint farm when not used wisely, whereas the risk eradicates when using client side technique.
- Fast, Lightweight and Responsive: SPFx uses NodeJS and is completely client side so makes it fast and mobile ready. Also, SPFx is fully compatible with Office Fabric UI, which makes it responsive as well. Altogether, the framework is consisting of all the latest web development technologies.
- Run on User Context: Since the complete framework runs on user context, so only permissible item to user will be shown.
- Works in Classic as well as Modern Pages: The advantages of SPFx is that it works on both modern as well as classic page. So, either your online tenant is running on old SharePoint 2013 site collection with classic mode only or you upgraded to latest tenant feature, be relaxed, SPFx covered these.
- Custom Properties: Earlier when user had to write client side code, they need to create extra variables and makes fetch calls to get those configurations. But now, with SPFx this comes in a very handy way, where user can create properties for client side web parts and configure it as per need.
- Deployment Mechanism: With SPFx, finally SharePoint provides a deployment mechanism. The deployment mechanism consists of bundling the app, packaging the app, shipping the app to store (or to local SharePoint App Catalog) and with proper permission one can deploy it to their tenant. This provide a better way to manage client side component.
- Scalable: As mentioned above, SPFx is not limited to SharePoint, user can take advantages of NodeJS (backbone of SPFx) and can use any of the component available in NodeJS by community (not SharePoint but NodeJS community). Also with the development Microsoft Graph API, user can make their web part interact with rest of the Office365 including Azure, One Drive, Outlook tec.
- Remote Development: Once somebody asked me, what is the worst thing about SharePoint according to you? Hmm, there are few, but the one I hate most was the development environment. One must have a Windows Server OS running with SharePoint configured on it and the only development tools available was Visual Studio. This environment requirement bothers me a lot. SPFx comes with a fully client side development approach, i.e. you can develop the component on any machine wither it runs on a Windows, Mac or Linux. And of course, you don’t need to have Visual Studio even to develop SPFx web parts, all you require is a simple text editor of your choice and you are good to go (obviously, you have to install the environment though i.e. NodeJS, Gulp and Yeoman template of framework)
- Local Workbench: Even if you are not connected to the internet, don’t worry, you can still develop on SPFx as it comes with a local workbench. The local workbench is capable of developing and testing the client side web part.
Disadvantages:
- Everything is client side: Since everything is client side, creating business critical web part using SPFx is not what one must prefer. The client side web parts are easy to reverse engineered and one can easily extract your business logic as its all JavaScript at the end of the day.
- New Environment: For classic SharePoint developers (i.e. majorly worked on Farm Solution, C# client object model only), it’s a completely new thing. Starting from NodeJS to Typescript to Webpacks, to gulp everything will be new to classic developers.
SharePoint Framework is open source and maintained by open source community. As of now, the SharePoint Framework can deliver fully functional client side web parts. But considering the development of new APIs by Microsoft, like Microsoft Graph API, one can leverage the SPFx to manage the entire cloud service starting from SharePoint to Outlook, OneDrive, OneNote and even the Azure and list will keeps continuing. Let’s discus some of the advantages and disadvantages of SPFx.