-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
build: update to Angular 15 rc #3630
Conversation
✅ Deploy Preview for ngrx-io canceled.Built without sensitive environment variables
|
14.20 |
There was a problem hiding this comment.
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([ |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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 😄
); | ||
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) {}` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Closes #3614
Does this PR introduce a breaking change?