Skip to content
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

feat: update angular dependencies to V7 #1354

Merged
merged 12 commits into from
Oct 31, 2018
Merged

feat: update angular dependencies to V7 #1354

merged 12 commits into from
Oct 31, 2018

Conversation

timdeschryver
Copy link
Member

Work in progress do not merge.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

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

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Update to Angular 7.

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

Object.defineProperty(Array.prototype, 'unwantedField', {
value: undefined,
});
delete (Array.prototype as any).unwantedField;
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to do this otherwise the integration router specs were failing.
Could the creation of this property on the array be left out?

TypeError: Cannot assign to read only property 'unwantedField' of object '[object Array]'
        at new NodeList (C:\Users\tdeschryver\dev\platform\node_modules\domino\lib\NodeList.es6.js:8:44)
        at Document.value (C:\Users\tdeschryver\dev\platform\node_modules\domino\lib\Document.js:726:33)
        at DominoAdapter.BrowserDomAdapter.querySelectorAll (C:\Users\tdeschryver\dev\packages\platform-browser\src\browser\browser_adapter.ts:122:66)
        at DOMTestComponentRenderer.insertRootElement (C:\Users\tdeschryver\packages\platform-browser-dynamic\testing\src\dom_test_component_renderer.ts:25:31)
        at TestBedViewEngine.createComponent (C:\Users\tdeschryver\packages\core\testing\src\test_bed.ts:615:27)

Copy link
Member

Choose a reason for hiding this comment

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

I think its ok leave it here

Object.defineProperty(Array.prototype, 'unwantedField', {
value: undefined,
});
delete (Array.prototype as any).unwantedField;
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here

@@ -494,7 +494,7 @@ describe('integration spec', () => {
});
});

it('should support cancellation of initial navigation using canLoad guard', (done: any) => {
xit('should support cancellation of initial navigation using canLoad guard', (done: any) => {
Copy link
Member Author

Choose a reason for hiding this comment

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

This test is failing, I don't know why yet.
(It timeouts because then((r: boolean) => {...}) isn't being invoked)

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this is a regression issue - angular/angular#26284

@@ -54,6 +54,13 @@ export function createTestModule(
provide: 'CanLoadNext',
useValue: opts.canLoad || (() => true),
},
{
provide: Console,
Copy link
Member Author

Choose a reason for hiding this comment

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

Overriding console logs, otherwise the console will be bloated with warnings that the router.navigate runs outside Angular zone. angular/angular#24959

@coveralls
Copy link

coveralls commented Oct 6, 2018

Coverage Status

Coverage decreased (-0.1%) to 88.324% when pulling b036b94 on wip/angular-7 into a9e7cbd on master.

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 6, 2018

While the tests are green of the example app (and builds), there is something wrong with it. When you start it, it's stuck in an infinite loop because of AuthGuard.
I think this has something to do with the failing integration test.

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 19, 2018

I've upgraded the deps to Angular 7.
While the tests are green now, the example app is still stuck in an infinite loop.

@brandonroberts
Copy link
Member

Same router issue?

@timdeschryver
Copy link
Member Author

It's because of the Auth guard.
I don't know for sure if this is releated to the fixed regression issue.

The log prints out:

...
index.ts:50 @ngrx/router-store/cancel
index.ts:50 @ngrx/router-store/request
index.ts:50 @ngrx/router-store/cancel
index.ts:50 @ngrx/router-store/request
index.ts:50 @ngrx/router-store/cancel
index.ts:50 @ngrx/router-store/request
...

@brandonroberts
Copy link
Member

brandonroberts commented Oct 19, 2018

We'll need to look into that because I think it affects current users also. See #1373

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 19, 2018

I tested the example app without the router-store and it worked.
I would suspect that we'll have to change the router-store implementation to get this fixed.
More specific modified the router event at

{ type: 'router', event: 'NavigationStart', url: '/next' },
(modified order of events)

I haven't verified this tho. Will try to do so in the next days.

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 20, 2018

There was an infinite loop because of

this.router.navigateByUrl(url).catch(error => {
Because of this we always wanted to redirect to / , we set this url when we are in a NavigationStart event. I'm not sure if there is a better way to prevent this.

The fix in commit 1c10f7d ignores navigation when it's triggered by NavigationStart.

Copy link
Member

@brandonroberts brandonroberts left a comment

Choose a reason for hiding this comment

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

We'll need to update the docs app dependencies also, but that can be done separately.

console.log('action', action);
console.log('next state', result);
console.groupEnd();
// console.groupCollapsed(action.type);
Copy link
Member

Choose a reason for hiding this comment

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

Revert

@@ -5,8 +5,8 @@ load("@build_bazel_rules_nodejs//:defs.bzl",
_jasmine_node_test="jasmine_node_test", _npm_package="npm_package")

DEFAULT_TSCONFIG = "//:tsconfig.json"
NG_VERSION = "^6.0.0"
RXJS_VERSION = "^5.6.0-forward-compat.0 || ^6.0.0"
NG_VERSION = "^7.0.0-rc.0"
Copy link
Member

Choose a reason for hiding this comment

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

Change to ^7.0.0

Object.defineProperty(Array.prototype, 'unwantedField', {
value: undefined,
});
delete (Array.prototype as any).unwantedField;
Copy link
Member

Choose a reason for hiding this comment

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

I think its ok leave it here

@brandonroberts
Copy link
Member

@timdeschryver will you update the commit message for the router-store fix? We may need to cherry pick for a 6.1.x bug fix in the meantime until 7.x is ready.

@timdeschryver
Copy link
Member Author

@brandonroberts , is it possible to cherry pick the commits we want to release? Would it make things easier if I would create a separate PR for the router fix, because if that's the case I could do it that way.

@timdeschryver timdeschryver force-pushed the wip/angular-7 branch 4 times, most recently from 1febc09 to e3038ce Compare October 24, 2018 16:58
@brandonroberts
Copy link
Member

@timdeschryver yes. I've created a 6.1.x branch you can open a PR against for the router fix. I don't think there any other critical fixes needed for Angular 7 users still on V6.

@timdeschryver
Copy link
Member Author

@brandonroberts see #1379.

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 26, 2018

Should I also at the migrations for ng update in this PR? @brandonroberts

@brandonroberts
Copy link
Member

We don't have any migrations for V7 currently. It should work by using ng update @ngrx/store which we should add to the top of the migration guide.

NG_VERSION = "^6.0.0"
RXJS_VERSION = "^5.6.0-forward-compat.0 || ^6.0.0"
NG_VERSION = "^7.0.0"
RXJS_VERSION = "^6.3.0"
Copy link
Member

Choose a reason for hiding this comment

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

Let's leave this pinned to ^6.0.0 instead for rxjs

@timdeschryver
Copy link
Member Author

@brandonroberts
Copy link
Member

Today, yes. Once V7 is published, it will be tagged as latest so it will get picked up without us having to tweak any additional migration code. I believe migrations are only run if you specify the --from and --to ranges.

@timdeschryver
Copy link
Member Author

timdeschryver commented Oct 26, 2018

I'm not really sure of it.
It will indeed get picked up as "to update" but it won't be installed because we're writing the new version to the package.json's dependencies.

timdeschryver and others added 6 commits October 31, 2018 11:46
Bazel depends on the package.json for its dependency graph. ngrx-store-freeze implicitly depends on @ngrx/store, which is a package in this monorepo
@brandonroberts brandonroberts changed the title WIP: feat: update angular feat: update angular dependencies to V7 Oct 31, 2018
@brandonroberts brandonroberts merged commit e6048bd into master Oct 31, 2018
@brandonroberts brandonroberts deleted the wip/angular-7 branch October 31, 2018 17:47
@dzonatan
Copy link

dzonatan commented Nov 2, 2018

Any ETA of release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants