Skip to content

Commit 111e48a

Browse files
committed
fixed markdown issues with web part tutorial
1 parent 48d6969 commit 111e48a

8 files changed

+1108
-1178
lines changed

docs/spfx/web-parts/get-started/add-jqueryui-accordion-to-web-part.md

Lines changed: 202 additions & 207 deletions
Large diffs are not rendered by default.

docs/spfx/web-parts/get-started/build-a-hello-world-web-part.md

Lines changed: 173 additions & 177 deletions
Large diffs are not rendered by default.

docs/spfx/web-parts/get-started/connect-to-sharepoint.md

Lines changed: 188 additions & 196 deletions
Large diffs are not rendered by default.

docs/spfx/web-parts/get-started/deploy-web-part-to-cdn.md

Lines changed: 123 additions & 130 deletions
Large diffs are not rendered by default.

docs/spfx/web-parts/get-started/hosting-webpart-from-office-365-cdn.md

Lines changed: 78 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -34,92 +34,88 @@ You can also follow these steps by watching this video on the SharePoint PnP You
3434

3535
1. Ensure that you have the latest version of the SharePoint Online Management Shell by downloading it from the [Microsoft Download site](https://www.microsoft.com/en-us/download/details.aspx?id=35588).
3636

37-
> [!TIP]
38-
> If you are using a non-Windows machine, you cannot use the SharePoint Online Management Shell. You can, however, manage these settings by using [Office 365 CLI](https://sharepoint.github.io/office365-cli/).
37+
> [!TIP]
38+
> If you are using a non-Windows machine, you cannot use the SharePoint Online Management Shell. You can, however, manage these settings by using [Office 365 CLI](https://sharepoint.github.io/office365-cli/).
3939
40-
2. Connect to your SharePoint Online tenant with a PowerShell session.
40+
1. Connect to your SharePoint Online tenant with a PowerShell session.
4141

42-
```powershell
43-
Connect-SPOService -Url https://contoso-admin.sharepoint.com
44-
```
42+
```powershell
43+
Connect-SPOService -Url https://contoso-admin.sharepoint.com
44+
```
4545
46-
3. Get the current status of public CDN settings from the tenant level by executing the following commands one-by-one.
46+
1. Get the current status of public CDN settings from the tenant level by executing the following commands one-by-one.
4747
48+
```powershell
49+
Get-SPOTenantCdnEnabled -CdnType Public
50+
Get-SPOTenantCdnOrigins -CdnType Public
51+
Get-SPOTenantCdnPolicies -CdnType Public
52+
```
4853
49-
```powershell
50-
Get-SPOTenantCdnEnabled -CdnType Public
51-
Get-SPOTenantCdnOrigins -CdnType Public
52-
Get-SPOTenantCdnPolicies -CdnType Public
53-
```
54+
SharePoint Framework solutions can automatically benefit from the Office 365 Public CDN as long as it's enabled in your tenant. When CDN is enabled, `*/CLIENTSIDEASSETS` origin is automatically added as a valid origin.
5455
55-
SharePoint Framework solutions can automatically benefit from the Office 365 Public CDN as long as it's enabled in your tenant. When CDN is enabled, `*/CLIENTSIDEASSETS` origin is automatically added as a valid origin.
56+
1. Enable public CDN in the tenant.
5657
57-
4. Enable public CDN in the tenant.
58+
```powershell
59+
Set-SPOTenantCdnEnabled -CdnType Public
60+
```
5861
59-
```powershell
60-
Set-SPOTenantCdnEnabled -CdnType Public
61-
```
62+
1. Confirm settings by selecting `Y` and then Enter.
6263
63-
5. Confirm settings by selecting `Y` and then Enter.
64+
![Enable public CDN in tenant](../../../images/cdn-enable-o365-public-cdn.png)
6465
65-
![Enable public CDN in tenant](../../../images/cdn-enable-o365-public-cdn.png)
66+
Now the public CDN has been enabled in the tenant by using the default file type configuration allowed. This means that the following file type extensions are supported: CSS, EOT, GIF, ICO, JPEG, JPG, JS, MAP, PNG, SVG, TTF, and WOFF.
6667
67-
Now the public CDN has been enabled in the tenant by using the default file type configuration allowed. This means that the following file type extensions are supported: CSS, EOT, GIF, ICO, JPEG, JPG, JS, MAP, PNG, SVG, TTF, and WOFF.
68+
SharePoint Framework solutions can automatically benefit from the Office 365 Public CDN as long as it is enabled in your tenant. When the CDN is enabled, the `*/CLIENTSIDEASSETS` origin is automatically added as a valid origin.
6869
69-
SharePoint Framework solutions can automatically benefit from the Office 365 Public CDN as long as it is enabled in your tenant. When the CDN is enabled, the `*/CLIENTSIDEASSETS` origin is automatically added as a valid origin.
70+
> [!NOTE]
71+
> If you have previously enabled Office 365 CDN, you should re-enable the public CDN so that you have the `*/CLIENTSIDEASSETS`entry added as a valid CDN origin for public CDN. If this entry is not present and the public CDN is enabled in your tenant, bundle requests will contain the token hostname `spclientsideassetlibrary` in their URL, causing the requests to fail. You can add this missing entry by using
72+
>
73+
>`Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl */CLIENTSIDEASSETS`
7074
71-
> [!NOTE]
72-
> If you have previously enabled Office 365 CDN, you should re-enable the public CDN so that you have the `*/CLIENTSIDEASSETS`entry added as a valid CDN origin for public CDN. If this entry is not present and the public CDN is enabled in your tenant, bundle requests will contain the token hostname `spclientsideassetlibrary` in their URL, causing the requests to fail. You can add this missing entry by using
73-
>
74-
>`Add-SPOTenantCdnOrigin -CdnType Public -OriginUrl */CLIENTSIDEASSETS`
75+
1. You can double-check the current setup of your end-points. Execute the following command to get the list of CDN origins from your tenant:
7576
76-
6. You can double-check the current setup of your end-points. Execute the following command to get the list of CDN origins from your tenant:
77+
```powershell
78+
Get-SPOTenantCdnOrigins -CdnType Public
79+
```
7780
78-
```powershell
79-
Get-SPOTenantCdnOrigins -CdnType Public
80-
```
81+
Notice that when you enable the CDN for the first time, the default configuration to enable default origins will take a while (approximately 15 minutes). Configuration is completed when there is no **(configuration pending)** messages when you execute the `Get-SPOTenantCdnOrigins -CdnType Public` command.
8182
82-
Notice that when you enable the CDN for the first time, the default configuration to enable default origins will take a while (approximately 15 minutes). Configuration is completed when there is no **(configuration pending)** messages when you execute the `Get-SPOTenantCdnOrigins -CdnType Public` command.
83-
84-
![List of public origins in tenant](../../../images/cdn-public-origins.png)
85-
86-
> [!NOTE]
87-
> When the origin is listed without the *(configuration pending)* text, it is ready to be used in your tenant. This is the indication of an on-going configuration between SharePoint Online and the CDN system.
83+
![List of public origins in tenant](../../../images/cdn-public-origins.png)
8884
85+
> [!NOTE]
86+
> When the origin is listed without the *(configuration pending)* text, it is ready to be used in your tenant. This is the indication of an on-going configuration between SharePoint Online and the CDN system.
8987
9088
## Finalize solution for deployment
9189
9290
1. Switch to the console and make sure you are still in the project directory that you used to set up your web part project.
91+
1. End the possible `gulp serve` task by selecting Ctrl+C, and ensure that you are in your project directory:
9392
94-
2. End the possible `gulp serve` task by selecting Ctrl+C, and ensure that you are in your project directory:
95-
96-
```
97-
cd helloworld-webpart
98-
```
93+
```shell
94+
cd helloworld-webpart
95+
```
9996
10097
## Review solution settings
10198
10299
1. Open the **HelloWorldWebPart** web part project in Visual Studio Code or your preferred IDE.
103-
104-
2. Open **package-solution.json** from the **config** folder.
105-
106-
The **package-solution.json** file defines the package metadata as shown in the following code:
107-
108-
```json
109-
{
110-
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
111-
"solution": {
112-
"name": "helloword-webpart-client-side-solution",
113-
"id": "3c1af394-bbf0-473c-bb7d-0798f0587cb7",
114-
"version": "1.0.0.0",
115-
"includeClientSideAssets": true,
116-
"isDomainIsolated": false
117-
},
118-
"paths": {
119-
"zippedPackage": "solution/helloword-webpart.sppkg"
100+
1. Open **package-solution.json** from the **config** folder.
101+
102+
The **package-solution.json** file defines the package metadata as shown in the following code:
103+
104+
```json
105+
{
106+
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
107+
"solution": {
108+
"name": "helloword-webpart-client-side-solution",
109+
"id": "3c1af394-bbf0-473c-bb7d-0798f0587cb7",
110+
"version": "1.0.0.0",
111+
"includeClientSideAssets": true,
112+
"isDomainIsolated": false
113+
},
114+
"paths": {
115+
"zippedPackage": "solution/helloword-webpart.sppkg"
116+
}
120117
}
121-
}
122-
```
118+
```
123119
124120
The default value for the **includeClientSideAssets** is `true`, which means that static assets are packaged automatically inside of the *.sppkg* files, and you do not need to separately host your assets from an external system.
125121
@@ -131,46 +127,42 @@ If *Office 365 CDN* is enabled, it is used automatically with default settings.
131127
132128
1. Execute the following task to bundle your solution. This executes a release build of your project by using a dynamic label as the host URL for your assets. This URL is automatically updated based on your tenant CDN settings.
133129
134-
```
135-
gulp bundle --ship
136-
```
137-
138-
2. Execute the following task to package your solution. This creates an updated **helloworld-webpart.sppkg** package on the **sharepoint/solution** folder.
139-
140-
```
141-
gulp package-solution --ship
142-
```
143-
144-
> [!NOTE]
145-
> If you are interested in what actually got packaged inside of the sppkg file, you can look in the content of the **sharepoint/solution/debug** folder.
146-
147-
3. Upload or drag and drop the newly created client-side solution package to the app catalog in your tenant.
130+
```shell
131+
gulp bundle --ship
132+
```
148133
149-
4. Because you already deployed the package, you are prompted as to whether to replace the existing package. Select **Replace It**.
134+
1. Execute the following task to package your solution. This creates an updated **helloworld-webpart.sppkg** package on the **sharepoint/solution** folder.
150135
151-
![Override existing solution](../../../images/cdn-override-helloworld-webpart-package.png)
136+
```shell
137+
gulp package-solution --ship
138+
```
152139
153-
5. Notice how the **___domain** list in the prompt says *SharePoint Online*. This is because the content is either served from the Office 365 CDN or from the app catalog, depending on the tenant settings. Select **Deploy**.
140+
> [!NOTE]
141+
> If you are interested in what actually got packaged inside of the sppkg file, you can look in the content of the **sharepoint/solution/debug** folder.
154142
155-
![Installation popup from app catalog for the SPFx solution](../../../images/cnd-trust-helloworld-webpart-solution.png)
143+
1. Upload or drag and drop the newly created client-side solution package to the app catalog in your tenant.
144+
1. Because you already deployed the package, you are prompted as to whether to replace the existing package. Select **Replace It**.
156145
157-
6. Open the site where you previously installed the **helloworld-webpart-client-side-solution** or install the solution to a new site.
146+
![Override existing solution](../../../images/cdn-override-helloworld-webpart-package.png)
158147
159-
7. After the solution has been installed, select **Add a page** from the *gear* menu, and select **HelloWorld** from the modern page web part picker to add your custom web part to page.
148+
1. Notice how the **___domain** list in the prompt says *SharePoint Online*. This is because the content is either served from the Office 365 CDN or from the app catalog, depending on the tenant settings. Select **Deploy**.
160149
161-
![HelloWorld web part visible in web part picker for modern page](../../../images/cdn-web-part-picker.png)
150+
![Installation popup from app catalog for the SPFx solution](../../../images/cnd-trust-helloworld-webpart-solution.png)
162151
163-
8. Notice how the web part is rendered even though you are not running the node.js service locally.
152+
1. Open the site where you previously installed the **helloworld-webpart-client-side-solution** or install the solution to a new site.
153+
1. After the solution has been installed, select **Add a page** from the *gear* menu, and select **HelloWorld** from the modern page web part picker to add your custom web part to page.
164154
165-
![HelloWorld web part rendering on a modern page, which is in edit mode](../../../images/cdn-web-part-rendering.png)
155+
![HelloWorld web part visible in web part picker for modern page](../../../images/cdn-web-part-picker.png)
166156
167-
9. Save changes on the page with the web part.
157+
1. Notice how the web part is rendered even though you are not running the node.js service locally.
168158
169-
10. Select **F12** to open up developer tools.
159+
![HelloWorld web part rendering on a modern page, which is in edit mode](../../../images/cdn-web-part-rendering.png)
170160
171-
11. Extend **publiccdn.sharepointonline.com** under the source and notice how the **hello-world-web-part** file is loaded from the Public CDN URL pointing dynamically to a library located under the app catalog site collection.
161+
1. Save changes on the page with the web part.
162+
1. Select **F12** to open up developer tools.
163+
1. Extend **publiccdn.sharepointonline.com** under the source and notice how the **hello-world-web-part** file is loaded from the Public CDN URL pointing dynamically to a library located under the app catalog site collection.
172164
173-
![HelloWorld web part bundle coming from public CDN URL in the sources tab of Chrome developer tools](../../../images/cdn-web-part-f12-source.png)
165+
![HelloWorld web part bundle coming from public CDN URL in the sources tab of Chrome developer tools](../../../images/cdn-web-part-f12-source.png)
174166
175167
> [!NOTE]
176168
> If you would not have CDN enabled in your tenant, and the `includeClientSideAssets` setting would be `true`in the **package-solution.json**, the loading URL for the assets would be dynamically updated and pointing directly to the ClientSideAssets folder located in the app catalog site collection. In this example case, the URL would be `https://sppnp.microsoft.com/sites/apps/ClientSideAssets/`. This change is automatic depending on your tenant settings and it does not require any changes in the actual solution package.

0 commit comments

Comments
 (0)