You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/set-up-your-developer-tenant.md
+3-12Lines changed: 3 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -41,17 +41,8 @@ You need an app catalog to upload and deploy web parts. If you've already set up
41
41
42
42
1. In the left sidebar, select **More features**
43
43
1. Locate the section **Apps** and select **Open**.
44
-
1. On the **Apps** page, select **App Catalog**.
45
-
1. Select **OK** to create a new app catalog site.
46
-
1. On the next page, enter the following details:
47
44
48
-
- **Title**: Enter **app catalog**.
49
-
- **Web Site Address _suffix_**: Enter your preferred suffix for the app catalog; for example: **apps**.
50
-
- **Administrator**: Enter your username, and then select the **resolve** button to resolve the username.
51
-
52
-
1. Select **OK** to create the app catalog site.
53
-
54
-
SharePoint creates the app catalog site, and you can see its progress in the SharePoint admin center.
45
+
This is start the automatic creation of the SharePoint app catalog to the tenant if it does not exist. If the app catalog already exists, you will be redirect to it. SharePoint app catalog is used to manage and deploy SharePoint Framework solutions.
55
46
56
47
## Create a new site collection
57
48
@@ -73,8 +64,8 @@ You also need a site collection and a site for your testing. You can create a ne
73
64
74
65
1. In the left sidebar, select **Sites > Active sites**.
75
66
1. Select **Create** from the toolbar at the top of the page.
76
-
1. On the **Create a site** page, select **Team site**.
77
-
1. In the panel that appears, enter required details to create the site (*name, owner, and language*):
67
+
1. On the **Create a site** panel, select **Team site**.
68
+
1. In the new view that appears, enter required details to create the site (*Site name, Group owner, and language*):
78
69
1. Select **Next** to create the site collection.
79
70
80
71
After SharePoint creates the site, you can browse to your site collection by selecting **Finish** & entering the URL of the new site.
@@ -234,7 +174,7 @@ The SharePoint Framework uses [Sass](http://sass-lang.com/) as the CSS pre-proce
234
174
}
235
175
```
236
176
237
-
1. Save the file.
177
+
3. Save the file.
238
178
239
179
Gulp rebuilds the code in the console as soon as you save the file. This generates the corresponding typings in the **HelloWorldWebPart.module.scss.ts** file. After compiled to TypeScript, you can then import and reference these styles in your web part code.
240
180
@@ -251,18 +191,8 @@ The SharePoint Framework uses [Sass](http://sass-lang.com/) as the CSS pre-proce
251
191
252
192
Open the `HelloWorldWebPart` class.
253
193
254
-
SharePoint workbench gives you the flexibility to test web parts in your local environment and from a SharePoint site. SharePoint Framework aids this capability by helping you understand which environment your web part is running from by using the `isServedFromLocalhost` property.
255
-
256
-
### Use the `isServedFromLocalhost` property
257
-
258
-
1. Import the `Environment` and the `EnvironmentType` modules from the **\@microsoft/sp-core-library** bundle. Add it to the `import` section at the top as shown in the following code:
259
-
260
-
```typescript
261
-
import {
262
-
Environment,
263
-
EnvironmentType
264
-
} from '@microsoft/sp-core-library';
265
-
```
194
+
> [!NOTE]
195
+
> SharePoint Framework provides you options to detect environment details and host ___location using the `isServedFromLocalhost` property or with EnvironmentType details. In this case we'll focus on connecting to the data in the site which is hosting the online workbench.
266
196
267
197
1. Add the following private method inside the `HelloWorldWebPart` class:
268
198
@@ -285,38 +215,20 @@ SharePoint workbench gives you the flexibility to test web parts in your local e
285
215
286
216
This method references the new CSS styles added earlier by using the `styles` variable and is used to render list information that will be received from REST API.
287
217
288
-
1. Save the file.
289
-
1. Add the following private method inside the `HelloWorldWebPart` class to call the respective methods to retrieve list data:
218
+
2. Save the file.
219
+
3. Add the following private method inside the `HelloWorldWebPart` class to call the method to retrieve list data:
Things to note about `EnvironmentType` in the `_renderListAsync()` method:
310
-
311
-
- The `Environment.type` property helps you check if you are in a local or SharePoint environment.
312
-
- The correct method is called depending on where your workbench is hosted.
313
-
314
-
1. Save the file.
230
+
4. Save the file.
315
231
316
-
> [!IMPORTANT]
317
-
> The above code is intended to work only when you're working with the SharePoint Framework v1.14 or later.
318
-
>
319
-
> This is because the `isServedFromLocalhost` property was introduced in SPFx v1.14.
320
232
321
233
## Retrieve list data
322
234
@@ -348,9 +260,9 @@ SharePoint workbench gives you the flexibility to test web parts in your local e
348
260
349
261
1. If you're using the SharePoint Framework v1.12.1 or earlier, for instance if you're on SharePoint Server on-premises, switch to your local workbench and add the HelloWorld web part.
350
262
351
-
You should see the mock data returned.
263
+
You should see the list data returned.
352
264
353
-

265
+

354
266
355
267
1. Now you can stop the server from running. Switch to the console and stop **gulp serve**. Select <kbd>CTRL</kbd>+<kbd>C</kbd> to stop the gulp task.
"description": "The feature that activates elements of the mysolution solution.",
84
+
"id": "d72e47b2-d5a2-479f-9f9a-85e1e7472dee",
85
+
"version": "1.0.0.0"
86
+
}
87
+
]
88
+
},
89
+
"paths": {
90
+
"zippedPackage": "solution/mysolution.sppkg"
91
+
}
65
92
}
93
+
66
94
```
67
95
68
96
The default value for the `includeClientSideAssets` is `true`, which means that static assets are packaged automatically in the **\*.sppkg** files, and you don't need to separately host your assets from an external system.
@@ -89,15 +117,15 @@ If Microsoft 365 CDN *is enabled*, it's used automatically with default settings
89
117
> If you're interested in what actually got packaged inside of the **\*.sppkg** file, you can look in the content of the **sharepoint/solution/debug** folder.
90
118
91
119
1. Upload or drag and drop the newly created client-side solution package to the app catalog in your tenant.
92
-
1. Because you already deployed the package, you're prompted as to whether to replace the existing package. Select **Replace It**.
120
+
1. Because you already deployed the package, you're prompted as to whether to replace the existing package. Select **Replace**.
1. Notice how the **___domain** list in the prompt says *SharePoint Online*. This is because the content is either served from the Microsoft 365 CDN or from the app catalog, depending on the tenant settings. Select **Deploy**.
124
+
1. Notice how the **___domain** list in the prompt says *SharePoint Online*. This is because the content is either served from the Microsoft 365 CDN or from the app catalog, depending on the tenant settings. Select **Enable app**.
97
125
98
126

99
127
100
-
1. Open the site where you previously installed the **helloworld-webpart-client-side-solution** or installed the solution to a new site.
128
+
1. Open the site where you previously installed the **helloworld-webpart-client-side-solution** or install the solution to a new site.
101
129
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.
102
130
103
131

0 commit comments