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

build: update to Angular 15 rc #3630

Merged
merged 2 commits into from
Oct 24, 2022

Conversation

markostanimirovic
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

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

Closes #3614

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@netlify
Copy link

netlify bot commented Oct 22, 2022

Deploy Preview for ngrx-io canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit f93c86d
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/63557c447385cd0008eebcff

14.20
Copy link
Member Author

Choose a reason for hiding this comment

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

Angular v15 suports Node v14.20 or higher. I also updated "engines" in package.json to be the same as in the Angular repo.

useValue: () => {
inject(ROOT_STORE_PROVIDER);
inject(FEATURE_STATE_PROVIDER, { optional: true });
return makeEnvironmentProviders([
Copy link
Member Author

Choose a reason for hiding this comment

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

Angular v15 now exports the EnvironmentProviders type, also there is the makeEnvironmentProviders function that converts providers array to environment providers.

@@ -26,6 +26,7 @@ export class FullRouterStateSerializer
data: route.data,
url: route.url,
outlet: route.outlet,
title: route.title,
Copy link
Member Author

Choose a reason for hiding this comment

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

In v15, title is required property

Copy link
Member

Choose a reason for hiding this comment

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

🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

*title is required property in ActivatedRouteSnapshot class, not Route interface 😅

Copy link
Member

Choose a reason for hiding this comment

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

Ahh ok. I was worried there for a minute 😄

Comment on lines -86 to +89
);
const component = componentClass as ts.ClassDeclaration;
const componentConstructor = component.members.find(
(member) => member.kind === ts.SyntaxKind.Constructor
);
const cmpCtr = componentConstructor as ts.ConstructorDeclaration;
const { pos } = cmpCtr;
const constructorText = cmpCtr.getText();
const [start, end] = constructorText.split('()');
const storeConstructor = [start, `(private store: Store)`, end].join('');
) as ts.ClassDeclaration;
const constructorUpdate = new ReplaceChange(
componentPath,
pos,
` ${constructorText}\n\n`,
`\n\n ${storeConstructor}`
componentClass.members.pos,
'\n',
`\n constructor(private store: Store) {}`
Copy link
Member Author

Choose a reason for hiding this comment

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

In v15, the component schematic doesn't generate the constructor and ngOnInit method anymore. Instead, it generates an empty component class.

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.

🚀

@timdeschryver timdeschryver merged commit ea13560 into ngrx:master Oct 24, 2022
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.

Build: Update to latest Angular v15 RC
3 participants