Skip to content

Commit 2e7635f

Browse files
Doc updates & additions for SPFx v1.16 release (SharePoint#8582)
* 📜♻️ make supported node version consistent - changed copy to make mention of supported, & no longer supported, versions of node consistent for v1.16 release * ♻️ spfx release v listing consistent in toc - all version numbers use the Maj.Min.Path version, except for a few starting with v1.13 > v1.16 - this change adds `.0` as patch v number for consistency * ♻️ refresh spfx getting started to spfx v1.16 - updated reference to Node.js version requirement/support - remove reference deprecated/archived atom app - added references to nvm setup * 📜 article on MS Teams apps for Teams JS 2.0 * 🧼 change context with msteams js client guidance * 🐞 fix broken link
1 parent ae804d5 commit 2e7635f

9 files changed

+163
-29
lines changed
Loading
Loading
Loading
Loading

docs/spfx/integrate-with-teams-introduction.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Building Microsoft Teams Tabs using SharePoint Framework
33
description: You can build your Microsoft Teams tabs using SharePoint Framework and utilize the tooling
4-
ms.date: 10/11/2021
4+
ms.date: 11/14/2022
55
---
66
# Building Microsoft Teams Tabs using SharePoint Framework
77

@@ -103,25 +103,28 @@ There's an alternative way to deploy your solution, which will for instance allo
103103
The page context in a web part contains a reference to the Teams JavaScript SDK so that you can easily get access on the Teams context when your web part is rendered as a tab.
104104

105105
```javascript
106-
this.context.sdks.microsoftTeams
106+
this.context.sdks.microsoftTeams.teamJs.app.getContext()
107107
```
108108

109109
> [!NOTE]
110110
> For more information on the Microsoft Teams tab context, see [Microsoft Teams development documentation](/microsoftteams/platform/concepts/tabs/tabs-context).
111111
112112
> [!IMPORTANT]
113-
> The property `this.context.microsoftTeams` has been deprecated in the SharePoint Framework v1.10 release.
113+
> The process of obtaining the Microsoft Teams context with the SPFx API has changed a few times over time. For example, you may be familiar with the following properties that would return the Microsoft Teams context:
114114
>
115-
> You should use `this.context.sdks.microsoftTeams` for all solutions created with the SharePoint Framework v1.10 and later.
115+
> - The property `this.context.microsoftTeams` was [deprecated in the SharePoint Framework v1.10 release](release-1.10.0.md).
116+
> - The property `this.context.sdks.microsoftTeams` was [deprecated in the SharePoint Framework v1.16 release](release-1.16.md).
116117
117-
## What Teams JS SDK version to use?
118+
## What Teams JavaScript client SDK version to use?
118119

119-
The SharePoint Framework provides access to the Teams JS SDK instance and context using `sdks.microsoftTeams` property in the [context's API](/javascript/api/sp-webpart-base/webpartcontext#@microsoft-sp-webpart-base-webpartcontext-sdks-member).
120-
Using this API assures the supported version of Teams JS is loaded and initialized.
120+
The SharePoint Framework provides access to the Teams JavaScript client SDK instance and context using `sdks.microsoftTeams.teamsJs.app.getContext()` method in the [context's API](/javascript/api/sp-webpart-base/webpartcontext#@microsoft-sp-webpart-base-webpartcontext-sdks-member).
121+
122+
Using this API assures the supported version of Teams JavaScript client SDK is loaded and initialized.
121123

122124
Few details to keep in mind:
123-
- Installing and initializing custom versions of Teams JS SDK is **unsupported**. This is applicable to any SPFx component, including web parts, extensions, adaptive cards, and libraries.
124-
- Although Teams JS SDK types are tied to the SPFx version used in the solution, the actual version loaded to the tenant may differ. We guarantee backward compatibility on our end. For example, a solution built with SPFx 1.14 will have types from Teams JS 1.10.0, and SPFx 1.15.2 will have types from Teams JS 1.12.1, but the actual loaded version can be 2.1.0.
125+
126+
- Installing and initializing custom versions of Teams JavaScript client SDK is **unsupported**. This is applicable to any SPFx component, including web parts, extensions, adaptive cards, and libraries.
127+
- Although Teams JavaScript client SDK types are tied to the SPFx version used in the solution, the actual version loaded to the tenant may differ. We guarantee backward compatibility on our end. For example, a solution built with SPFx 1.14 will have types from Teams JavaScript client SDK v1.10.0, and SPFx v1.15.2 will have types from Teams JavaScript client SDK v1.12.1, but the actual loaded version of the Teams JavaScript client can be v2.1.0.
125128

126129
## See also
127130

docs/spfx/office/overview.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: Extend Outlook and Office with the SharePoint Framework
3+
description: Learn how you can use the SharePoint Framework to create apps for Microsoft 365, including Microsoft Teams, Outlook, and Office clients
4+
ms.date: 11/14/2022
5+
ms.localizationpriority: high
6+
---
7+
# Extend Outlook and Office with the SharePoint Framework
8+
9+
[!INCLUDE [spfx-release-beta](../../../includes/snippets/spfx-release-beta.md)]
10+
11+
The SharePoint Framework (SPFx) v1.16 release added support for the [Microsoft Teams JavaScript client SDK v2](/javascript/api/overview/msteams-client). The Microsoft Teams JavaScript client SDK v2 introduced the ability to enable [Teams apps to run in Outlook at Office, in addition to Microsoft Teams](/microsoftteams/platform/m365-apps/overview).
12+
13+
With this improvement in SPFx v1.16, developers can now use the SPFx to create apps for Outlook and Office using the [existing support for creating apps for Microsoft Teams](/sharepoint/dev/spfx/build-for-teams-overview).
14+
15+
> [!IMPORTANT]
16+
> The ability to run Microsoft Teams apps in Outlook and Office is currently in beta with anticipated availability in the first half of calendar year 2023.
17+
18+
> [!IMPORTANT]
19+
> Essential information required for user success
20+
>
21+
> To test using Microsoft Teams apps in Outlook and Office, including those created with the SPFx, you must configure your Microsoft 365 tenant's release preferences for *targetted release*. For more information on changing your organizations release preferences, see [Set up the Standard or Targeted release options](/microsoft-365/admin/manage/release-options-in-office-365).
22+
>
23+
> It takes 5 business days for your tenant's release preferences to take effect. In other words, change your tenant from the **standard release** track to the **target release** track on the 5th of the month, you won't be able to test your Microsoft Teams apps created with the SPFx in Outlook or Office until the 11th of the month.
24+
25+
## Create Microsoft Teams apps for Outlook and Office
26+
27+
To create a new Microsoft Teams app with SPFx for Outlook and Office, you start by first creating a new SPFx project using the Yeoman generator for SharePoint v1.16 or later the same way you'd create a new web part. For more information, see [Build your first SharePoint client-side web part](../web-parts/get-started/build-a-hello-world-web-part.md).
28+
29+
The Yeoman SharePoint Generator will prompt you with a series of questions. Follow the same guidance for creating a new SPFx web part when responding to these questions.
30+
31+
Once the project has been created, update the web part's `supportedHosts` property to indicate where it can be used. For example, add `TeamsTab` and/or `TeamsPersonalApp` to te `supportedHosts` property in the **./config/package-solution.json** file. For more information, see [Building Microsoft Teams Tabs using SharePoint Framework](../integrate-with-teams-introduction.md).
32+
33+
## Determine the current runtime host for your app
34+
35+
Your application may need to determine where it's currently running for various reasons. For example, should users see one experience if it's running in SharePoint, Microsoft Teams, Outlook, or another Office client?
36+
37+
Use the SPFx's `context` property on the web part's class and the Microsoft Teams JavaScript client to determine the hosting client. The `app.host.name` property on the Teams JavaScript client contains the name of the host if it's Microsoft Teams, Outlook, or Office. If the Microsoft Teams context object is `undefined`, then the web part is running in SharePoint.
38+
39+
```typescript
40+
// if running in Microsoft Teams, Outlook, or Office...
41+
if (!!this.context.sdks.microsoftTeams) {
42+
const teamsContext = await this.context.sdks.microsoftTeams.teamsJs.app.getContext();
43+
switch (teamsContext.app.host.name.toLowerCase()) {
44+
case 'teams':
45+
// RUNNING IN MICROSOFT TEAMS
46+
case 'office':
47+
// RUNNING IN OFFICE / OFFICE.COM
48+
case 'outlook':
49+
// RUNNING IN OUTLOOK
50+
default:
51+
throw new Error('Unknown host');
52+
}
53+
} else {
54+
// RUNNING IN SHAREPOINT
55+
}
56+
```
57+
58+
## Create the Microsoft Teams app manifest & package
59+
60+
While the SharePoint Online App Catalog's **Sync to Teams** button can automatically create the Microsoft Teams app manifest, app package and install it in the Microsoft Teams store, this currently doesn't support the required Microsoft Teams app manifest file format. The Teams app manifest file must be v1.13 or later
61+
62+
The other option is to manually create the app manifest and app package yourself and include them in the SharePoint package uploaded to the App Catalog. When you select the **Sync To Teams** button in the App Catalog, SharePoint Online will use the Teams app package you created and have included in the SharePoint package.
63+
64+
> [!NOTE]
65+
> For more information on manually creating Microsoft Teams app manifests and app packages, see [Deployment options for SharePoint Framework solutions for Microsoft Teams](../deployment-spfx-teams-solutions.md)
66+
67+
### Create the Microsoft Teams app manifest
68+
69+
The first step is to create the Microsoft Teams app manifest.
70+
71+
1. Create the following file in your SPFx project: **./teams/manifest.json**.
72+
1. Follow the guidance in [Microsoft Teams: App manifest schema for Teams](/microsoftteams/platform/resources/schema/manifest-schema) and [SharePoint Framework: Deployment options for SharePoint Framework solutions for Microsoft Teams](../deployment-spfx-teams-solutions.md) to create a new app manifest file.
73+
1. Take special note of the following properties in the **manifest.json** file:
74+
- `manifestVersion`: This must be set to **1.13** or higher
75+
- `staticTabs` and/or `configurableTabs`: Verify this follows the guidance for using a SPFx web part as a Microsoft Teams tab.
76+
77+
For example, the `contentUrl` property, and any other property that references SPFx components, should use the dynamic tokens `{teamSiteDomain}`, `{teamSitePath}`, & `{locale}`. It should also reference the SPFx's component ID.
78+
79+
> [!TIP]
80+
> For more information on these properties, see [SharePoint Framework: Deployment options for SharePoint Framework solutions for Microsoft Teams](../deployment-spfx-teams-solutions.md), specifically the section on **Dynamically reference the underlying SharePoint site URLs**.
81+
82+
> [!NOTE]
83+
> To learn more about the Microsoft Teams app manifest file, see [Microsoft Teams: App manifest schema for Teams](/microsoftteams/platform/resources/schema/manifest-schema).
84+
85+
### Create the Microsoft Teams app package
86+
87+
Once you've created the Microsoft Teams app manifest, you need to manually create the app package. This will be included in your SharePoint package (**\*.sppkg**) file that you'll upload to your SharePoint tenant's App Catalog.
88+
89+
1. Compress the contents of the **./teams** folder in your project.
90+
1. Rename the ZIP package to **TeamsSPFxApp.zip**.
91+
92+
> [!IMPORTANT]
93+
> The Microsoft Teams app package must be named **TeamsSPFxApp.zip** and saved in the **./teams** folder for this option to work with the **Sync to Teams** button in the tenant's App Catalog.
94+
95+
## Deploy the SPFx based Microsoft Teams app
96+
97+
Once you've created the app package, the next step is to deploy and install it.
98+
99+
Deploy the app to your tenant's app catalog.
100+
101+
Then, select the app, select the **Files** tab from the ribbon, and then select the **Sync to Teams** button to deploy the app package to your tenant's Microsoft Teams store.
102+
103+
> [!NOTE]
104+
> For more information on packaging & deploying SharePoint packages to the Microsoft Teams App Store, see **[SharePoint Framework: Deployment options for SharePoint Framework solutions for Microsoft Teams](../deployment-spfx-teams-solutions.md)**.
105+
106+
Now that you've deployed the app to SharePoint, you can add it as a web part to a page in your SharePoint sites:
107+
108+
![Microsoft Teams Lead Assistant Dashboard in SharePoint](../../images/msteams-app-leadassistdashboard-installed-app-sharepoint-01.png)
109+
110+
The app can also be installed in Microsoft Teams. Once you're logged in, select the **Apps** option in the left vertical navigation.
111+
112+
Notice your apps are listed under the **Build for your org** section:
113+
114+
![Microsoft Teams Lead Assistant Dashboard - Teams Add app options](../../images/msteams-app-leadassistdashboard-install-apps.png)
115+
116+
Once you install the app, it will appear in the left vertical navigation as a pinned app:
117+
118+
![Microsoft Teams Lead Assistant Dashboard - Teams Add app installed](../../images/msteams-app-leadassistdashboard-installed-app-teams-01.png)
119+
120+
![Microsoft Teams sample app - Lead Assist Dashboard](../../images/msteams-app-leadassistdashboard-installed-app-teams-02.png)
121+
122+
You can follow the same process to install the app in Outlook as you performed in Microsoft Teams.
123+
124+
> [!TIP]
125+
> For more information, see the **[React Teams Lead Dashboard](https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-teams-lead-dashboard)** sample for a working example that uses the SPFx to create a Microsoft Teams app for Outlook and Office.

docs/spfx/release-1.16.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: SharePoint Framework v1.16 preview release notes
33
description: Release notes for the SharePoint Framework v1.16 preview release
4-
ms.date: 10/26/2022
4+
ms.date: 11/14/2022
55
ms.localizationpriority: high
66
---
77
# SharePoint Framework v1.16 release notes
@@ -63,7 +63,7 @@ Set a data version for this preconfigured entry. This is optional and can be use
6363
Starting this version, developers can install `@microsoft/microsoft-graph-client` to reference tasks or middlewares from the SDK, for example, `LargeFileUploadTask`. SPFx will automatically externalize the dependency and load it from the CDN.
6464

6565
> [!NOTE]
66-
> See [Ability to check supported versions](#sdk-versions) to check what version of MS Graph SDK to install.
66+
> See [Ability to check supported versions](#ability-to-check-supported-versions-of-ms-graph-and-teams-sdk) to check what version of MS Graph SDK to install.
6767

6868
`MSGraphClientFactory` now allows to pass `Options` parameter when initializing the client. It also contains new method `getClientWithMiddleware` to initialize the client with middleware.
6969
Developers can also get the MS Graph client instance using `MSGraphClientV3.client` property. This instance can be used to call MS Graph tasks like large file upload.
@@ -154,9 +154,9 @@ We're rolling our support for teams-js v2. `this.context.sdks.microsoftTeams.tea
154154
> [!TIP]
155155
> Teams JavaScript SDK v2 enables new scenarios for developers. See following announcement for additional details on the Teams JS SDK v2 capabilities - [Microsoft Teams JS SDK v2 is now generally available](https://devblogs.microsoft.com/microsoft365dev/microsoft-teams-js-sdk-v2-is-now-generally-available/)
156156
157-
### Remove NodeJS 12 and 14 support
157+
### Remove NodeJS v12 and v14 support
158158

159-
Starting with 1.16.0-beta.1, we're removing support for NodeJS 12 and 14. We'll continue to support NodeJS 16.
159+
Node.js v12 & v14 are no longer supported. SPFx v1.16 requires Node.js v16 LTS.
160160

161161
## Deprecations
162162

@@ -185,4 +185,4 @@ Starting with 1.16.0-beta.1, we're removing support for NodeJS 12 and 14. We'll
185185
- [#8266](https://github.com/SharePoint/sp-dev-docs/issues/8266) - SPFx 1.15 - Form Customiser does not work in View History
186186
- [#8272](https://github.com/SharePoint/sp-dev-docs/issues/8272) - SPFx 1.15 - Getting error when use form customier to view existing list item in Classic mode
187187
- [#8279](https://github.com/SharePoint/sp-dev-docs/issues/8279) - New icons in production environments
188-
- [#8301](https://github.com/SharePoint/sp-dev-docs/issues/8301) - Error When Revisiting Custom Teams ?app=portals App
188+
- [#8301](https://github.com/SharePoint/sp-dev-docs/issues/8301) - Error When Revisiting Custom Teams ?app=portals App

docs/spfx/set-up-your-development-environment.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Set up your SharePoint Framework development environment
33
description: Use any text editor to build SharePoint Framework solutions. You can use macOS, Windows, or Linux.
4-
ms.date: 08/19/2022
4+
ms.date: 11/14/2022
55
ms.localizationpriority: high
66
ms.custom: scenarios:getting-started
77
---
88
# Set up your SharePoint Framework development environment
99

10-
You can use any text editor to build SharePoint Framework solutions. You can use a macOS, Windows, or Linux environment as well.
10+
You can use any text editor to build SharePoint Framework (SPFx) solutions. You can use a macOS, Windows, or Linux environment as well.
1111

1212
> [!NOTE]
1313
> Before following the steps in this article, be sure to [Set up your Microsoft 365 tenant](./set-up-your-developer-tenant.md).
@@ -42,11 +42,9 @@ You can check if you already have Node.js already installed, including installed
4242
node --version
4343
```
4444

45-
The SharePoint Framework v1.15.0 is supported on the following Node.js versions:
45+
The SharePoint Framework v1.18.0 is supported on the following Node.js versions:
4646

47-
- Node.js v16.15.0+ (*Gallium*)
48-
- Node.js v14.15.0+ (*Fermium*)
49-
- Node.js v12.13.0+ (*Erbium*)
47+
- Node.js v16 LTS (v16.13.x - v16.18.x, *aka: Gallium*)
5048

5149
> [!CAUTION]
5250
> If you're building SharePoint Framework components for SharePoint on-prem deployments, refer to the additional pages listed in the [See also](#see-also) section for more information.
@@ -56,7 +54,6 @@ The SharePoint Framework v1.15.0 is supported on the following Node.js versions:
5654
You can use any code editor or IDE that supports client-side development to build your web part, such as:
5755

5856
- [Visual Studio Code](https://code.visualstudio.com/)
59-
- [Atom](https://atom.io)
6057
- [Webstorm](https://www.jetbrains.com/webstorm)
6158

6259
The steps and examples in this documentation use [Visual Studio Code](https://code.visualstudio.com/), but you can use any editor of your choice.
@@ -87,7 +84,7 @@ npm install gulp-cli --global
8784
[Yeoman](https://yeoman.io/) helps you kick-start new projects, and prescribes best practices and tools to help you stay productive. SharePoint client-side development tools include a Yeoman generator for creating new web parts. The generator provides common build tools, common boilerplate code, and a common playground website to host web parts for testing.
8885

8986
> [!IMPORTANT]
90-
> Yeoman version 4.x is required for the SharePoint Framework 1.13 forward.
87+
> Yeoman v4.x is required by the SPFx v1.13 forward.
9188
9289
Enter the following command to install Yeoman:
9390

@@ -158,6 +155,11 @@ Depending on your scenario, you may need to maintain different development envir
158155
- Docker
159156
- Node Version Manager (NVM)
160157

158+
> [!TIP]
159+
> For more information on NVM, see [Better Node.js Install Management with Node Version Manager](https://www.voitanos.io/blog/better-node-js-install-management-with-node-version-manager/).
160+
> - [NVM](https://github.com/creationix/nvm) for macOS
161+
> - [nvm-windows](https://github.com/coreybutler/nvm-windows) for Windows
162+
161163
## Troubleshooting
162164

163165
### Check the version of globally installed packages
@@ -173,7 +175,9 @@ npm list --global --depth=0️
173175
If you're having trouble trusting your self-signed certificate when you run **gulp trust-dev-cert** & you've verified that the correct versions of all dependencies are installed, one solution we usually see resolve the issue is to uninstall all globally installed packages, uninstall Node.js, reboot & start again.
174176

175177
In some cases, executing the command **gulp trust-dev-cert**, doesn't have the wanted effect of trusting the self-signed development certificate on your machine. In rare cases such as these, you may need to delete a hidden folder that's generated in your profile folder.
178+
176179
Locate & delete the folder **{{homedir}}/.gcb-serve-data** for SPFx version earlier than v1.12.1. For later versions delete folder **{{homedir}}/.rushstack** then try to trust the self-signed development certificate again. Otherwise running **gulp untrust-dev-cert** will have same effect to remove the certificate files from the profile folder.
180+
177181
In case the certificate is not added to the Trusted Root Certification Authority despite running **gulp trust-dev-cert** because of some policies blocking the action, the **rushstack-serve.pem** file from **{{homedir}}/.rushstack** folder can be imported manually into the Certificate Manager under Trusted Root Certification Authority with a local admin account.
178182

179183
### Unable to Install Packages with NPM - Corporate Proxies

0 commit comments

Comments
 (0)