Namaste 🙏🏼
Welcome to my blog. Today I have come up with an interesting topic in the world of software development. We gonna talk about build artifacts in Angular Project.
Have you ever wondered what are these files ?
These files appear when you try to build your angular project. We gonna discover this and learn importance of build artifcats in Angular project.
Imagine a fictious world of Angular having 4 super heroes, The Code Avenger, The Web Wizard, The Browser Magician, and The Script Guardian. Lets see how they are guiding the world of Angular.
Let's dive into it!
Whenever you try to build your angular project, there are some bunch of files generated which are typically known as angular build artifacts. There are various files generated among these, vendor.js, main.js, polyfills.js, and runtime.js play vital roles in your application's performance, compatibility, and functionality.
Lets understand file by file and try to know its importance and significance
This file is like the hero behind the scenes, assembling a powerful arsenal of libraries and dependencies to save your app from chaos.
Purpose:
vendor.js is a key part of the Angular build artifacts, responsible for encapsulating third-party dependencies and external libraries. When Angular combines all these dependencies into one file, it makes the loading process more efficient. This means fewer times your browser has to reach out for different parts, making everything load faster.
The contents of vendor.js can be broadly categorized into two main types:
1. Angular Libraries:
2. Third-party Dependencies:
How it works?
Significance:
As the central figure, this script weaves the elements of your application together, casting spells to create a seamless and magical user experience.
Purpose:
Main.js is the friendly guide, steering the ship through the coding seas. It's the storyteller, turning a bunch of code into a real-life, user-friendly adventure. In the tale of your Angular journey, main.js is the main character, ensuring every piece of the puzzle fits snugly together. It's the glue that binds your app's tale, making sure every click, animation, and user journey unfolds like a well-scripted scene in the play of digital life.
The contents of main.js include
1. Application Code:
This includes all the custom TypeScript and Angular code written for your application. Components, services, directives, modules, and other custom logic are part of this file.
2. Module Definitions:
Angular applications are organized into modules. The module definitions specifying how the application is structured are included in `main.js`.
How it works?
Significance:
This script performs magical feats, making your app compatible with various browsers by conjuring up the necessary spells and tricks.
Purpose:
Meet polyfills.js, the magical wordsmith conjured up during the mystical build process of your Angular saga. This JavaScript virtuoso isn't just any file – it's like a wizard's wand crafted to tame the wild seas of cross-browser chaos.
In the enchanted world of web development, browsers play by their own rules. That's where polyfills.js steps in, donned in a cloak of code, armed with the power of polyfills. Think of these polyfills as tiny sorceries, whispering ancient secrets to browsers that missed the memo on the latest JavaScript trends.
The contents of polyfills are
How it works ?
Significance:
As the last line of defense, this script stands guard during the runtime, ensuring smooth execution and protecting your app from unexpected threats in the digital universe.
Purpose:
Enter the realm of runtime.js, the unsung hero born from the enchanted forge of Angular app creation. Crafted during the mystical build process, this JavaScript sorcerer is more than just lines of code – it's a living essence, a digital spirit that breathes life into your Angular adventure.
Picture runtime.js as the guardian of the Angular realm, entrusted with a sacred mission: to introduce the Angular runtime and compiler. It's like the wise elder who imparts knowledge to the app, teaching it the art of dynamic component creation and the magic of template compilation within the very heart of the browser.
The content of runtime js includes:
How it works ?
Significance:
Wooooohoooooo, that was it.. you made it and thanks for being with me till the end.
So, in this vast digital playground, our Code Avenger steps up, weaving a safety net of libraries and dependencies, like a tech superhero gearing up for battle. Meanwhile, our Web Wizard, with a touch of whimsy, brings the interactive magic to our user interfaces, painting a colorful and user-friendly canvas.
Enter the Browser Magician – the unsung hero behind the scenes, making sure our creations play nice with every browser out there. But let's not forget the quiet champion, the Script Guardian, keeping watch over the runtime show, ensuring our digital scripts run smoothly through the ever-flowing river of time.
In this grand tech tale, these digital myth-makers remind us that behind every click, every animation, and every seamless experience, there's a bit of magic and a lot of guardianship happening in the background. Here's to the tech enchanters making our digital adventures both magical and reliable!
I hope you liked my idea of converting a blog into a fictional characters and understanding their importance.
Thank you for reading,
Happy Coding, Happy life
This side Devesh Korde, signining off