New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tslib as peerDependency #32167
Tslib as peerDependency #32167
Conversation
When this gets approved and merged will do the same changes to https://github.com/dherges/ng-packagr and the https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/library/files/package.json.template |
Will look into the failures over the weekend. @gkalpak, can you give me a tip we I should be looking for the docs failures? Thanks |
CI is green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? I have two concerns:
- umd bundles are now no longer self-contained, breaking universal and anyone relying on umd
- the change from dep to peerDep requires a migration, but none is attached in this change
Can we please first discuss the motivation behind this and then we can decide if we want to go forward or not? thanks
Hi @IgorMinar, thanks for taking a look.
No fully understanding why this breaks universal apart from when not having tslib as a dev dependency, I do agree that UMD bundles are not "self-contained" to an extend since RxJs is not embedded either. But yes, it will break users using UMD's such as
Indeed a migration needs to be added, though that should be trivial to that and most of the CLI users are already using tslib. As it's already added to
The main motivation for this is that I am not sure if @alexeagle had some other reasons for this, apart from what I mentioned, since he originally opened the issue (TOOL-836) Though, I'd like an answer to a question. Why a dependency on tslib is different then let's say RxJs which is always a peerDepedency, it is because it's a small dependency (approx 12Kb unminified) or there are other motivations? Thanks |
I'm pretty sure the request came from @IgorMinar originally, as a way to trim bundle sizes. |
@IgorMinar what are we going to do about this PR? |
We should get approval from @IgorMinar and then this will need a new rebase @alan-agius4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
summarizing the in person discussion:
- let's change the PR to keep on inlining the tslib into umd bundles (umd is used on CDNs and we don't have way to not making this change a breaking one, which would require everyone who depends on umds update their index.html or whatever module loader / resolver they use.
- let's include a migration that ensure that all cli projects have tslib installed as a dependency.
- let's include this migration in the list of @kara's migrations for v9
otherwise lgtm
Migration to ensure that tslib is installed angular/angular-cli#15800 |
BREAKING CHANGE: We no longer directly have a direct depedency on `tslib`. Instead it is now listed a `peerDependency`. Users not using the CLI will need to manually install `tslib` via; ``` yarn add tslib ``` or ``` npm install tslib --save ```
@IgorMinar, I marked this PR for merge, I added the migration to @kara's list and added a migration to ensure tslib is installed. angular/angular-cli#15800 I also rolled out the changes to components and universal |
Caretaker: @IgorMinar approved! |
nguniversal relied on a hidden dependency of `tslib` due to `importHelpers` https://github.com/angular/universal/blob/5798f198db1fb0bce9dbfb850751429a3724084a/modules/bazel-tsconfig-build.json#L11 which was previously installed by the Angular framework. This, however changed with this PR angular/angular#32167 With this change we now list `tslib` as a required peerDepedency. Users not using the CLI will need to manually install `tslib` via; ``` yarn add tslib ``` or ``` npm install tslib --save ``` Reference: TOOL-836
…32167) BREAKING CHANGE: We no longer directly have a direct depedency on `tslib`. Instead it is now listed a `peerDependency`. Users not using the CLI will need to manually install `tslib` via; ``` yarn add tslib ``` or ``` npm install tslib --save ``` PR Close angular#32167
… package.json This is to align with angular/angular#32167
…32167) BREAKING CHANGE: We no longer directly have a direct depedency on `tslib`. Instead it is now listed a `peerDependency`. Users not using the CLI will need to manually install `tslib` via; ``` yarn add tslib ``` or ``` npm install tslib --save ``` PR Close angular#32167
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
feat: change tslib from direct dependency to peerDependency
BREAKING CHANGE:
We no longer directly have a direct depedency on
tslib
. Instead it is now listed apeerDependency
.Users not using the CLI will need to manually install
tslib
via;or
Reference: TOOL-836