Let me know if you turned on the EsBuild system, and what performance benefits did you notice? 😊 If you are looking to learn Angular, check out my courses at the Angular University 👍 - angular-university.io
@lapin077 ай бұрын
Still trying, I have issue with alias and path
@AngularUniversity7 ай бұрын
@@lapin07 I hope the video will help then 👍
@hatsvids7 ай бұрын
I am using ESBuild... the final bundle size seems somewhat bigger (more 40/50Kb in the final build), but the compilation time has decreased from about 40 seconds to 16 seconds with ESBuild... I haven't had the chance to try the new 'application' method yet, I believe it requires some additional reconfiguration of the angular.json.
@AngularUniversity7 ай бұрын
@@hatsvids There is a new migration for that, plus a couple of code changes are likely needed. I think you will like the video then 😉
@AleksandarT105 ай бұрын
Running the command + fixing some of the imports did the trick for me! Thanks a lot for that, it speed up our builds by more than 30-40%
@AlainBoudard7 ай бұрын
Spot on Vasco ! You're right, the v16 build was already much faster than previous versions, but now they made a big step ! Thanks for the hint about http2 I didn't know !
@AngularUniversity7 ай бұрын
You're welcome Alain, yes and Angular 17 build is even faster, even if it's not the ESBuild version. 😊 The ESBuild faster is slightly faster in development, but much faster while doing the production build.
@ВолодимирНакутний7 ай бұрын
Thank you for this. We already updated our project to ver17.1.3 Let's try it tomorrow 😊
@AngularUniversity7 ай бұрын
You're welcome, let me know how it went. 😊 👍
@hatsvids7 ай бұрын
Thank you for the tips, I will try to use the migration later on.
@AngularUniversity7 ай бұрын
You're welcome, I'm glad it helped and let me know how it went 👍
@NoName-13377 ай бұрын
Great video, thank you very much.
@AngularUniversity7 ай бұрын
I'm glad it helped 😊
@vasiliuandrei497117 күн бұрын
Hello! I have a problem after migrating to esbuild (automatic migration). When I try to test build production output using http-server , the application starts with the loading page but none of the http requests starts. No errors / warnings shown in the console. Reverting back to angular-build:browser, the problem is gone. Starting with Ng serve, it works as expected. Any ideas to solve build production with esbuild?
@ChrisPHolder5 ай бұрын
Have you considered that the bundle size decrease might just be because you were opting out of tree shaking by using require and CJS? Would be interesting to see if the bundle would decrease the same amount if you simply use ESM and don’t opt out of Tree shaking with require calls 🤔
@AngularUniversity5 ай бұрын
It could be, also this build splits the code into many smaller bundles. 👍
@margaridasemedo78462 ай бұрын
Great video! Thank you for sharing. How would you suggest to set up environment variables. Esbuild doesn't seem to have anything out of the box. Been struggling with it. On build esbuild can't find my environment variables. Using Anguar 17.3.11
@AngularUniversity2 ай бұрын
you can try ng add environments
@ico0z7 ай бұрын
The status for ESBuilds wasn't it in preview and only for dev server?
@AngularUniversity7 ай бұрын
It was in preview for 16 and our of preview in 17.The new esbuild is now out of developer preview and it's the default for new applications. But existing applications need to migrate manually, that's the catch. 👍😊
@walterluszczyk7 ай бұрын
Great, I need to try in my code. Meanwhile I have a question. I've notice in start version of code, that there was massive amount of Angular Material in your main bundle. After migration it has disappeared. Was it automatically separated to some shared bundle?
@AngularUniversity7 ай бұрын
Yes, the ESbuild build system will split the main bundle into separate smaller chunks. It works in a very different way than the standard bundler. Remember that we need a production server with support for HTTP 2, but this shouldn't be an issue 👍
@bullettime28087 ай бұрын
Still no fast refresh 😢
@AngularUniversity7 ай бұрын
Weird, are you sure you updated? The refresh is blazing fast for me, way better than in Angular 16. I often can't even switch to the browser enough to see the reload happening.
@bullettime28087 ай бұрын
@@AngularUniversity I mean state-full fast refresh like React, Flutter and most other frameworks , In Angular if you make a change your entire app restarts
@gleitonfranco12607 ай бұрын
🔝‼
@AngularUniversity7 ай бұрын
Thank you! Stay tuned and enjoy the videos
@drax4324 ай бұрын
By default (without any explicit configuration from developer), does Angular 18 uses vite and esbuild? Or is it still using webpack?
@AngularUniversity4 ай бұрын
Since Angular 17, the new ESbuild was enabled by default to new apps, but the migration to 17 did not migrate it, you had to migrate manually. The migration to 18 will now ask if you want to migrate to ESBuild. 👍
@drax4324 ай бұрын
thanks for replying. When i use angular 18 directly (no migration involved), i wonder if by default, ESbuild is enabled. Cos when i look at the package-lock.json, i saw dependencies related to Esbuild and webpack. So i wonder which is the default one used
@AngularUniversity4 ай бұрын
@@drax432 Check the output on the build folder. Webpack will only output 4 main files, plus one bundle part lazy loaded element, but esbuild will output way more files, and they are named chunk* I think the dependency with webpack is not yet fully removed with the CLI, or they install it both not knowing which one you will use.
@КонстантинХ-у4ф7 ай бұрын
where is source??????
@AngularUniversity7 ай бұрын
this source code is not public, it's my company code.
@Anbu_Sampath7 ай бұрын
Will esbuild become default in future version of angular?
@AngularUniversity7 ай бұрын
I'm guessing that it will be the default eventually, but I don't remember seeing that mentioned anywhere.
@LarsRyeJeppesen7 ай бұрын
I think it is already
@giorgipaikidze856 ай бұрын
Thank you Vasco. I got an error when turned on esbuild. App build works fine, it's really fast, but it throws the following error when changing the route - dynamic require of is not supported. And it points to lazy lodede modules. After some research It seems esbuild does not support dynamic imports. Do you have any idea about this?
@AngularUniversity6 ай бұрын
How are you making the imports? I have my platform running on Esbuild, we use router dynamic imports and it works. This seems like something to your project? 👍
@giorgipaikidze856 ай бұрын
@@AngularUniversity Yes, it seems something is missing in my project. I use nx and updated recently to 17.1 with nx. I am using standard lazy loading - loadChildren property. With old browser builder project works fine, but after switching to browser-esbuild it gives this error. After debugging it seems when dynamic import is triggered esbuild checks if require is defined or not and since it is not present in the browser it throws the error. here is the code which throws the error: var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw new Error('Dynamic require of "' + x + '" is not supported'); });
@giorgipaikidze856 ай бұрын
@@AngularUniversity yes,something is miising in my project. I use nx and updated recently to 17.1 with nx. I am using standard lazy loading - loadChildren: () => import('some.module').then(m => m.SomeModule). With old browser builder project works fine, but after switching to browser-esbuild it gives the error. After debugging it seems when dynamic import is triggered esbuild checks if require is defined or not and since it is not present in the browser it throws the error. Here is the code which throws the error: var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) { if (typeof require !== "undefined") return require.apply(this, arguments); throw new Error('Dynamic require of "' + x + '" is not supported'); });
@giorgipaikidze856 ай бұрын
@@AngularUniversity yes,something is miising in my project. I use nx and updated recently to 17.1 with nx. I am using standard lazy loading - loadChildren: () => import('some.module').then(m => m.SomeModule). With old browser builder project works fine, but after switching to browser-esbuild it gives the error. After debugging it seems when dynamic import is triggered esbuild checks if require is defined or not and since it is not present in the browser it throws the error.
@AngularUniversity6 ай бұрын
@@giorgipaikidze85 I did not try the new EsBuild with module-based lazy loading, as the platform had already been migrated to standalone components, but I assume that it not related. what I suspect that happens in your case is that maybe not all the EsBuild bindles are being sent to production. Does it work locally?