-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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: support Angular 14 #25353
Comments
Thanks for reporting this! Angular 14 is on my radar for Thursday/Friday to deep dive through the upgrade process/changes and validate compatibility with Ionic. Appreciate any issues/findings you run into 👍 |
Awesome! My pleasure, @sean-perkins. So far this is the only issue I've been able to identify because (to my knowledge) it blocks pretty much everything else the v14 update would bring in. That said... if you get a nightly/dev build out I'm happy to try it and report findings. I have a very large, high complexity app that I am using Ionic/Angular, and I like to stay on the bleeding edge ;) |
@lincolnthree here is a dev-build to test with: With regards to the component factory resolver, there are 3 primary areas within Ionic effected:
Angular 14 introduces a new injector called Appreciate any issues you discover 👍 |
Thanks @sean-perkins ! I have been able to give it a rough try. So far mostly so good. Everything seems to compile, navigation works, and I haven't noticed any glaring issues. One thing with modals seems a bit weird:
Though I'm not sure if this is related. When I don't know if this is related, but I haven't been able to try The net effect is that the modal works fine, but |
The weird thing is that the error is displayed for some modals and not for others, and all of them are created the same way using (I haven't yet tried any of the inline/template modal stuff that's new in |
Okay, that modal issue seems unrelated. I did some digging and it looks like things have changed (in a breaking way) between Ionic 6.1.1 and 6.1.7. |
Opened a separate issue for that: #25362 |
Did some more testing today. I really don't see any issues with this. It seems to be working very well! |
Hi , @sean-perkins is the fix its only included in the 6.1.7-dev.11653587516.10a1f435 or also part of the 6.1.8 for example, as I have tried but seems work only with tihs particular build |
@dimitarmar dev-builds that are created as part of an issue are only included in the following release, when the issue is closed and the associated PR (if there is one), is merged. With this specific change, the dev-build has not been merged into the main branch, so it will be unavailable in new releases of Ionic Framework. Due to the nature of the Angular 14 upgrade; it requires more work to backwards support < 14 version of Angular with Ionic, without causing a breaking change. |
@sean-perkins Anything else I can do to help? |
@lincolnthree nothing at the moment, appreciate it though! I will likely share a new dev build once I have looked into the backwards compatibility, so that devs can confirm that their apps continue to work before upgrading to Angular 14. |
Note: There appears to be an issue with lazy-loading standalone components on routes. Developers/users will get an exception:
Need to explore more of the new features in Angular 14. |
@sean-perkins Interesting. What kind of route configuration is required to get that to occur? I haven't seen that. |
This comment was marked as duplicate.
This comment was marked as duplicate.
@danielehrhardt Is there something new you're trying to highlight with this stack trace? It appears to be the same one I have in my original issue description. |
This comment was marked as duplicate.
This comment was marked as duplicate.
@lincolnthree it should occur when taking advantage of lazy loading a component on a route, instead of lazy loading a module (with a routing module). For example: export const routes: Routes = [
{
path: '',
loadComponent: () =>
import('./pages/landing/landing.page').then((m) => m.LandingPage),
}
]; This is likely related to standalone components, which may also be problematic at the moment. Members that are posting stacktraces without a description of your problem or how it differs from the original reported issue's trace will be marked off topic or as a duplicate. Let's please read the thread before just posting, thanks! |
Ever since I upgraded to angular 14. PS: I did not create any standalone components.
|
@Eraldo is your application using the dev-build: The current public release of Ionic (6.1.8) is not compatible with Angular 14. |
Using: |
The fix that addresses adding support for Angular 14 is only available in |
|
Hello. I dont know if this is an option for everyone, but changing from ion-router-outlet to angular router-outlet it works. I just need to map de content id in every ion-content, because im using ion-menu. |
@sean-perkins It looks like Angular 14 was officially released today. Any chance you could upload a quick new dev build based off of the latest Ionic version? |
@Eraldo Have you updated both @ionic/angular and @ionic/core? Did you make sure your are using a fixed version in |
@lincolnthree I am still actively working on a build that is backwards compatible with Angular 13 and supporting the upgrade to Angular 14. I'll share a dev build when that is available. I do not believe standalone components will be supported in our first release to allow Angular 14 dependencies. @rafaelbatistamarcilio Changing from @Eraldo When testing with dev-builds and Angular, remember to delete the |
@sean-perkins Gotcha. That sounds good. Sorry it's so complicated! This deprecation was easy for us where we use the resolvers, but it would not be easy trying to support both APIs at once :( Not sure the Angular team had a great plan for that scenario based on how this change was brought through. Then again, it is a major version bump. I'm still not sure what standalone components are, but... it sounds like we aren't using them :) Anyway, looking forward to it :) Thanks for all your hard work! |
Here's an updated build that should work on both your Angular 13 projects and work after updating the project to Angular 14:
Note: Delete the Also note: Not all new Angular 14 features are currently supported. The tricky thing with libraries supporting multiple major versions of a dependency, is how that dependency is configured. We unfortunately cannot update our own dependencies to Angular 14, otherwise the Angular CLI will not build apps on < 14 and using Ionic, which is not desired. We also want to add support for the new features that Angular has included, but many of those new features are new providers/classes/etc. that are not available in the peer dependency that we are required to install. We typically support the current major version and the previous major version for each major version of Ionic. So for instance, v6 of Ionic supports v12 and v13 of Angular. This isn't a hard rule of thumb, but we are discussing the tradeoffs of only supporting Angular 14+ for Ionic 7. Standalone components are a "dev preview" feature of Angular 14, that allows you to create a component without declaring/exporting it from an |
@sean-perkins Thank you! 🙏 |
Same problem, @sean-perkins package version works, I can confirm. Update Any notes on when this is gonna work in stable release? (like to be on-the-edge). Thanks guys! |
The fix has been merged and will be available as part of this week's release (6.1.9). Thanks! |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out. |
Prerequisites
Describe the Feature Request
In Angular 14, there is a breaking change that removes the deprecated
ComponentFactoryResolver
, specifically from router outlets. Since@ionic/angular
currently uses this to inion-router-outlet
, Angular applications using Ionic will stop working once upgraded to version 14. Ionic will need to update to support the next version of Angular (currently in RC).Describe the Use Case
Allow users to continue staying current with Angular releases.
Describe Preferred Solution
Remove references to deprecated resolvers. But whatever you think is best :)
From Angular upgrade guide:
Describe Alternatives
Unknown.
Related Code
No response
Additional Information
Link to Angular deprecation info:
https://angular.io/api/core/ComponentFactoryResolver#description
Angular v14 Upgrade Guide:
https://update.angular.io/?l=3&v=13.0-14.0
Stack trace:
Ionic Info:
The text was updated successfully, but these errors were encountered: