X Tutup
Skip to content

convert npm dependencies to peerDependencies#5649

Closed
IgorMinar wants to merge 4 commits intoangular:masterfrom
IgorMinar:peer-deps
Closed

convert npm dependencies to peerDependencies#5649
IgorMinar wants to merge 4 commits intoangular:masterfrom
IgorMinar:peer-deps

Conversation

@IgorMinar
Copy link
Copy Markdown
Contributor

Closes #5560

@IgorMinar IgorMinar added the action: review The PR is still awaiting reviews from at least one requested reviewer label Dec 6, 2015
@IgorMinar IgorMinar added this to the beta.0 milestone Dec 6, 2015
package.json Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we be more strict about rxjs? If I recall properly alpha.12 was kind of broken and @robwormald had to go back to .11. In any case given the amount of changes in both libraries we might be more strict here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do that in a separate commit within this PR. do we know what version of RXJS is the good one?

@pkozlowski-opensource
Copy link
Copy Markdown
Member

Travis build is not a flake, I think that we read from package.json dependencies in some of our scripts

@IgorMinar
Copy link
Copy Markdown
Contributor Author

yay for CI. I'll fix the breakage.

@IgorMinar
Copy link
Copy Markdown
Contributor Author

@pkozlowski-opensource should be all fixed now. I also added es6-promise as a peer dependency (it comes from zone.js). waiting for CI now..

@IgorMinar
Copy link
Copy Markdown
Contributor Author

oh.. I still need to lock rxjs.. one more commit coming.

@IgorMinar
Copy link
Copy Markdown
Contributor Author

done

package.json Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this now?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always needed it. It's a transitive dep coming from zone
On Sun, Dec 6, 2015 at 11:21 AM Jeff Cross notifications@github.com wrote:

In package.json
#5649 (comment):

@@ -30,9 +30,11 @@
"postinstall": "node tools/analytics/build-analytics success install npm-install-net && node tools/analytics/build-analytics start install npm-postinstall && node tools/npm/copy-npm-shrinkwrap && node tools/chromedriverpatch.js && webdriver-manager update && bower install && gulp pubget.dart && tsd reinstall --overwrite --clean --config modules/angular2/tsd.json && tsd reinstall --overwrite --clean --config tools/tsd.json && tsd reinstall --overwrite --config modules/angular1_router/tsd.json && node tools/analytics/build-analytics success install npm-postinstall && node tools/analytics/build-analytics success install npm-install",
"test": "gulp test.all.js && gulp test.all.dart"
},

  • "dependencies": {
  • "peerDependencies": {
  • "es6-promise": "^3.0.2",

Why do we need this now?


Reply to this email directly or view it on GitHub
https://github.com/angular/angular/pull/5649/files#r46774522.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it part of zone.js build? Or are you saying that we need to have it for some other reason (typings)?

@pkozlowski-opensource
Copy link
Copy Markdown
Member

@IgorMinar the more I look at this PR the more I think that we are focusing on the wrong package.json. What we want to do is to have peer dependencies in the package.json of a module that we publish to npm.

Here we still want things as regular (dependencies or devDependencies) deps since we need zone and company to run tests, prepare bundles etc.

What I'm saying is that we don't want to move zone & co to peereDependencies in this repo's package.json but do this only in package.json that we push to npm.

package.json Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to force es6-shim? What about people that do projects for modern browsers only? Or want to use a different shim?

@jeffbcross
Copy link
Copy Markdown
Contributor

@pkozlowski-opensource: @IgorMinar said you are right (as always) and that he is going to update the PR to keep devDependencies in our own package, peerDependencies in published packages.

@jeffbcross jeffbcross added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Dec 7, 2015
@jeffbcross jeffbcross assigned IgorMinar and unassigned jeffbcross Dec 7, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor Author

@pkozlowski-opensource you are right. my bad. I'm fixing that now.

@IgorMinar
Copy link
Copy Markdown
Contributor Author

ci still failing, looking into that too

@IgorMinar
Copy link
Copy Markdown
Contributor Author

changes made. running CI. if green then I need to squash commits and we can land this

@pkozlowski-opensource
Copy link
Copy Markdown
Member

@IgorMinar what about my comments regarding es6-promise and es6-shim?

I'm not sure why we need es6-promise (it is bundled with zone.js) and es6-shim is debatable IMO (what about people using recent browsers? Or ones using a different shim?)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should have a dependency on rxjs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess rxjs is already declared as a peerDependency of angular2, so as long as this package depends on angular2 rxjs isn't necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And http isn't even published as a standalone package yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jeff, rxjs comes in via angular. But I'll make it an explicit peer dep.

Pawel, see my comment about optionalPeerDependencies in one of my commit
messages. For now apps that don't need shims will still need to declare
them in their package.json but not use them.
On Mon, Dec 7, 2015 at 11:36 AM Jeff Cross notifications@github.com wrote:

In modules/angular2/src/http/package.json
#5649 (comment):

"devDependencies": <%= JSON.stringify(packageJson.defaultDevDependencies) %>

  • "peerDependencies": {
  • "angular2": "<%= packageJson.version %>"

And http isn't even published as a standalone package yet.


Reply to this email directly or view it on GitHub
https://github.com/angular/angular/pull/5649/files#r46865671.

@IgorMinar
Copy link
Copy Markdown
Contributor Author

CI is green! I'm squashing the commits and applying merge label

@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 8, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor Author

everything is resolved and rebased. good to be merged now

@jelbourn
Copy link
Copy Markdown
Contributor

jelbourn commented Dec 8, 2015

@IgorMinar Travis failures still look legitimate to me.

@jelbourn jelbourn added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels Dec 8, 2015
@IgorMinar
Copy link
Copy Markdown
Contributor Author

looking into it

To be later used as a peerDependency in the generated package.json

It would be better to make this one an optionalPeerDependency but npm
currently doesn't support making peerDependencies optional.
See: npm/npm#3066
This is actually an inherited dependency that comes from zone.js.

See related issue: angular/zone.js#212

It would be better to make this one an optionalPeerDependency but npm
currently doesn't support making peerDependencies optional.
See: npm/npm#3066
…age.json templates

This is more correct and resolves the issue of having dupes within the same project.

This change has no impact on our shrinkwrap since peerDeps and deps are merged into one
within the shrinkwrap file.

BREAKING CHANGE: rxjs, reflect-metadata, zone.js and es6-shims now must be specified as
explicit dependencies of each angular app that uses npm for package management.

To migrate, please add the following into the "dependencies" section of your package.json:

```
"dependencies": {
    ...

    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-alpha.11",
    "zone.js": "0.5.8"

    ...
}
```

Closes angular#5560
@IgorMinar
Copy link
Copy Markdown
Contributor Author

sorry.. it was a bad squash. fixed now. rerunning CI

@IgorMinar IgorMinar added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Dec 8, 2015
@jelbourn
Copy link
Copy Markdown
Contributor

jelbourn commented Dec 8, 2015

@mary-poppins isn't picking this one up, merging manually.

@IgorMinar IgorMinar closed this in 80b025a Dec 8, 2015
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

declare peer dependencies as peer dependencies

6 participants

X Tutup