Professional Documents
Culture Documents
Document 5
Document 5
Document 5
Are you new to SharePoint or do you just want to learn how to develop
SharePoint modern solutions? Then, you came to the right place!
• React / Angular
• TypeScript
• SharePoint Online
• Microsoft Teams
The Basics
SharePoint Framework is a page and web part model that provides full
support for client-side SharePoint development, easy integration with
SharePoint data, and extending Microsoft Teams. With the SharePoint
Framework, you can use modern web technologies and tools in your preferred
development environment to build productive experiences and apps that are
responsive and mobile-ready.
Technology stack
SPFx Technology stack
TypeScript
TypeScript is the preferred programming language to develop in SPFx.
TypeScript is a programming language and maintained by Microsoft and is a
superset of JavaScript and adds optional static typing to the language to develop
client-side solutions. It is designed for the development of large applications and
transpiles to JavaScript to be executed in the browser.
Useful links:
React
React is a JavaScript library for building user interfaces and is at the core of SPFx
to build advanced applications.
Useful links:
To help developers to build advanced SPFx solutions, there are a lot of React
controls, either developed by Microsoft such as Fluent UI or by communities
such as the PnP community.
PnP JS
PnP JS is a NPM package that simplifies interaction with SharePoint Online and
Microsoft Graph.
Useful links:
Repositories
Here are some of the most useful repositories to start learning SharePoint
Framework:
Concepts / Tooling
Core SPFx Concepts
• JavaScript frameworks
• Node.js
• NPM (Node Package Manager)
• Yeoman
• Gulp
• WebPack
NPM Packages
SharePoint client-side development tools use the npm package manager, like
NuGet, to manage dependencies and other required JavaScript helpers. npm is
typically included as part of Node.js setup.
Gulp Commands
• gulp clean – cleans the solution. Cleans the dist and temp folders from
the solution
• gulp trust-dev-cert – installs the development certificate
• gulp build – builds the solution, tranforms TypeScript into JavaScript
• gulp bundle – bundles the solution and minimizes CSS and JS (in debug
mode)
• gulp bundle –ship – bundles the solution and minimizes CSS and JS for
deployment in SharePoint in production mode (release mode)
• gulp package-solution – generates package (.sppkg file) but to run in
debug mode
• gulp package-solution –ship – generates package (.sppkg file) to run in
production mode
• gulp serve – launches SharePoint Workbench to test web parts in debug
mode
• gulp serve –nobrowser – allows testing web parts in debug mode but
without launching SharePoint Workbench
To have a full list of the installed node versions, run “nvm list”.
Here is a comparison between gulp serve and SPFx Fast Serve (times depend on
hardware, environment). The times listed below are “refresh” time (the time
needed to compile your project when you change a file and start refreshing a
page in a browser):
• React component associated with the web part. This file has a render
method responsible for the rendering of the web part UI and uses two
major React concepts: props supplied by the web part that allows users to
configure the web part behavior and state that also allows to control how
the the web part is rendered. The main difference between props and
state is that state can be changed and props can’t (in the code they are
readonly). In the example below, we have the
BirthdaysWorkAnniversariesNewCollaborators React component that
was called by the
BirthdaysWorkAnniversariesNewCollaboratorsWebPart web part.
• Other associated files such as:
• Service classes to get data from SharePoint or Microsoft Graph for
instance
• Data object classes (models)
• Helper classes
• etc