As we are all aware that Microsoft recommending its clients to use Modern Sites over Classic Sites to fulfill Cloud First, Mobile First strategy and it is very clear about user Experience in SharePoint too. There are a lot of differences between Modern Sites and Classic Site; I am not going to discuss that in this article. To customize Modern sites Microsoft introduces a new development Model called SharePoint Framework is known as SPFx.
The SharePoint Framework (SPFx) is a page and web part model that provides full support for client-side SharePoint development, easy integration with SharePoint data, and support for open source tooling.
In old School SharePoint, The development will be mostly on Server Side, all the apps and web parts are developed using C#, .Net Framework along with the SharePoint object model. Now a day we are in a cloud world where we can access, host and develop applications on Cloud with the help of a dedicated tooling chain. If we compare the development tolling chain in the old vs new SPFx development its looks like the image shown below.
:-
Now let us discuss all the client-side development options out there in SharePoint and the differences between each of them.
each of them.
Script Injection:-
Most of the developers use it and like it because it is an easy way to interact with SharePoint data and DOM manipulations. These cannot be used in Modern Sites. More error-prone to accidental deletion by the users.
SharePoint App:-
These are developed using Visual studio with add-in model templates. Iframes is the most annoying thing in terms of UI/UX concern. Cannot Access SharePoint DOM Directly so for small changes we need to access SharePoint API or REST. Deployment is not as smooth as expected.
SPFx WebParts:-
Uses Modern opens source toolchain for development, by extending the capability of the node we can use any of the available components in Node js. Integration with Office 365 Including Azure, MS Graph API, and OneDrive and office outlook integration increases the scalability of the app. You can deploy anywhere you want like public CDN, SharePoint CDN or Azure CDN.
When to user SPFx:-
Starting from today, we can user SPFx in all types of development scenarios in Office 356 and on-prem. There are only scaffolding templates available for now and they are
SPFx WebParts
No Javascript Framework.
React
Knockout.
Extensions
Application customizer
There will be two placeholders imported from the SP application base named Top and Bottom Place holders.
If your requirement fit in any of the above templates, you can start using it.
Limitation of SPFx:-
Like all the Development models, there are few downsides for SharePoint Framework too.
we can achieve RunwithElivatedPrivilages kind of functionality.