🚨 Angular 18 Is Out: Zoneless Upgrade (Step-By-Step)
ฝัง
- เผยแพร่เมื่อ 22 ก.ค. 2024
- Modern Angular With Signals Course - angular-university.io/course/...
This video is a quick summary of all the major features of Angular 18, with a focus on Zoneless.
Timestamps:
0:00 Video Summary
00:40 Migrating to Zoneless
09:25 ng-content fallback content
11:30 new form events observable
12:45 route redirects as functions
Helpful links:
- Angular 18 release post - blog.angular.dev/angular-v18-...
- Zoneless docs angular.dev/guide/experimenta...
Related articles on the Angular University blog:
blog.angular-university.io/an...
Free content at the Angular University:
- 20% of our lessons are free, you don't have to login to watch the lessons. The free lessons are the ones with the P (Pro) - angular-university.io
- Watch the free Angular For Beginners Course - angular-university.io/course/...
Follow me:
Twitter - / angularuniv
Facebook - / angular.university
TH-cam - / @angularuniversity
Instagram - / angular.university
LinkedIn - / angular-university
TikTok - / angularuniversity
Threads - www.threads.net/@angular.univ...
Enjoy the new Angular 18 Zoneless support 😉One of the most convenient ways of writing zoneless applications is by using Signals. If you want to learn them, check out my ongoing Modern Angular With Signals Course - angular-university.io/course/angular-signals-course
Well, we’re officially leaving Zone.js , we’re entering the new future of Angular🎉
Yes, we are go for launch 🚀
We completed the transition, took 5 minutes and works flawlessly. Just some @angular/fire issues. nice
Yeah, finally, let's celebrate it!
great rundown as always
Very nice presentation of Angular 18 ! Thanks Vasco 👌😎
Thank you Alain, you're welcome. 😊 Enjoy 👍
you are quick, cool video thank you for sharing :)
I still need some time to wrap my mind around some things
Thank you, please enjoy the video 😊
Excellent video thank u! Am going to go zoneless immediately. Rock on!!
Thank you Brendan, have fun trying Zoneless. 👍 It's way simpler and less complicated than it sounds. 😊
Great video. Thanks a lot!
You're welcome 😉
Looks very promising! :) Wanna try it soon!
Enjoy the release 😉
barely managed to update few of my teams apps to angular 17, now have to update them again to 18 haha. great content as always.
They just keep them coming those releases, don't they? 😉 I'm still migrating to signals as well 👍
Thank U for this video excellent video
Thank you, you're welcome 😊
Im still in hangover of 17, Already 18 released 😅🤣 👍
They keep them coming, right? 😉
@@AngularUniversity yup
Every 6 months.. been like this for many years
Great video! Angular 18 is amazing, but I would like to use zone-less when it is ready for production. Thanks for sharing.
Yes, it shouldn't take long. I think they only have a few corner cases remaining like certain scenarios of server-side rendering for example. 😊
We already use it in production :)
@AngularUniversity Thanks for switching to the VS Code dark theme 🤝, which I commented on Angular Signals video.
Yes this theme is much better, I prefer it way better to any other theme. And I get all the power of Webstorm behind it, thank you for the suggestion. 👍😊
This is insane, I haven’t even figure out signals, control flow and now this!! We just started a new project in 17 thinking it’ll be the latest, Took a while to even upgrade for 16 to 17 in a new project!!!
The upgrade to 18 will be seamless unless you want to turn on Zoneless and were not using OnPush. 👍
@@AngularUniversity the problem is I'm still swimming in how signals work vs using observables and my team is resisting in using signals untill I prove they are better, the problem I'm not sure the extent of work to move everything to signals, again because I don't understand how to set them up and use instead of subscriptions:( I need help with exact examples on how to take let's say service I have that uses behavior subjects and the subscribes to them for the changes
@@AngularUniversity also I just made some weird fix for change detection, wish I knew how to work with signals and zoneless to avoid it all 😂
@@anutaNYC You mean expression has changed after it was checked? 😉
It looks like it works exactly the same as OnPush - as if OnPush were the default change detection strategy.
Yes it works very similarly. Applications using OnPush should have little trouble upgrading. 😉
love angular but miss the vuejs hmr when developing. Do you know of a way to replicate the hmr now that esbuild/vite is stable?
The current Angular CLI is blazing fast, and it doesn't reload the whole application anymore. It's a completely new experience than 6 months ago. 😊
Vasco, what are your thoughts on the current Angular Material v18? I personally think that the colors, in some components, such as buttons are messed up, the default themes have applied a very strange use of colors, or should I say, have applied colorless colors
I thought the use of gray in the dropdowns was weird, my first reaction is I didn't like it that much either, I don't see the improvement. 👍
Thanks for the helpful and easy-to-follow video! When I followed your instructions to refactor my app to zoneless, I am getting a ReferenceError: Zone is not defined. Any tips on how to resolve that?
You're welcome, I'l glad you enjoyed it. 👍 I think you might have forgotten to set up the correct provider, because it seems that some part of Angular is still trying to use Zones.
@@AngularUniversity I just figured out the problem, thanks to a GitHub bug report from another developer. As of now, the Angular Fire package still expects zone.js to be present, and will fail if it's not loaded. They are working on an updated version that doesn't require zone.js to be loaded. For now, though, if you use Angular Fire, you still have to load zone.js.
So, now I need to know how and when I have to update the page content manually? This seems like a step backwards, from my point of view it's a very expensive change, performance for me has never been a problem in my Angular applications...
If you use signals, or the async pipe, you don't have to use the change detector ref. The recommended approach is signals 👍
Is it necessary that if object defined in signalstate will only have deepsignal property.. can we achieve that in component? Without using signalState .?
If you are storing your state in an object, the signal() property will emit a new value when any of the properties changes. What you need to avoid it is something like NgRx Signal State, have a look at this video for more details - th-cam.com/video/ZlcL0dQvh-U/w-d-xo.html
when using zoneless, will change detection strategy matter which is selected, default vs on push?
Good question, as far as I know, Zoneless is it's own thing. default for sure won't work, OnPush haven't tried but it's essentially the same behavior. Let's see what the Angular team says in the session that is just getting started. 👍
The Angular 18 Zoneless Change Detection isn't working with AngularFire v18, it produces error when you try to run your App (ReferenceError: Zone is not defined) and causes the App not to run at all... Any fix for that?
Lots of community libraries don't work with zoneless, that is why it's still marked as experimental. Depending on the amount of external libraries that you use, it might be doable or not to use it at this stage. 👍
So I am combing thru a few apps to prepare to go zoneless. All going well...but I am stumped as to what to do with my reactive forms. Will they continue to work? (haha I will soon find out eh?!)
I tried with a simple signals app, and the forms where working fine, but haven't tried it yet in a more complex app. 👍
@@AngularUniversity good to know. now if i could only get my nx workspace to behave...
Can you make a video on using new material 3 by default
I think it's almost identical to the previous version, with a few tweaks here and there.
I am still using angular 8. 😢
Experimental I have problems with NG bootstrap modal, tool tips, toast,....
Yes those won't work indeed. I only use custo made or Angular Material which is all based on OnPush, so that it why it works.
This is because those 3rd party libs expect zoneJS to be present. @angular/fire has the same issue. Solution: keep zoneJS in polyfills but still use zoneless change detection
@@LarsRyeJeppesen NG0914: The application is using zoneless change detection, but is still loading Zone.js. but still not working
provideZoneChangeDetection and in angular.json "polyfills": [
"zone.js"
] will work fine, thx
What's the importance of it?
I think it's quite nice, it's one step forward to remove zones ans get rid of weird errors like Expression has changed after it was checked, etc.
I've never heard anyone prefer vscode theme to darcula!
Trust me on this one, it's waaaayyy better 😉
@@AngularUniversity I've used both and couldn't disagree more lol
For me it is the other way, I use VSCode with darcula theme, I am unable to use other theme. Darcula is perfect
i think they should also update to use all the files in one .ts file instead of creating .ts and .html may creating .ng to wrap all the file. thanks for the content😊😊
You're welcome, the Angular team is going on that direction of providing alternatives for single file components. 👍 Personally my components tend to have quite a bit of CSS, so I prefer to keep that on a separate file. I'm more looking forward to the functional authoring format. 😊
No thanks
angular feels like its made by dirty fixes to fix other dirty fixes.
Just like the browser, Windows, or many other successful technologies that never broke backwards compatibility. 😊👍
@@AngularUniversity that just not true. If you used angular for something more than a «hello world» project there will always be something broken between the upgrades.
@@ErnaSolbergXXX I've been upgrading several applications with every release, some even since the first Angular CLI came out, and the upgrade migrations work flawlessly. I just upgraded my main code base a couple of days ago to 18, it worked great. but you do need to have context about what the release did.
Still a simple hello world is 500kb
They are working on it, it though it was 300k something last time I heard about it. 👍
Just a heads up: some 3rd party libraries will crash/break if they cannot use zoneJS. Many of them expect zoneJS to be present. Example: ng-toastr, @angular/fire
Yes 😊 like ng-bootstrap, etc, won't work. I only use custom made components and Angular Material in my projects, with maybe a color picker external lib and that's it. I avoid using anything else because of this, some stop getting updated etc. 👍
Angular Fire is unfortunate though since I used Firebase alot on Angular projects. I guess we need to configure to Firebase manually without angular fire?
Thank you Vasco.
Explanations always as clear, precise and concise.
🙏🫶
Thank you, I'm happy to hear that 😊
How to difficult to listen you
The sound is not good? Accent too strong?
@@AngularUniversity Accent too strong. There is a big difference when the text is read and when an explanation is given on one’s own