Upgrade to SPFx 1.12.1

This commit is contained in:
Ari Gunawan 2021-07-09 20:38:05 +07:00
parent a3c0fc3b33
commit 02e4dd2b97
19 changed files with 14106 additions and 10559 deletions

View File

@ -9,6 +9,7 @@ node_modules
# Build generated files # Build generated files
dist dist
lib lib
release
solution solution
temp temp
*.sppkg *.sppkg

View File

@ -12,6 +12,7 @@
"webRoot": "${workspaceRoot}", "webRoot": "${workspaceRoot}",
"sourceMaps": true, "sourceMaps": true,
"sourceMapPathOverrides": { "sourceMapPathOverrides": {
"webpack:///.././src/*": "${webRoot}/src/*",
"webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*" "webpack:///../../../../../src/*": "${webRoot}/src/*"
@ -28,6 +29,7 @@
"webRoot": "${workspaceRoot}", "webRoot": "${workspaceRoot}",
"sourceMaps": true, "sourceMaps": true,
"sourceMapPathOverrides": { "sourceMapPathOverrides": {
"webpack:///.././src/*": "${webRoot}/src/*",
"webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*",
"webpack:///../../../../../src/*": "${webRoot}/src/*" "webpack:///../../../../../src/*": "${webRoot}/src/*"

View File

@ -7,16 +7,7 @@
"**/bower_components": true, "**/bower_components": true,
"**/coverage": true, "**/coverage": true,
"**/lib-amd": true, "**/lib-amd": true,
"src/**/*.scss.ts": true, "src/**/*.scss.ts": true
"**/node_modules": true,
"**/typings": true,
"**/.editorconfig": true,
"**/.yo-rc.json": true,
"**/package-lock.json": true,
"**/.vscode": true,
"**/temp": true,
"**/lib": true,
"**/dist": true
}, },
"typescript.tsdk": ".\\node_modules\\typescript\\lib" "typescript.tsdk": ".\\node_modules\\typescript\\lib"
} }

View File

@ -2,10 +2,11 @@
"@microsoft/generator-sharepoint": { "@microsoft/generator-sharepoint": {
"isCreatingSolution": true, "isCreatingSolution": true,
"environment": "spo", "environment": "spo",
"version": "1.5.1", "version": "1.12.1",
"libraryName": "react-facebook-plugin", "libraryName": "react-facebook-plugin",
"libraryId": "2608d0f3-26fe-4142-941e-d5937bbbb952", "libraryId": "2608d0f3-26fe-4142-941e-d5937bbbb952",
"packageManager": "npm", "packageManager": "npm",
"componentType": "webpart" "componentType": "webpart",
"isDomainIsolated": false
} }
} }

View File

@ -8,47 +8,41 @@ The key differences between using Embed web part and current example are the str
![preview](./assets/preview.png) ![preview](./assets/preview.png)
## Used SharePoint Framework Version ## Compatibility
![drop](https://img.shields.io/badge/drop-1.5.1-blue.svg) ![SPFx 1.12.1](https://img.shields.io/badge/SPFx-1.12.1-green.svg)
![Node.js LTS v14 | LTS v12 | LTS v10](https://img.shields.io/badge/Node.js-LTS%20v14%20%7C%20LTS%20v12%20%7C%20LTS%20v10-green.svg)
![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-yellow.svg)
![Teams N/A: Untested with Microsoft Teams](https://img.shields.io/badge/Teams-N%2FA-lightgrey.svg "Untested with Microsoft Teams")
![Workbench Local | Hosted](https://img.shields.io/badge/Workbench-Local%20%7C%20Hosted-green.svg)
## Applies to ## Applies to
* [SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview) * [SharePoint Framework](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
* [Office 365 tenant](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment) * [Microsoft 365 tenant](https://docs.microsoft.com/sharepoint/dev/spfx/set-up-your-development-environment)
## Solution ## Solution
Solution|Author(s) Solution|Author(s)
---------|---------- --------|---------
react-facebook-plugin | Andrew Koltyakov ([@AndrewKoltyakov](https://twitter.com/AndrewKoltyakov)) react-facebook-plugin | [Andrew Koltyakov](https://github.com/koltyakov) ([@AndrewKoltyakov](https://twitter.com/AndrewKoltyakov))
react-facebook-plugin | [Ari Gunawan](https://github.com/AriGunawan) ([@AriGunawan3023](https://twitter.com/AriGunawan3023))
## Version history ## Version history
Version|Date|Comments Version|Date|Comments
--------|-----|--------- -------|----|--------
1.0 | August 26, 2018 | Initial release 1.0 | August 26, 2018 | Initial release
1.1|July 9, 2021|Upgrade to SPFx 1.12.1
## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
---
## Minimal Path to Awesome ## Minimal Path to Awesome
### Local testing
* Clone the repository * Clone the repository
* `cd` to web part's project folder * `cd` to web part's project folder
* In the command line run: * In the command line run:
* `npm install` * `npm install`
* `gulp serve` * `gulp serve`
### Deployment
Follow the usual SPFx deployment process up to your preferences.
## Features ## Features
This web part illustrates the following concepts on top of the SharePoint Framework: This web part illustrates the following concepts on top of the SharePoint Framework:
@ -56,4 +50,18 @@ This web part illustrates the following concepts on top of the SharePoint Framew
* Observe parent container width and dynamic adaptation of absolute-width'ed HTML elements * Observe parent container width and dynamic adaptation of absolute-width'ed HTML elements
* React * React
## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
## Help
We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.
If you encounter any issues while using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=react-facebook-plugin&authors=@koltyakov%20@AriGunawan&title=react-facebook-plugin%20-%20).
For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=react-facebook-plugin&authors=@koltyakov%20@AriGunawan&title=react-facebook-plugin%20-%20).
Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=react-facebook-plugin&authors=@koltyakov%20@AriGunawan&title=react-facebook-plugin%20-%20).
<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-facebook-plugin" /> <img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-facebook-plugin" />

View File

@ -11,8 +11,8 @@
] ]
} }
}, },
"externals": {},
"localizedResources": { "localizedResources": {
"FacebookPageWebPartStrings": "lib/webparts/facebookPage/loc/{locale}.js" "FacebookPageWebPartStrings": "lib/webparts/facebookPage/loc/{locale}.js"
}, }
"externals": {}
} }

View File

@ -1,4 +1,4 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy" "deployCdnPath": "./release/assets/"
} }

View File

@ -1,6 +1,6 @@
{ {
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/", "workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->", "account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "react-facebook-plugin", "container": "react-facebook-plugin",
"accessKey": "<!-- ACCESS KEY -->" "accessKey": "<!-- ACCESS KEY -->"

View File

@ -3,8 +3,17 @@
"solution": { "solution": {
"name": "react-facebook-plugin-client-side-solution", "name": "react-facebook-plugin-client-side-solution",
"id": "a395e8a8-07fd-4a20-bc10-ad1cd91fb5b9", "id": "a395e8a8-07fd-4a20-bc10-ad1cd91fb5b9",
"version": "1.0.0.0", "version": "1.1.0.0",
"includeClientSideAssets": true "includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "",
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": ""
}
}, },
"paths": { "paths": {
"zippedPackage": "solution/react-facebook-plugin.sppkg" "zippedPackage": "solution/react-facebook-plugin.sppkg"

View File

@ -1,7 +1,16 @@
'use strict'; 'use strict';
const gulp = require('gulp');
const build = require('@microsoft/sp-build-web'); const build = require('@microsoft/sp-build-web');
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
build.initialize(gulp); var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);
result.set('serve', result.get('serve-deprecated'));
return result;
};
build.initialize(require('gulp'));

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,7 @@
"name": "react-facebook-plugin", "name": "react-facebook-plugin",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"engines": { "main": "lib/index.js",
"node": ">=0.10.0"
},
"scripts": { "scripts": {
"build": "npm run clean && gulp build && gulp bundle && gulp package-solution", "build": "npm run clean && gulp build && gulp bundle && gulp package-solution",
"build:prod": "npm run clean && gulp build --ship && gulp bundle --ship && gulp package-solution --ship", "build:prod": "npm run clean && gulp build --ship && gulp bundle --ship && gulp package-solution --ship",
@ -13,27 +11,26 @@
"test": "gulp test" "test": "gulp test"
}, },
"dependencies": { "dependencies": {
"@microsoft/sp-core-library": "1.5.1", "@microsoft/sp-core-library": "1.12.1",
"@microsoft/sp-lodash-subset": "1.5.1", "@microsoft/sp-lodash-subset": "1.12.1",
"@microsoft/sp-office-ui-fabric-core": "1.5.1", "@microsoft/sp-office-ui-fabric-core": "1.12.1",
"@microsoft/sp-webpart-base": "1.5.1", "@microsoft/sp-property-pane": "1.12.1",
"@types/es6-promise": "0.0.33", "@microsoft/sp-webpart-base": "1.12.1",
"@types/react": "15.6.6", "office-ui-fabric-react": "7.156.0",
"@types/react-dom": "15.5.6",
"@types/webpack-env": "1.13.1",
"on-el-resize": "0.0.4", "on-el-resize": "0.0.4",
"react": "15.6.2", "react": "16.9.0",
"react-dom": "15.6.2" "react-dom": "16.9.0"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.5.1", "@microsoft/rush-stack-compiler-3.7": "0.2.3",
"@microsoft/sp-module-interfaces": "1.5.1", "@microsoft/sp-build-web": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.5.1", "@microsoft/sp-module-interfaces": "1.12.1",
"@types/chai": "3.4.34", "@microsoft/sp-tslint-rules": "1.12.1",
"@types/mocha": "2.2.38", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/react": "16.9.36",
"@types/react-dom": "16.9.8",
"@types/webpack-env": "1.13.1",
"ajv": "~5.2.2", "ajv": "~5.2.2",
"gulp": "~3.9.1", "gulp": "~4.0.2"
"tslint-config-standard": "^7.1.0",
"tslint-react": "^3.6.0"
} }
} }

View File

@ -0,0 +1 @@
// A file is required to be in the root of the /src directory by the TypeScript compiler

View File

@ -6,6 +6,7 @@
"version": "*", "version": "*",
"manifestVersion": 2, "manifestVersion": 2,
"requiresCustomScript": false, "requiresCustomScript": false,
"supportedHosts": ["SharePointWebPart"],
"preconfiguredEntries": [{ "preconfiguredEntries": [{
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", "groupId": "5c03119e-3074-46fd-976b-c60198311f70",
"group": { "default": "Other" }, "group": { "default": "Other" },

View File

@ -1,12 +1,8 @@
import * as React from 'react'; import * as React from 'react';
import * as ReactDom from 'react-dom'; import * as ReactDom from 'react-dom';
import { Version } from '@microsoft/sp-core-library'; import { Version } from '@microsoft/sp-core-library';
import { import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base";
BaseClientSideWebPart, import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneToggle } from "@microsoft/sp-property-pane";
IPropertyPaneConfiguration,
PropertyPaneTextField,
PropertyPaneToggle
} from '@microsoft/sp-webpart-base';
import * as strings from 'FacebookPageWebPartStrings'; import * as strings from 'FacebookPageWebPartStrings';
import FacebookPage from './components/FacebookPage'; import FacebookPage from './components/FacebookPage';

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 933 B

View File

@ -1,4 +1,5 @@
{ {
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.7/includes/tsconfig-web.json",
"compilerOptions": { "compilerOptions": {
"target": "es5", "target": "es5",
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
@ -9,18 +10,26 @@
"sourceMap": true, "sourceMap": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"skipLibCheck": true, "skipLibCheck": true,
"outDir": "lib",
"inlineSources": false,
"strictNullChecks": false,
"noUnusedLocals": false,
"typeRoots": [ "typeRoots": [
"./node_modules/@types", "./node_modules/@types",
"./node_modules/@microsoft" "./node_modules/@microsoft"
], ],
"types": [ "types": [
"es6-promise",
"webpack-env" "webpack-env"
], ],
"lib": [ "lib": [
"es5", "es5",
"dom", "dom",
"es2015.collection" "es2015.collection",
"es2015.promise"
]
},
"include": [
"src/**/*.ts",
"src/**/*.tsx"
] ]
} }
}

View File

@ -1,9 +1,30 @@
{ {
"extends": ["tslint-config-standard", "tslint-react", "./config/tslint.json"], "extends": "./node_modules/@microsoft/sp-tslint-rules/base-tslint.json",
"rules": { "rules": {
"space-before-function-paren": false, "class-name": false,
"semicolon": [ true, "always", "ignore-interfaces" ], "export-name": false,
"jsx-no-multiline-js": false, "forin": false,
"jsx-no-lambda": false "label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
} }
} }