Posts

Showing posts from September, 2021

React For Angular Developers!

Image
The Problem: The one big problem all the frameworks are trying to solve: The browser's real DOM operations are expensive because they trigger reflows (layout recalculations) and repaints. When a user types in an input field, the browser processes updates in four main stages : JavaScript Execution: when an event like oninput triggers, JavaScript modifies the DOM (e.g., updating an <input> field's value). Style Calculation:  If styles depend on the modified element, they might need recalculating for related elements. Layout (Reflow):   If the change affects an element’s size or position, the browser recalculates the layout of affected elements (e.g., increasing a <div> size). Painting & Compositing:  If elements were moved, resized, or changed visually, the browser re-renders them. How React’s Virtual DOM Optimizes This Instead of immediately modifying the real DOM, React follows an optimized approach : JavaScript Execution: Just like before, the input ...

Multi-app MicroFrontends in Angular

Image
Github links: shell-app find-hotels account-mgmt Create 3 Angular apps as usual: ng new hotel-reservation-system --routing --style=scss ng new find-hotels --routing --style=scss ng new account-management --routing --style=scss Here hotel-reservation-system is the shell app that hosts find-hotels and account-management Go inside each of the apps and run: ng add @angular-architects/module-federation --project hotel-reservation-system ng add @angular-architects/module-federation --project find-hotels ng add @angular-architects/module-federation --project account-management Select different default ports if needed. I am selecting hotel-reservation-system: 4200 find-hotels: 63402 account-management: 63414 In each of the apps, navigate to: <app>\webpack.config.js update this: const { shareAll , withModuleFederationPlugin } = require ( '@angular-architects/module-federation/webpack' ); module . exports = withModuleFederationPlugin ({   name : 'hotel-reservation-system...