# Upgrade project D:\Dev\Pnp\Puzzlepart\spfx-solutions\Pzl.Ext.GoogleAnalytics to v1.9.1 Date: 9/18/2019 ## Findings Following is the list of steps required to upgrade your project to SharePoint Framework version 1.9.1. [Summary](#Summary) of the modifications is included at the end of the report. ### FN001001 @microsoft/sp-core-library | Required Upgrade SharePoint Framework dependency package @microsoft/sp-core-library Execute the following command: ```sh npm i -SE @microsoft/sp-core-library@1.9.1 ``` File: [./package.json](./package.json) ### FN001011 @microsoft/sp-dialog | Required Upgrade SharePoint Framework dependency package @microsoft/sp-dialog Execute the following command: ```sh npm i -SE @microsoft/sp-dialog@1.9.1 ``` File: [./package.json](./package.json) ### FN001012 @microsoft/sp-application-base | Required Upgrade SharePoint Framework dependency package @microsoft/sp-application-base Execute the following command: ```sh npm i -SE @microsoft/sp-application-base@1.9.1 ``` File: [./package.json](./package.json) ### FN001013 @microsoft/decorators | Required Upgrade SharePoint Framework dependency package @microsoft/decorators Execute the following command: ```sh npm i -SE @microsoft/decorators@1.9.1 ``` File: [./package.json](./package.json) ### FN002001 @microsoft/sp-build-web | Required Upgrade SharePoint Framework dev dependency package @microsoft/sp-build-web Execute the following command: ```sh npm i -DE @microsoft/sp-build-web@1.9.1 ``` File: [./package.json](./package.json) ### FN002002 @microsoft/sp-module-interfaces | Required Upgrade SharePoint Framework dev dependency package @microsoft/sp-module-interfaces Execute the following command: ```sh npm i -DE @microsoft/sp-module-interfaces@1.9.1 ``` File: [./package.json](./package.json) ### FN002003 @microsoft/sp-webpart-workbench | Required Upgrade SharePoint Framework dev dependency package @microsoft/sp-webpart-workbench Execute the following command: ```sh npm i -DE @microsoft/sp-webpart-workbench@1.9.1 ``` File: [./package.json](./package.json) ### FN002009 @microsoft/sp-tslint-rules | Required Install SharePoint Framework dev dependency package @microsoft/sp-tslint-rules Execute the following command: ```sh npm i -DE @microsoft/sp-tslint-rules@1.9.1 ``` File: [./package.json](./package.json) ### FN002011 @microsoft/rush-stack-compiler-2.9 | Required Install SharePoint Framework dev dependency package @microsoft/rush-stack-compiler-2.9 Execute the following command: ```sh npm i -DE @microsoft/rush-stack-compiler-2.9@0.7.16 ``` File: [./package.json](./package.json) ### FN010001 .yo-rc.json version | Recommended Update version in .yo-rc.json In file [./.yo-rc.json](./.yo-rc.json) update the code as follows: ```json { "@microsoft/generator-sharepoint": { "version": "1.9.1" } } ``` File: [./.yo-rc.json](./.yo-rc.json) ### FN021001 main | Required Add package.json property In file [./package.json](./package.json) update the code as follows: ```json { "main": "lib/index.js" } ``` File: [./package.json](./package.json) ### FN012017 tsconfig.json extends property | Required Update tsconfig.json extends property In file [./tsconfig.json](./tsconfig.json) update the code as follows: ```json { "extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json" } ``` File: [./tsconfig.json](./tsconfig.json) ### FN012014 tsconfig.json compiler options inlineSources | Required Update tsconfig.json inlineSources value In file [./tsconfig.json](./tsconfig.json) update the code as follows: ```json { "compilerOptions": { "inlineSources": false } } ``` File: [./tsconfig.json](./tsconfig.json) ### FN012015 tsconfig.json compiler options strictNullChecks | Required Update tsconfig.json strictNullChecks value In file [./tsconfig.json](./tsconfig.json) update the code as follows: ```json { "compilerOptions": { "strictNullChecks": false } } ``` File: [./tsconfig.json](./tsconfig.json) ### FN012016 tsconfig.json compiler options noUnusedLocals | Required Update tsconfig.json noUnusedLocals value In file [./tsconfig.json](./tsconfig.json) update the code as follows: ```json { "compilerOptions": { "noUnusedLocals": false } } ``` File: [./tsconfig.json](./tsconfig.json) ### FN014006 sourceMapPathOverrides in .vscode/launch.json | Recommended In the .vscode/launch.json file, for each configuration, in the sourceMapPathOverrides property, add "webpack:///.././src/*": "${webRoot}/src/*" In file [.vscode\launch.json](.vscode\launch.json) update the code as follows: ```json { "configurations": [ { "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*" } } ] } ``` File: [.vscode\launch.json](.vscode\launch.json) ### FN014006 sourceMapPathOverrides in .vscode/launch.json | Recommended In the .vscode/launch.json file, for each configuration, in the sourceMapPathOverrides property, add "webpack:///.././src/*": "${webRoot}/src/*" In file [.vscode\launch.json](.vscode\launch.json) update the code as follows: ```json { "configurations": [ { "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*" } } ] } ``` File: [.vscode\launch.json](.vscode\launch.json) ### FN002008 tslint-microsoft-contrib | Required Remove SharePoint Framework dev dependency package tslint-microsoft-contrib Execute the following command: ```sh npm un -D tslint-microsoft-contrib ``` File: [./package.json](./package.json) ### FN006003 package-solution.json isDomainIsolated | Required Update package-solution.json isDomainIsolated In file [./config/package-solution.json](./config/package-solution.json) update the code as follows: ```json { "solution": { "isDomainIsolated": false } } ``` File: [./config/package-solution.json](./config/package-solution.json) ### FN010007 .yo-rc.json isDomainIsolated | Recommended Update isDomainIsolated in .yo-rc.json In file [./.yo-rc.json](./.yo-rc.json) update the code as follows: ```json { "@microsoft/generator-sharepoint": { "isDomainIsolated": false } } ``` File: [./.yo-rc.json](./.yo-rc.json) ### FN019001 tslint.json rulesDirectory | Required Remove rulesDirectory from tslint.json In file [./tslint.json](./tslint.json) update the code as follows: ```json { "rulesDirectory": [] } ``` File: [./tslint.json](./tslint.json) ### FN019002 tslint.json extends | Required Update tslint.json extends property In file [./tslint.json](./tslint.json) update the code as follows: ```json { "extends": "@microsoft/sp-tslint-rules/base-tslint.json" } ``` File: [./tslint.json](./tslint.json) ### FN017001 Run npm dedupe | Optional If, after upgrading npm packages, when building the project you have errors similar to: "error TS2345: Argument of type 'SPHttpClientConfiguration' is not assignable to parameter of type 'SPHttpClientConfiguration'", try running 'npm dedupe' to cleanup npm packages. Execute the following command: ```sh npm dedupe ``` File: [./package.json](./package.json) ## Summary ### Execute script ```sh npm i -SE @microsoft/sp-core-library@1.9.1 @microsoft/sp-dialog@1.9.1 @microsoft/sp-application-base@1.9.1 @microsoft/decorators@1.9.1 npm i -DE @microsoft/sp-build-web@1.9.1 @microsoft/sp-module-interfaces@1.9.1 @microsoft/sp-webpart-workbench@1.9.1 @microsoft/sp-tslint-rules@1.9.1 @microsoft/rush-stack-compiler-2.9@0.7.16 npm un -D tslint-microsoft-contrib ``` ### Modify files #### [./.yo-rc.json](./.yo-rc.json) Update version in .yo-rc.json: ```json { "@microsoft/generator-sharepoint": { "version": "1.9.1" } } ``` Update isDomainIsolated in .yo-rc.json: ```json { "@microsoft/generator-sharepoint": { "isDomainIsolated": false } } ``` #### [./package.json](./package.json) Add package.json property: ```json { "main": "lib/index.js" } ``` #### [./tsconfig.json](./tsconfig.json) Update tsconfig.json extends property: ```json { "extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json" } ``` Update tsconfig.json inlineSources value: ```json { "compilerOptions": { "inlineSources": false } } ``` Update tsconfig.json strictNullChecks value: ```json { "compilerOptions": { "strictNullChecks": false } } ``` Update tsconfig.json noUnusedLocals value: ```json { "compilerOptions": { "noUnusedLocals": false } } ``` #### [.vscode\launch.json](.vscode\launch.json) In the .vscode/launch.json file, for each configuration, in the sourceMapPathOverrides property, add "webpack:///.././src/*": "${webRoot}/src/*": ```json { "configurations": [ { "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*" } } ] } ``` In the .vscode/launch.json file, for each configuration, in the sourceMapPathOverrides property, add "webpack:///.././src/*": "${webRoot}/src/*": ```json { "configurations": [ { "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*" } } ] } ``` #### [./config/package-solution.json](./config/package-solution.json) Update package-solution.json isDomainIsolated: ```json { "solution": { "isDomainIsolated": false } } ``` #### [./tslint.json](./tslint.json) Remove rulesDirectory from tslint.json: ```json { "rulesDirectory": [] } ``` Update tslint.json extends property: ```json { "extends": "@microsoft/sp-tslint-rules/base-tslint.json" } ```