Skip to content

Commit b6358b2

Browse files
authored
build: update to tslib 2.0 and move to direct dependencies (#19393)
Tslib version is bound to the TypeScript version used to compile the library. Thus, we shouldn't list `tslib` as a `peerDependencies`. This is because, a user can install libraries which have been compiled with older versions of TypeScript and thus require multiple `tslib` versions to be installed. While with TS 3.9, we can still use 1.13.0, this isn't a guarantee that tslib will not be breaking in other major versions or future versions of typescript will need a new helper that will be in version 2. In this case we’d be forced to update to tslib but this would break all libraries in the wild that require tslib 1.x. If we keep relying on peerDeps, since only a single version of the lib can be installed that meets the peerDependency criteria. This change we also be applied to all community libraries using ng-packagr. Reference: TOOL-1374 and TOOL-1376
1 parent 2d64ad7 commit b6358b2

File tree

9 files changed

+25
-13
lines changed

9 files changed

+25
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"material-components-web": "7.0.0-canary.4497b86ed.0",
6363
"rxjs": "^6.5.3",
6464
"systemjs": "0.19.43",
65-
"tslib": "^1.12.0",
65+
"tslib": "^2.0.0",
6666
"zone.js": "~0.10.2"
6767
},
6868
"devDependencies": {

packages.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# version for the placeholders.
44
ANGULAR_PACKAGE_VERSION = "^10.0.0-0 || ^11.0.0-0"
55
MDC_PACKAGE_VERSION = "^6.0.0-canary.265ecbad5.0"
6-
TSLIB_PACKAGE_VERSION = "^1.10.0"
6+
TSLIB_PACKAGE_VERSION = "^2.0.0"
77

88
VERSION_PLACEHOLDER_REPLACEMENTS = {
99
"0.0.0-MDC": MDC_PACKAGE_VERSION,

src/cdk-experimental/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"homepage": "https://github.com/angular/components#readme",
1414
"peerDependencies": {
1515
"@angular/cdk": "0.0.0-PLACEHOLDER",
16-
"@angular/core": "0.0.0-NG",
16+
"@angular/core": "0.0.0-NG"
17+
},
18+
"dependencies": {
1719
"tslib": "0.0.0-TSLIB"
1820
},
1921
"sideEffects": false,

src/cdk/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"homepage": "https://github.com/angular/components#readme",
2121
"peerDependencies": {
2222
"@angular/core": "0.0.0-NG",
23-
"@angular/common": "0.0.0-NG",
23+
"@angular/common": "0.0.0-NG"
24+
},
25+
"dependencies": {
2426
"tslib": "0.0.0-TSLIB"
2527
},
2628
"optionalDependencies": {

src/components-examples/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"@angular/common": "0.0.0-NG",
2626
"@angular/material": "0.0.0-PLACEHOLDER",
2727
"@angular/material-experimental": "0.0.0-PLACEHOLDER",
28-
"@angular/material-moment-adapter": "0.0.0-PLACEHOLDER",
28+
"@angular/material-moment-adapter": "0.0.0-PLACEHOLDER"
29+
},
30+
"dependencies": {
2931
"tslib": "0.0.0-TSLIB"
3032
}
3133
}

src/material-experimental/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"peerDependencies": {
1515
"@angular/core": "0.0.0-NG",
1616
"@angular/material": "0.0.0-PLACEHOLDER",
17-
"material-components-web": "0.0.0-MDC",
17+
"material-components-web": "0.0.0-MDC"
18+
},
19+
"dependencies": {
1820
"tslib": "0.0.0-TSLIB"
1921
},
2022
"sideEffects": false,

src/material-moment-adapter/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"peerDependencies": {
1515
"@angular/material": "0.0.0-PLACEHOLDER",
1616
"@angular/core": "0.0.0-NG",
17-
"moment": "^2.18.1",
17+
"moment": "^2.18.1"
18+
},
19+
"dependencies": {
1820
"tslib": "0.0.0-TSLIB"
1921
},
2022
"ng-update": {

src/material/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"@angular/cdk": "0.0.0-PLACEHOLDER",
2323
"@angular/core": "0.0.0-NG",
2424
"@angular/common": "0.0.0-NG",
25-
"@angular/forms": "0.0.0-NG",
25+
"@angular/forms": "0.0.0-NG"
26+
},
27+
"dependencies": {
2628
"tslib": "0.0.0-TSLIB"
2729
},
2830
"schematics": "./schematics/collection.json",

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11645,16 +11645,16 @@ tslib@^1.10.0:
1164511645
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
1164611646
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
1164711647

11648-
tslib@^1.12.0:
11649-
version "1.12.0"
11650-
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.12.0.tgz#d1fc9cacd06a1456c62f2902b361573e83d66473"
11651-
integrity sha512-5rxCQkP0kytf4H1T4xz1imjxaUUPMvc5aWp0rJ/VMIN7ClRiH1FwFvBt8wOeMasp/epeUnmSW6CixSIePtiLqA==
11652-
1165311648
tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3:
1165411649
version "1.9.3"
1165511650
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
1165611651
integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
1165711652

11653+
tslib@^2.0.0:
11654+
version "2.0.0"
11655+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.0.0.tgz#18d13fc2dce04051e20f074cc8387fd8089ce4f3"
11656+
integrity sha512-lTqkx847PI7xEDYJntxZH89L2/aXInsyF2luSafe/+0fHOMjlBNXdH6th7f70qxLDhul7KZK0zC8V5ZIyHl0/g==
11657+
1165811658
tslint@^6.1.0:
1165911659
version "6.1.0"
1166011660
resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.0.tgz#c6c611b8ba0eed1549bf5a59ba05a7732133d851"

0 commit comments

Comments
 (0)