Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change SPComponentLoader section #5254

Merged
merged 2 commits into from
Jan 31, 2020
Merged

Conversation

AJIXuMuK
Copy link
Collaborator

Category

  • Content fix
  • New article

What's in this Pull Request?

SPComponentLoader is now part of @microsoft/sp-loader module that should be installed implicitly.

`SPComponentLoader` is now part of `@microsoft/sp-loader` module that should be installed implicitly.
@@ -375,14 +375,23 @@ Having loaded the titles of SharePoint lists in the current site, the final step

![SharePoint Framework client-side web part showing titles of SharePoint lists in the current site](../../../images/tutorial-spjsom-web-part-list-titles.png)

Referencing SharePoint JSOM scripts declaratively as external scripts is convenient and allows you to keep your code clean. One disadvantage, however, is that it requires specifying absolute URLs to the location from which SharePoint JSOM scripts should be loaded. If you're using separate SharePoint tenants for development, testing, and production, it requires some additional work to change these URLs for the different environments accordingly. In such cases, you may consider referencing JSOM imperatively by using the [SPComponentLoader](https://docs.microsoft.com/javascript/api/sp-application-base) to load the scripts in the SPFx component's code.
Referencing SharePoint JSOM scripts declaratively as external scripts is convenient and allows you to keep your code clean. One disadvantage, however, is that it requires specifying absolute URLs to the location from which SharePoint JSOM scripts should be loaded. If you're using separate SharePoint tenants for development, testing, and production, it requires some additional work to change these URLs for the different environments accordingly. In such cases, you may consider referencing JSOM imperatively by using the [SPComponentLoader](https://docs.microsoft.com/en-us/javascript/api/sp-loader/spcomponentloader) to load the scripts in the SPFx component's code.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the locale from the URL (requirements for MS Docs)... let the service route to the user's locale for localization.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! My bad...
Done.

@andrewconnell andrewconnell self-assigned this Jan 30, 2020
@andrewconnell andrewconnell merged commit 1aacc4b into SharePoint:master Jan 31, 2020
@AJIXuMuK AJIXuMuK deleted the patch-6 branch September 2, 2021 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants