SharePoint Framework vs Sharepoint apps vs Sharepoint solutions

  • “I’m so confused with all this SharePoint Framework, apps, solutions…I just wanted to develop for Sharepoint!”
  • “What can I use SharePoint Framework (SPFx) for? Can I use it for branding?”
  • “When should I pick custom SharePoint solution over SharePoint Framework or SharePoint App?
  • “How can I make elevated privilages in sharepoint hosted app?”

During our years of experience in SharePoint development we’ve seen those questions many times. They were asked by IT devs of our clients, by users of tech blogs/forums and also by ourselves (yes, we’re learning all the time!). Since you’re here we assume that you are confused a little bit too but don’t worry. We know what you feel. That’s why we’ve created this post.

At Findwise we work with improving the SharePoint experience on a daily basis. If you want to know more about our areas and offers visit our site.


Disclaimer:

In this post we’re focusing on solution for SharePoint Online. Solutions for Sharepoint On-prem are not part of this post. However remember that anything that works for SPO also works for SP 2013/2016.


Sharepoint Online Development

When you think about making some Sharepoint Online customizations using code you need to be aware of one main thing – Microsoft don’t want you to install ANY server code (dll, exe etc). In other words to develop for Sharepoint Online you have 3* choices:

  1. Create solution in declarative way
  2. Write code on environment other than Sharepoint Online and work with SPO from there
  3. Develop solution with client-side code 

In this post we prepared for you a quick overview over all above options and in the conclusion part you can find great cheat sheet that helps you to pick proper approach due to develop solution for Sharepoint Online.

* – not long time ago there was also 4th option: Napa application. It was browser-based quick tool to build an app for Sharepoint, Excel, Office 365 Task Pane or Mail. However it have been fully retired on March 31, 2017 so Office and SharePoint add-ins remain a key avenue for connecting your applications to where users get work done within Office 365. 

Create solution in declarative way

If you want to develop solution in declarative way there are two ways:

  1. use Sandbox solution – this approach allows you only to deploy lists, content types, columns, buttons (so called custom actions), files, webparts that use only JS – in other words all stuff related to module in sharepoint project. However you CANNOT deploy any custom code so remember – no custom code support in sandbox solutions. Be aware that by default sandbox solutions created in Visual Studio includes a dll. To make fully declarative solution you need to disable that in project properties.
  2. use SharePoint Framework – yes, SPFx can do that too. In the background there is no difference between SPFx and Sandbox – you need to prepare module.xml file that will contains or declarative instructions (written in XML) that SharePoint will do. So you achieve same results as you would make Sandbox solution.
    BUT! There is one  main deficiency of SPFx approach – there is NO easy builder or automatic tool that allows you to quickly build such module. So you’ll need to build it manually from scratch…which may be the road through the torment. Sandbox solution, developed via Visual Studio 2017, has such tools so you can always build module.xml there and copy that to SPFx project.

Build solution on environment other than SPO

There are two main options:

  1. Provider hosted Sharepoint App – you develop it in the same manner as any other Sharepoint App (or Add-in as Microsoft wants to name it) but you deploy it on your own environment (IIS/Azure). On SharePoint there is only deployed manifest of your app (+ any kind of sharepoint related stuff like lists, libraries etc). The logic part lays outside Sharepoint as typical web application (that you could use anywhere else) with provided SharePoint Context. Such remote component allow you to delegate part of the work outside the SPO (i.e. event receivers). It’s also the only way to run code in “elevated mode” in Sharepoint App (it’s not really elevated but rather it’s an app privilages so it actually depends on the app permissions in app catalog)
  2. Your custom application (console app, web service, powershell – you name it) that connects to SPO using CSOM or REST/Graph API or PnP*. However be aware that in this scenario communication from SharePoint to your app is not supported. So this approach is good for some basic configuration of your architecture, one-way sync, data fetching, log gathering or any kind of analytics.

* if you do not know it – do that immidiately! Although it’s just a CSOM wrapper it really speeds up developing and authentication handling

Develop solution with client-side code

This is a big topic so in this post we want to give you main view of options:

  • SPFx – so called Sharepoint Framework is the special framework mainly designed for creating pages, web parts and any kind of front-end apps. Getting more and more popular nowadays since it’s promoted on biggests European Sharepoint conferences – but not without a reason. For the first time of many years of SP dev tools Microsoft understand that in order to keep leading edge means: “if you want to make web, stay with web technologies”. In other words as a developer you need to be able to:
    • quickly an easily test your work
    • develop on any platform
    • use ANY kind of front-end framework (JS lib) 
      And this is what SPFx is.
    • If you know Angular/ReactJS, use Grunt/Gulp/Webpack, use npm and git – you will feel like fish in a water
    • if your IDE can do npm commands then you can do SPFx solutions
    • There is so called “Workbench” which is local hosted environment that mockups in a way SharePoint environment (with context and stuff). So you can test and check your app without need of deploying it on SharePoint. If you want to know more – check this SharePoint Framework overview.
  • Sharepoint hosted Sharepoint App – all components are hosted in SPO (in app web which is a subsite of host web). Moreover you can only do things in context of a user and only web-scoped features. However if you think about using SP hosted App you should rather use SPFx. 
  • Sandbox solution – There is nothing that blocks you from adding Sharepoint sanbox solution with some html and javascript. However this approach can be not enough if you want to make some additional configuration for Sharepoint site.

Conslusion

In order to pick proper approach you can consider below composition:

Sandbox solution

Custom application

Sharepoint app

SPFx

Deploy assets like lists, content types, columns, buttons (so called custom actions), files, webparts that use only JS

yes

Maybe

*but kind of an overkill

Maybe

*if only it may be on another site collection

Maybe

*but a bit hard in use for now. Hope it will change in the future

Application that contains only page/webparts and some JS

yes

no

Maybe

*you can, however you’ll need to put app part on your host web due to display page from app web

yes

Custom server code

no

yes

yes

*only with sharepoint provider hosted app

maybe

*you need to create web api hosted outside sharpeoint and make REST calls to it from SPFx. Which is basically very similar to SharePoint provided hosted app

Sharepoint configuration

no

yes

no

no

Sharepoint branding

Maybe

*you can deploy masterpages and stuff but you will need to do  some configuration changes (script/manually)

yes

no

Maybe

*you can deploy masterpages and stuff but you will need to do  some configuration changes (script/manually)

Event receiver

no

yes

yes

*only with sharepoint provider hosted app

No

Job

no

yes

yes

*only with sharepoint provider hosted app

No

Add content/Migrate

Maybe

*if it’s just adding files you can use module item for that

yes

no

Maybe

*if it’s just adding files you can use module item for that

If I miss something, mark something wrong or if you just want to share your thought – leave me a comment down below.

Thank you for your time spent on reading this post – I hope it brought you a value.

P.S.
Do you recognize below question?
“There are SharePoint SSOM API, CSOM API, JSOM API, REST API, GRAPH API, PnP…argh…cannot there be only one API that I can learn and use?”
We’ll cover this subject too soon so keep reading us 🙂

8 thoughts on “SharePoint Framework vs Sharepoint apps vs Sharepoint solutions

  1. Is it possible to create a SharePoint hosted list by SPFx ? I need to create a list inside the app which I can remove it when I delete the app from the site. I’d appreciate it if you answer me soon.

  2. I am still confused. Client side is obviously the future because Microsoft have learnt they need to push workload onto the client. I am happy with that but why would I use PnP over SPFx? Which is going to be the future? Should I start with SPFx or PnP? I might add I am starting to develop so have no existing skills but want to work with the most productive toolset.

    • Hey Peter, thanks for your comment. SPFx is a complete concept and leads how to develop for SharePoint as well as how your program is lunched by it (app package + files hosted on CDN). SPFx support REST API with its libraries. On the other hand there is PnP framework that wrap up CSOM API in order to provide easy to use methods (in much simpler way than using pure CSOM). Since SPFx is client-based framework you can use any available framework you want i.e. pure JSOM (CSOM for javascript) or PnP. Other question will be why to mix them if SPFx have everything you need.

      So to summarize I would put it this way:
      If you want to build a webpart/app -> use SPFx.
      If you want to build simple script or an app hosted outside SharePoint -> use PnP.

  3. Thank you for your post. It really useful.

    Do you have any idea if we can build SharePoint Add-in and call Microsoft Graph API.

    I can call Microsoft Graph from my SP Web part (SPFx) but I could not find the way to call from my SharePoint Add-in.

    The reason why I want to call Graph API because I want to call some AD Service that only available in Graph API.

    • Hi Mala. Since SP Add-in is just a common app hosted in Azure it’s obvious that you can do it. However please remember that in order to call graph api you will need to register your app (as application permissions or delegated one). This link should be helpful 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *