Skip to content

Commit

Permalink
Adding tslib dependency to remove redundant code. (#1942)
Browse files Browse the repository at this point in the history
* Updating all packages to use tslib.

* Updating dependencies.
  • Loading branch information
dzearing authored Jun 6, 2017
1 parent 1a785e3 commit 1820479
Show file tree
Hide file tree
Showing 30 changed files with 174 additions and 59 deletions.
1 change: 1 addition & 0 deletions apps/component-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"office-ui-fabric-react": ">=1.5.5 <2.0.0",
"react": ">=15.3.2 <16.0.0",
"react-dom": ">=15.3.2 <16.0.0",
"tslib": "^1.6.0",
"typescript": "2.2.2"
}
}
1 change: 1 addition & 0 deletions apps/component-demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"sourceMap": true,
"experimentalDecorators": true,
"noEmitOnError": true,
"importHelpers": true,
"moduleResolution": "node",
"types": [
"chai",
Expand Down
3 changes: 2 additions & 1 deletion apps/fabric-website/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ let rules = Object.assign(
);
build.tslint.setConfig({
lintConfig: { rules },
sourceMatch: ['src/**/*.ts', 'src/**/*.tsx', '!src/**/*.scss.tsx']
displayAsWarning: false
});

// TODO: remove this! There are a number of lint errors to fix.
build.tslint.isEnabled = () => false;

Expand Down
3 changes: 2 additions & 1 deletion apps/fabric-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@
},
"dependencies": {
"@uifabric/example-app-base": "2.1.0",
"@uifabric/utilities": ">=4.1.0 <5.0.0",
"color-functions": "1.1.0",
"json-loader": "^0.5.4",
"load-themed-styles": "^1.1.0",
"office-ui-fabric-core": ">=7.0.0 <8.0.0",
"office-ui-fabric-react": ">=4.3.1 <5.0.0",
"@uifabric/utilities": ">=4.1.0 <5.0.0"
"tslib": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions apps/fabric-website/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"types": [
"chai",
Expand Down
3 changes: 2 additions & 1 deletion apps/ssr-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"webpack-node-externals": "^1.5.4"
},
"dependencies": {
"es6-promise": "^4.1.0"
"es6-promise": "^4.1.0",
"tslib": "^1.6.0"
}
}
3 changes: 2 additions & 1 deletion apps/test-bundle-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"dependencies": {
"react": "^0.14 || ^15.0.1-0 || ^16.0.0-0",
"react-dom": "^0.14 || ^15.0.1-0 || ^16.0.0-0",
"office-ui-fabric-react": ">=4.3.0 <5.0.0"
"office-ui-fabric-react": ">=4.3.0 <5.0.0",
"tslib": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions apps/test-bundle-button/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"types": [
"webpack-env"
Expand Down
3 changes: 2 additions & 1 deletion apps/todo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"office-ui-fabric-react": ">=4.3.0 <5.0.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"typescript": "2.2.2"
"typescript": "2.2.2",
"tslib": "^1.6.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/example-app-base",
"comment": "Adding tslib dependency to reduce re",
"type": "patch"
}
],
"packageName": "@uifabric/example-app-base",
"email": "[email protected]"
}
11 changes: 11 additions & 0 deletions common/changes/@uifabric/styling/tslib-fix_2017-06-06-05-19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/styling",
"comment": "Adding tslib dependency to reduce re",
"type": "patch"
}
],
"packageName": "@uifabric/styling",
"email": "[email protected]"
}
11 changes: 11 additions & 0 deletions common/changes/@uifabric/utilities/tslib-fix_2017-06-06-05-19.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/utilities",
"comment": "Adding tslib dependency to reduce re",
"type": "patch"
}
],
"packageName": "@uifabric/utilities",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Adding tslib dependency to reduce redundant code.",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
14 changes: 7 additions & 7 deletions common/config/rush/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion packages/example-app-base/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ let rules = Object.assign(
require('./node_modules/office-ui-fabric-react-tslint/tslint.json').rules,
require('./tslint.json').rules
);
build.tslint.setConfig({ lintConfig: { rules } });
build.tslint.setConfig({
lintConfig: { rules },
displayAsWarning: false
});

// Configure TypeScript.
build.TypeScriptConfiguration.setTypescriptCompiler(require('typescript'));
Expand Down
3 changes: 2 additions & 1 deletion packages/example-app-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@uifabric/utilities": ">=4.1.0 <5.0.0",
"highlight.js": "^9.9.0",
"office-ui-fabric-core": ">=7.0.0 <8.0.0",
"office-ui-fabric-react": ">=2.0.0 <3.0.0"
"office-ui-fabric-react": ">=2.0.0 <3.0.0",
"tslib": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions packages/example-app-base/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"lib": [
"es2017",
Expand Down
5 changes: 4 additions & 1 deletion packages/example-component/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ let rules = Object.assign(
require('./node_modules/office-ui-fabric-react-tslint/tslint.json').rules,
require('./tslint.json').rules
);
build.tslint.setConfig({ lintConfig: { rules } });
build.tslint.setConfig({
lintConfig: { rules },
displayAsWarning: false
});

// Use css modules.
build.sass.setConfig({
Expand Down
3 changes: 2 additions & 1 deletion packages/example-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"react-dom": "^0.14 || ^15.4.2 || ^16.0.0-0"
},
"dependencies": {
"office-ui-fabric-react": ">=4.3.1 <5.0.0"
"office-ui-fabric-react": ">=4.3.1 <5.0.0",
"tslib": "^1.6.0"
}
}
1 change: 1 addition & 0 deletions packages/example-component/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"noImplicitAny": false,
"strictNullChecks": true,
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"sourceMap": true,
"jsx": "react",
Expand Down
5 changes: 4 additions & 1 deletion packages/office-ui-fabric-react/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ let rules = Object.assign(
require('./node_modules/office-ui-fabric-react-tslint/tslint.json').rules,
require('./tslint.json').rules
);
build.tslint.setConfig({ lintConfig: { rules } });
build.tslint.setConfig({
lintConfig: { rules },
displayAsWarning: false
});

// Configure TypeScript.
// build.typescript.setConfig({ typescript: require('typescript') });
Expand Down
3 changes: 2 additions & 1 deletion packages/office-ui-fabric-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"@microsoft/load-themed-styles": "^1.2.2",
"@uifabric/utilities": ">=4.1.0 <5.0.0",
"@uifabric/styling": ">=0.5.0 <1.0.0",
"prop-types": "^15.5.10"
"prop-types": "^15.5.10",
"tslib": "^1.6.0"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.0.1-0 || ^16.0.0-0",
Expand Down
1 change: 1 addition & 0 deletions packages/office-ui-fabric-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"declaration": true,
"sourceMap": true,
"experimentalDecorators": true,
"importHelpers": true,
"moduleResolution": "node",
"lib": [
"es2017",
Expand Down
19 changes: 18 additions & 1 deletion packages/styling/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
'use strict';

let build = require('@microsoft/sp-build-web');
let path = require('path');
let gulp = require('gulp');
let buildConfig = build.getConfig();

let isProduction = process.argv.indexOf('--production') >= 0;
let isClean = process.argv.indexOf('clean') >= 0;

// initialize tasks.
build.initialize(gulp);
Expand All @@ -16,13 +21,25 @@ let rules = Object.assign(
require('./node_modules/office-ui-fabric-react-tslint/tslint.json').rules,
require('./tslint.json').rules
);
build.tslint.setConfig({ lintConfig: { rules } });
build.tslint.setConfig({
lintConfig: { rules },
displayAsWarning: false
});

// Disable all unnecessary tasks.
build.sass.isEnabled = () => false;
build.karma.isEnabled = () => false;
build.text.isEnabled = () => false;
build.preCopy.isEnabled = () => false;

let packageFolder = buildConfig.packageFolder || '';
let distFolder = buildConfig.distFolder;

if (isProduction || isClean) {
build.setConfig({
libAMDFolder: path.join(packageFolder, 'lib-amd')
});
}

// Until typings work.
build.apiExtractor.isEnabled = () => false;
6 changes: 3 additions & 3 deletions packages/styling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"react-dom": "^15.4.2",
"source-map-loader": "^0.2.1",
"ts-loader": "^2.1.0",
"tslib": "^1.6.0",
"typescript": "2.2.2",
"uglifyjs-webpack-plugin": "^0.4.3",
"webpack": "^2.4.1",
Expand All @@ -47,7 +46,8 @@
"dependencies": {
"@microsoft/load-themed-styles": "^1.2.2",
"@uifabric/utilities": ">=4.1.0 <5.0.0",
"glamor": "^2.20.24",
"rtl-css-js": "^1.1.0"
"tslib": "^1.6.0",
"rtl-css-js": "^1.1.0",
"glamor": "^2.20.24"
}
}
Loading

0 comments on commit 1820479

Please sign in to comment.