SharePoint Framework

Page and web part model that provides full support for client-side SharePoint development, easy integration with SharePoint data, and extending Microsoft Teams.

→ docs.microsoft.com/spfx

Learn

History

  • 2017: Microsoft introduced the SharePoint Framework as the recommended way to customize and extend SharePoint Online

Key elements

  • SharePoint Framework is modern client-side development

  • Extensions

    • Types: Application customizers, Field customizers, Command sets

  • Workbench: a special SharePoint page that contains a single canvas that developers can add their web parts to. There are two different workbench options: local and hosted.

  • Web parts

    • Property pane

      • The property pane has two different modes: reactive and non-reactive

  • JavaScript agnostic but can be used with a framework (React in particular)

Read further: SharePoint Framework UI components

Quick start

Learning path

Code samples

Usecases

Persistence

API calls

Logging

  • Default logging works on local workbench but not on SharePoint Online workbench

    • Install the PnP library

npm install @pnp/logging

Develop

→ Set up your SharePoint Framework development environment

Command line

# installs Yeoman
npm install --global yo

# installs Gulp
npm install --global gulp

# installs SharePoint Framework generator
npm install --global @microsoft/generator-sharepoint
# creates a SharePoint Framework client-side web part
yo @microsoft/sharepoint
# builds local resources
gulp build

# starts the local web server without launching the browser
gulp serve --nobrowser

# opens configuration to edit initialPage (workbench URL, local or hosted)
vi config/serve.json

# bundles the solution
gulp bundle --ship

# packages the solution
gulp package-solution --ship

# tracks the generated SharePoint package
ls /sharepoint/solution/*.sppkg

Read more about Gulp commands: Explore a SharePoint Framework project

Operate

Deployment

Last updated