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

Upgrade angular 9 #2234

Merged
merged 14 commits into from
Jan 7, 2020
Merged

Upgrade angular 9 #2234

merged 14 commits into from
Jan 7, 2020

Conversation

timdeschryver
Copy link
Member

@timdeschryver timdeschryver commented Nov 8, 2019

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)
[x] Build related changes
[x] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Closes #2211

What is the new behavior?

Does this PR introduce a breaking change?

[x] Yes
[ ] No

Other information

modules/schematics/src/container/index.ts Outdated Show resolved Hide resolved
@@ -47,7 +47,7 @@ describe('createEffect()', () => {
expectSnippet(`
const effect = createEffect(() => ({ foo: 'a' }), { dispatch: false });
`).toFail(
/Type '{ foo: string; }' is not assignable to type 'Observable<{}> | ((...args: any[]) => Observable<{}>)'./
/Type '{ foo: string; }' is not assignable to type 'Observable<unknown> | ((...args: any[]) => Observable<unknown>)'./
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 have to take a look why this happens

Copy link
Member

Choose a reason for hiding this comment

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

Did you sync? :)
f70600f

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 seems to be because TS is upgraded.
It only occurs when a non-observable is returned.

For a non-dispatching effect that's returning an observable, the effect has the correct returntype:

loginSuccess$ = createEffect(
    () =>
      this.actions$.pipe(
        ofType(AuthApiActions.loginSuccess),
        tap(() => this.router.navigate(['/']))
      ),
    { dispatch: false }
  );

Returns

AuthEffects.loginSuccess$: Observable<{
    user: User;
} & TypedAction<"[Auth/API] Login Success">> & CreateEffectMetadata

@@ -10,7 +11,7 @@
"lib": ["es2017", "dom"],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "es2015",
"module": "esnext",
Copy link
Member Author

Choose a reason for hiding this comment

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

To be able to use the dynamic import syntax:

import('@example-app/books/books.module').then(m => m.BooksModule),

@@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.json",
Copy link
Member Author

Choose a reason for hiding this comment

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

Otherwise, we had problems to run the example app:

ERROR in Unable to write a reference to EffectsRootModule 

Followed the following doc https://hackmd.io/zhu28RUcRiaG0DZq5bLy1A?view

@timdeschryver
Copy link
Member Author

Tests and example app are working.
Will take a look at bazel now.

@timdeschryver timdeschryver force-pushed the upgrade-angular-9 branch 3 times, most recently from da1128a to f51f623 Compare November 9, 2019 17:28
"@angular-devkit/build-angular": "~0.800.0",
"@bazel/bazel": "0.26.0",
"@angular-devkit/build-angular": "~0.900.0-rc.0",
"@bazel/bazel": "1.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps I took it too far here to also upgrade bazel, I can revert/create a separate PR for it.
Having some troubles to get it working during CI tho, and I'm not able to reproduce it locally.

Copy link
Member

Choose a reason for hiding this comment

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

Probably need to bump the cache key here for CI to 12 https://github.com/ngrx/platform/blob/master/.circleci/config.yml#L13

Copy link
Member Author

@timdeschryver timdeschryver Nov 11, 2019

Choose a reason for hiding this comment

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

Should we modify the cache key from the master branch?

I tried bumping the version of this branch, but with the same result.
Seems related to bazelbuild/bazel#9366 and bazel-contrib/rules_nodejs#1027, I already tried re-running multiple times.

@@ -47,7 +47,7 @@ describe('createEffect()', () => {
expectSnippet(`
const effect = createEffect(() => ({ foo: 'a' }), { dispatch: false });
`).toFail(
/Type '{ foo: string; }' is not assignable to type 'Observable<{}> | ((...args: any[]) => Observable<{}>)'./
/Type '{ foo: string; }' is not assignable to type 'Observable<unknown> | ((...args: any[]) => Observable<unknown>)'./
Copy link
Member

Choose a reason for hiding this comment

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

Did you sync? :)
f70600f

@timdeschryver
Copy link
Member Author

@alex-okrushko I did sync again but it's still inferring to unknown.

About material, did you take a look at a specific commit?
They should be all modified to the specific import, the two you highlighted are already resolved.

@brandonroberts
Copy link
Member

We'll need to add enableIvy: false to the tsconfig-build.json files for each package so we're still building against View Engine for the npm packages.

@alex-okrushko
Copy link
Member

@alex-okrushko I did sync again but it's still inferring to unknown.

About material, did you take a look at a specific commit?
They should be all modified to the specific import, the two you highlighted are already resolved.

Am I looking at the wrong place? Both imports were resolved by importing general MaterialModule instead of specific imports.

Screen Shot 2019-11-12 at 11 16 18 AM

@timdeschryver
Copy link
Member Author

@alex-okrushko it's the material module from @example-app (not from @material).
I can use the specific import for our spec files if you'd like.

@alex-okrushko
Copy link
Member

Thanks @timdeschryver ! Looks like I was looking at the wrong place :)

@brandonroberts
Copy link
Member

brandonroberts commented Nov 12, 2019

This file needs to be updated also https://github.com/ngrx/platform/blob/master/tools/defaults.bzl with version 9

@timdeschryver timdeschryver force-pushed the upgrade-angular-9 branch 5 times, most recently from 2af1101 to 6bd86b0 Compare November 12, 2019 16:36
@timdeschryver timdeschryver force-pushed the upgrade-angular-9 branch 2 times, most recently from db0e4d1 to b5b0874 Compare November 12, 2019 18:10
@ngrxbot
Copy link
Collaborator

ngrxbot commented Nov 12, 2019

Preview docs changes for 4bbde2a at https://previews.ngrx.io/pr2234-4bbde2a/

@@ -169,14 +175,14 @@ jobs:
- run: npm rebuild node-sass
- run: yarn build-for next --progress false --base-href /pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/ --output-path dist/ngrx.io/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/ && yarn copy-404-page
- run: cp -rf src/extra-files/next/. dist/ngrx.io/pr$CIRCLE_PULL_REQUEST_NUMBER-$SHORT_GIT_HASH/
- run: yarn --cwd ../../ install && yarn --cwd ../../ run deploy:preview
- run: yarn --cwd ../../ install --ignore-engines && yarn --cwd ../../ run deploy:preview
Copy link
Member Author

Choose a reason for hiding this comment

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

Added --ignore-engines because we have a version mismatch between the docs and the rest of the packages, otherwise the install command would fail.

@timdeschryver
Copy link
Member Author

I reached a point where I could use some guidance to fix the errors during the CI 😅.

@brandonroberts
Copy link
Member

😂 I'll take a look

@timdeschryver
Copy link
Member Author

Seems like some builds are now succeeding after the decrease of jobs 🤔
(The update to rc.2 didn't resolve the CI issues)

@brandonroberts
Copy link
Member

@timdeschryver is this ready to merge? I guess we'll see how CI holds up after it lands.

@sumitparakh
Copy link
Contributor

sumitparakh commented Dec 6, 2019

I'll continue with following issue once this PR is merged..
#2240

@timdeschryver
Copy link
Member Author

@brandonroberts It's ready (I just pushed a commit to upgrade to the latest rc).
The only problem is the CI... 😅

@timdeschryver timdeschryver marked this pull request as ready for review December 8, 2019 17:06
@timdeschryver
Copy link
Member Author

(Had to retrigger the CI in order to get it green)

@brandonroberts brandonroberts merged commit b146af5 into master Jan 7, 2020
@sumitparakh
Copy link
Contributor

Great!. Will work on #2240 now.

@timdeschryver timdeschryver deleted the upgrade-angular-9 branch January 30, 2020 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build: Update to Angular 9 RC
5 participants