Skip to content

Release Notes Drop 5

Pat Miller edited this page Oct 17, 2016 · 11 revisions

Ignite is over! That means we get to make bigger changes in this drop, and we've tried to take advantage of it. We've got a nice collection of updates.

Getting the new bits

Make sure that your @microsoft/generator-sharepoint npm package is version 0.2.1. To get the latest version, run npm i -g @microsoft/generator-sharepoint@latest

Updating your existing projects

Getting your node modules set up correctly

1 - Open package.json and set the versions of the following packages:

  • "@microsoft/sp-client-base": "~0.4.0",

  • "@microsoft/sp-client-preview": "~0.5.0"

  • "@microsoft/sp-build-web": "~0.7.0",

  • "@microsoft/sp-module-interfaces": "~0.4.0",

  • "@microsoft/sp-webpart-workbench": "~0.5.0"

2 - Run npm update then npm prune then npm dedupe
This will update all the packages then optimize the node_modules folder size.

3 - Run gulp nuke to clean up any old build artifacts

4 - run gulp trust-dev-cert to install and trust a developer certificate on your machine (optional, but recommended. You only need to do this once per machine, not once per project)

5 - Run gulp to build your updated project

What changed in this drop?

TypeScript 2

TypeScript 2 went live, and we've migrated the build tools and the framework over to it. The conversion went surprisingly smoothly. TypeScript 2 notes are available here - https://www.typescriptlang.org/docs/release-notes/typescript-2.0.html

New BaseClientSideWebPart package location (and some changes)

We've created the final location for the BaseClientSideWebPart component - (sp-webpart-base/BaseClientSideWebPart). We'll leave a copy in the original location (sp-client-preview/BaseClientSideWebPart) for a few weeks before deleting it so you can have some time to migrate your code. The version in sp-client-preview will not change (at least not much), but the one in sp-webpart-base will. Be prepared to make more changes on each drop if you are using the newer versions. In the next drop we will make this the default code, but we'll stick with the older implementation as the default for this drop.

How to use it

In order to move to the newer implementation, you need to do a few things.

  • 1 - Add the package via npm i --save @microsoft/sp-webpart-base . This should update the dependencies section of your package.json file to reference "@microsoft/sp-webpart-base":"~0.1.0".

  • 2 - Update the config.json file in the config folder to add it to the externals section under sp-client-preview "@microsoft/sp-webpart-base": "node_modules/@microsoft/sp-webpart-base/dist/sp-webpart-base.js",

  • 3 - Update your webpart source code to move the import references from @microsoft/sp-client-preview to @microsoft/sp-webpart-base

Changes to the package are as follows

  • renderedFromDefaultProperties has been renamed renderedFromPersistedData
  • onPropertyChange(propertyPath: string, newValue: any) has been renamed onPropertyChanged(propertyPath: string, oldValue: any, newValue: any)

Page Context

We ultimately want to move away from accessing the window variable for the page context, and instead move towards a nicely typed set of classes. There are some problems around using the window variable in a world that does things like page navigation without always refetching items from the back end server, where things can change over time. Even things like the RequestDigest are really only valid for a short while after the page loads, and your webpart might get loaded onto a page 2 minutes after the initial page, since the user navigated around a few pages first.

  • PageContext has two new properties - list and listItem
  • SPSite has two new properties - absoluteUrl and serverRelativeUrl
  • SPWeb has three new properties - language, logoUrl, templateName

Office UI Fabric

We've Upgraded office-ui-fabric-react to 0.52.0 (it appears this was NOT in the last drop). This will cause icon changes.

Workbench

  • Fixed mobile preview dimension input
  • Added more fields to workbench page context
  • Change redirect logic to point at localhost, rather than hostname
  • Utilize newest version of Office UI Fabric
  • Added a new command gulp trust-dev-cert that will install a certificate on your dev box to avoid the untrusted warnings or possible http/https issues
  • There is also a corresponding gulp untrust-dev-cert to remove the certificate.

sp-client-preview

  • Deprecating propertyPane code, as it has been moved to @microsoft/sp-webpart-base
  • Support for multiple preconfiguredEntries in a web part manifest.
  • Fixing property pane workbench visibility issues
  • Fixing ClientSide WebPart Manager error messages, as some were not appearing
  • Deprecated IOData interfaces, as they hav been moved to @microsoft/sp-client-base
  • Utilize new context properties in Shell and ClassicPageHost
  • Small fixes to Property Pane styling (background color, description color, etc)
  • Fixing an issue where the toolbox would show an error in the workbench when no webparts could be loaded.

sp-module-interfaces

  • Adds a field to WebPart manifest for disabling the WebPart on a Classic page
  • IClientSideWebPartManifestInstance doesn't extend IClientSideWebPartManifestEntry anymore
  • For manifests, the id field should be a GUID
  • Updates standard library modules list to include @microsoft/sp-webpart-base

sp-module-loader

  • Refactored dev dashboard to allow tabs to be registered by bundles other than the module loader
  • Change baseURL to https://baseURL to reduce confusion while debugging

sp-build-web

  • Including new "dev-deploy" task for deploying code under development to a private CDN to be shared among colleagues.
  • Including new "trust-dev-cert" and "untrust-dev-cert" tasks.
  • Updating gulp serve manifests to point to localhost instead of the local hostname.
  • Fixing task readme links.
  • Improve the error message during manifest validation
  • Update CopyTask schema to include the new shouldFlatten option

Generator

Clone this wiki locally