Skip to content

Conversation

sjelin
Copy link
Contributor

@sjelin sjelin commented Nov 16, 2016

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

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

See "Other Information"

What is the new behavior?

See "Other Information"

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

Other information:

  • With non-static ngUpgrade apps, callbacks to whenStable were being invoked with the wrong
    context
  • With non-static ngUpgrade apps, resumeBootstrap was being run outside the NgZone
  • Remove redundent whenStableContext variable

Neither of the first two problems were actually causing bugs (as far as I know), but they might
have caused problems in the future,

Inspired by #12910, but for non-static apps.

@@ -8,6 +8,7 @@
import {Component, Directive, DoCheck, ElementRef, EventEmitter, Inject, Injectable, Injector, Input, NgModule, OnChanges, OnDestroy, OnInit, Output, SimpleChanges} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import * as angular from '@angular/upgrade/src/angular_js';
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't need this to build this app.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact it causes Travis to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was running into errors when I didn't have it there but I'll try again

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

It all looks good except for the addition of the import of angular_js into module.ts.

@petebacondarwin petebacondarwin added comp: upgrade effort1: hours freq2: medium action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews type: bug/fix labels Nov 16, 2016
@@ -115,7 +115,7 @@ class Ng2AppModule {
// #docregion Angular 1 Stuff
// #docregion ng1-module
// This Angular 1 module represents the Angular 1 pieces of the application
const ng1AppModule = angular.module('ng1AppModule', []);
const ng1AppModule = (window as any).angular.module('ng1AppModule', []);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@petebacondarwin I was still getting errors about typescript not knowing about the name angular so I did this instead

Copy link
Contributor

Choose a reason for hiding this comment

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

where are you getting errors? In the editor or in the build?

Copy link
Contributor

@chuckjaz chuckjaz Nov 16, 2016

Choose a reason for hiding this comment

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

I just merged a fix for this. Please remove the any cast and verify that this error is now no longer in the editor as well as not being reported when running ./test.sh.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

During the build process of the tests:

sjelin@sjelin-linux:~/angular$ ./test.sh browserNoRouter
Watching: modules/tsconfig.json in /usr/local/google/home/sjelin/angular
=====> node_modules/.bin/tsc --emitDecoratorMetadata --project modules/tsconfig.json --watch
=====> node node_modules/karma/bin/karma start --no-auto-watch --port=9876 karma-js.conf.js
modules/@angular/examples/upgrade/static/ts/module.ts(118,22): error TS2304: Cannot find name 'angular'.
1:44:56 PM - Compilation complete. Watching for file changes.
------------------------------------------------------------------------------
Errors found.... (response not triggered)

I use vim so my editor doesn't provide errors

…tstrap

* With non-static ngUpgrade apps, callbacks to `whenStable` were being invoked with the wrong
  context
* With non-static ngUpgrade apps, `resumeBootstrap` was being run outside the NgZone
* Remove redundent `whenStableContext` variable

Neither of the first two problems were actually causing bugs (as far as I know), but they *might*
have caused problems in the future.

Inspired by angular#12910, but for non-static apps.
@sjelin
Copy link
Contributor Author

sjelin commented Nov 16, 2016

Should be good now @petebacondarwin. Thanks to @chuckjaz for the fix

@petebacondarwin petebacondarwin 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 Nov 16, 2016
@sjelin
Copy link
Contributor Author

sjelin commented Nov 18, 2016

Hey, this isn't merging for some reason and I don't have the rights to merge it myself

@petebacondarwin
Copy link
Contributor

It is up to the caretaker to merge it. Try pinging them on Slack

@chuckjaz
Copy link
Contributor

@petebacondarwin This is missing an LGTM so it didn't show up in my query of PRs ready to merge.

@petebacondarwin
Copy link
Contributor

OK. Added.

@chuckjaz chuckjaz merged commit 44572f1 into angular:master Nov 18, 2016
chuckjaz pushed a commit that referenced this pull request Nov 22, 2016
…tstrap (#12926)

* With non-static ngUpgrade apps, callbacks to `whenStable` were being invoked with the wrong
  context
* With non-static ngUpgrade apps, `resumeBootstrap` was being run outside the NgZone
* Remove redundent `whenStableContext` variable

Neither of the first two problems were actually causing bugs (as far as I know), but they *might*
have caused problems in the future.

Inspired by #12910, but for non-static apps.
@angular-automatic-lock-bot
Copy link

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 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants