Skip to content

fix(upgrade): make ngUpgrade work with testability API - #7603

Closed
sjelin wants to merge 1 commit into
angular:masterfrom
sjelin:ng-upgrade-testability
Closed

sjelin wants to merge 1 commit into
angular:masterfrom
sjelin:ng-upgrade-testability

Conversation

@sjelin

@sjelin sjelin commented Mar 14, 2016

Copy link
Copy Markdown
Contributor

(Docs not really relevant in this case)

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

This change makes the testability API work with hybrid apps. Specifically, it fixes deferred bootstrapping and waiting on ng2 components within ng1 apps

  • What is the current behavior? (You can also link to an open issue here)

Currently deferred bootstrapping causes ngUpgrade to hang, and if an ng2 component uses setTimeout or the like the hybrid app's testability checks will totally ignore the fact that its ng2 components aren't yet stable

  • What is the new behavior (if this is a feature change)?

Now deferred bootstrapping works, and the testability API will check both ng1 and ng2 stability

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Only if someone is relying on their hybrid app to crash!

  • Other information:

I have almost zero typescript knowledge so please tell me how to fix any style problems. I did compile/run tests though.

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@sjelin

sjelin commented Mar 14, 2016

Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@sjelin

sjelin commented Mar 14, 2016

Copy link
Copy Markdown
Contributor Author

I've signed it before but you can have me resign any time you want @googlebot 😉

@sjelin
sjelin force-pushed the ng-upgrade-testability branch from 171889a to 2d12af4 Compare March 14, 2016 21:53
@sjelin

sjelin commented Mar 14, 2016

Copy link
Copy Markdown
Contributor Author

cc @juliemr & whoever owns ngUpgrade

sjelin added a commit to sjelin/protractor that referenced this pull request Mar 14, 2016
Comment thread modules/angular2/src/facade/lang.ts 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.

We should probably add a comment that this will only be available if it's using ngUpgrade.

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.

Done

@sjelin
sjelin force-pushed the ng-upgrade-testability branch 2 times, most recently from afb1c45 to f637e6e Compare March 15, 2016 01:45

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.

Why not add resumeBooystrap in the type above ?

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.

It's there. clang just put it on the same line as version

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.

Wow ! Did clang-format really do that ?
That's pretty unexpected !

(But then again you can't argue with clang-format.)

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 mean, I didn't put it on that line, so I think it must have been clang

@sjelin

sjelin commented Mar 16, 2016

Copy link
Copy Markdown
Contributor Author

@mhevery ping

Comment thread modules/angular2/src/facade/lang.ts 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.

Could we keep angular1 in ngUpgrade only.

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 could probably do some casting to access the angular object without expanding the interface

@mhevery

mhevery commented Mar 17, 2016

Copy link
Copy Markdown
Contributor

LGTM, except for the small nit-pick of keeping this to ngUpgraed only

@sjelin
sjelin force-pushed the ng-upgrade-testability branch from f637e6e to 768871a Compare March 17, 2016 18:38
@sjelin

sjelin commented Mar 18, 2016

Copy link
Copy Markdown
Contributor Author

Having a lot of trouble rebasing this, hopefully I'll get it working later today

@sjelin
sjelin force-pushed the ng-upgrade-testability branch from 768871a to adebb72 Compare March 19, 2016 00:06
@sjelin

sjelin commented Mar 19, 2016

Copy link
Copy Markdown
Contributor Author

Ok, rebased. It's breaking travis because of angular/zone.js#283, which I've submitted a PR for and hopefully will be fixed on npm soon. For now I've changed the implementation of zone.js in my node_modules and the unit tests do pass, at least locally.

Edit: it says MODE=js is passing but it does have errors: https://travis-ci.org/angular/angular/jobs/117041194#L3041 Must be a bug with our travis setup

@mhevery

mhevery commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

Rebasing on top of #7700 should make this Green.

@sjelin
sjelin force-pushed the ng-upgrade-testability branch from adebb72 to 9ee4cdb Compare March 22, 2016 21:05
@sjelin

sjelin commented Mar 22, 2016

Copy link
Copy Markdown
Contributor Author

Rebasing fixed tests. All comments addressed.

@mhevery mhevery added pr_state: LGTM action: merge The PR is ready for merge by the caretaker labels Mar 25, 2016
@mary-poppins

Copy link
Copy Markdown

Merging PR #7603 on behalf of @kara to branch presubmit-kara-pr-7603.

@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 8, 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 action: review The PR is still awaiting reviews from at least one requested reviewer cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants