SharePoint Development with the SharePoint Framework
上QQ阅读APP看书,第一时间看更新

Office Developer Patterns and Practices in practice

For this particular reason, with a few driving forces within Microsoft and the community, the Office Developer Patterns and Practices emerged some years ago. Office Dev PnP, for short, is a massive project aiming to provide a centralized hub for most of the issues listed earlier.

The project currently has the following subcategories for SharePoint:

In addition, the Office Dev PnP team is highly active on https://dev.office.com, providing more refined guidance and patterns for developers.

In practice, the Office Dev PnP aids developers wishing to become better on their journey with the SharePoint Framework by providing a wealth of guidance and code that can be freely reused.

The obvious one is the SharePoint Framework web parts, which is a GitHub repository that can be accessed at https://github.com/SharePoint/sp-dev-fx-webparts. This repo has several ready-made client-side web parts that can be freely used, enhanced, and modified.

The other very important and useful Office Dev PnP repository is the collection of PowerShell tools, found at https://github.com/SharePoint/PnP-PowerShell. This is a huge archive of PowerShell cmdlets, that allows developers and IT pros to remotely access, modify, and change most aspects of SharePoint and SharePoint Online sites. This becomes essentially more useful when you consider the use cases for a scripted installation of a SharePoint project.

As you cannot deploy all your artifacts and changes within the SharePoint Framework project, you will typically need a supporting project that provisions and pre-creates elements for your SharePoint Framework components. Imagine an out-of-the-box intranet solution that requires several client-side web parts, but also artifacts that are typically found in SharePoint sites, such as metadata structures (content type, site columns), SharePoint lists, and document libraries and subsites. You can easily use the PowerShell cmdlets to pre-create these during the initial deployment of your solution. When you then drop the relevant SharePoint Framework client-side web parts on the canvas, you can rest assured that the supported data and structures are in place.

You can download a ready-made installation package that includes all relevant PowerShell cmdlets you might ever need to modify your SharePoint sites from the same repository.