Angular Blog | Medium Note

Angular Blog | Medium

The website appears to be the official blog of Angular, a web application framework. The homepage displays a list of recent blog articles titled such as "10th Anniversary of The Angular Project". Common themes include technology, development, and Angular itself. There is a search bar along with categories, tags, and an about page. It provides resources, updates, and tutorials related to the Angular framework.

Thread Of Notes

The author explores A2UI, an emerging protocol for building agentic interfaces, aiming to explain its implementation for developers. A2UI enables AI agents to dynamically generate interactive user interfaces across web, mobile, and desktop without arbitrary code execution, facilitating seamless and portable experiences. Unlike a framework, A2UI is a protocol that defines communication between an LLM agent and a client application, allowing developers to use their preferred frontend technology for rendering. The core architecture involves a server-side agent generating a UI layout message based on a shared schema, and a client-side application interpreting and rendering that message.On the server (agent) side, developers must provide several key inputs: a catalog of available UI building blocks (ranging from basic elements to custom components defined in JSON Schema), a natural language UI description guiding the agent on when and how to use specific UIs, and few-shot examples to illustrate the desired JSON message structure. Additionally, developers can augment UI descriptions with "agent skills" to define specific user capabilities and use cases, and "action mappings" to handle user interactions by translating events into new natural language queries for the agent. Agent tools, while a general agentic concept, are also crucial for performing tasks like fetching data or interacting with APIs.On the client side, particularly in an Angular application, the primary non-boilerplate requirement is configuring the application to render the components defined in the server-side catalog. If only standard elements are used, a basic catalog suffices. However, if the agent generates custom components, the client needs corresponding Angular implementations and a custom catalog that extends the basic one to register these components. A crucial rule is that the client's component definitions must perfectly match the catalog schemas and examples provided to the agent, ensuring accurate rendering of the dynamically generated UI.
CdXz5zHNQW_mxJqD9rrHE.png
CdXz5zHNQW_8wHqe4x7uv.jpeg
CdXz5zHNQW_D2PfQNkESJ.png
CdXz5zHNQW_J8s9Nu3Qbl.png
CdXz5zHNQW_bylcGSZJTi.png
The Angular and Chrome teams have collaborated to bring Angular-specific data and insights directly into the Chrome DevTools performance panel, creating a unified profiling experience for developers. This integration allows developers to combine the benefits of both tools, offering a more synchronized and comprehensive view of their application's performance. The new custom track for Angular in Chrome DevTools provides performance data using Angular concepts, such as application bootstrap, components, UI synchronization, and lifecycle hooks. The custom track's flame charts group function invocations together under corresponding components and other Angular concepts, allowing developers to drill down to individual functions for a more granular view. The flame chart entries are color-coded to help developers quickly identify what's happening in their application, distinguishing between application code, other scripts, or browser activities. The colors represent different aspects of the application, such as Dependency Injection services, templates compiled by Angular, and entry points. The custom track is interactive, allowing developers to click on an entry in the flame chart to reveal more detailed information about a given entry. To get started, developers need to ensure they are using the latest version of Angular and an up-to-date version of Chrome, run their Angular application in developer mode, and enable the custom track by typing ng.enableProfiling() in the console. This integration demonstrates the ongoing commitment to improving the developer experience within the Angular ecosystem, empowering developers to build faster, more efficient applications.
CdXz5zHNQW_arec9d2R1S.png
CdXz5zHNQW_4lkhfMb8Ye.jpeg
Enterprise-scale software systems are often implemented by multiple cross-functional teams, and to enable these teams to provide new features efficiently, it is desirable to minimize the need for coordination between them. This calls for a modularization that verticalizes the system into low-coupled areas individual teams can take care of. Micro Frontends is an architectural style that promises several advantages, such as a high amount of team autonomy, but it also comes with numerous challenges. Micro Frontends result in separate build processes, which can be combined with incremental builds to improve build-time. This feature can also be used without applying other aspects such as aligning teams with individual applications or separate deployments. However, individually developed Micro Frontends can diverge in UI/UX, leading to an inconsistent appearance, and loading several applications increases the number of bundles that need to be downloaded, adversely affecting loading times and increasing the memory pressure.Splitting an application into low-coupled parts might be a best practice in general, but it is often hard to define the boundaries between verticals clearly enough to implement them as individual applications. Integrating them into an overarching solution brings additional complexity, and moving away from a compile-time integration towards a runtime integration has severe consequences.The Angular team recommends checking if alternatives, like implementing the individual verticals in Monorepos, are suitable. However, there are also ways to compensate for the disadvantages of Micro Frontends, such as establishing a design system to help with a consistent UI/UX or lazy loading individual system parts.Native Federation is a community project that provides close integration with the Angular CLI and allows for the implementation of Micro Frontends with Angular. It enables an application to load parts of other separately built and deployed applications lazily and can share dependencies like Angular or RxJS between the host and remotes.To set up Native Federation, a schematic is provided, which configures the Native Federation builder delegation to the ApplicationBuilder and creates a configuration file federation.config.js. The configuration assigns a unique name to the remote or host and defines which dependencies to share. Remotes also define exposed EcmaScript modules that can be loaded into the shell.The schematic also adds code to initialize Native Federation to the main.ts, and to load a component or routing configuration exposed by a remote, traditional lazy loading is combined with Native Federation’s loadRemoteModule function.
CdXz5zHNQW_NpT7gwgsMy.png
The Angular team has been focused on improving developer experience and performance for the past two and a half years. Due to the rapidly evolving tech industry, the team defines a long-term vision and plans work on an annual, quarterly, and release basis, staying flexible to adapt to changing requirements. The team uses an annual developer survey to validate assumptions about developers' needs, with over 10,000 responses received in 2024. The survey results show that 79% of developers are using the latest two major versions of Angular, and 90% are using standalone components, directives, and pipes. The results also indicate an improvement in overall developer satisfaction, with close to 90% of developers reporting satisfaction with the framework. The team identified improvements such as standalone components, built-in control flow, and deferrable views as contributing to the satisfaction increase. However, component authoring format and testing remain key areas for improvement. In 2025, the team will focus on investing in key areas to help Angular developers succeed, including enhancing developer experience, enabling adoption of the latest improvements, and optimizing for performance. Notable projects for 2025 include promoting zoneless to developer preview, introducing signal-based forms, and replacing Karma with a new default test runner. The team will also evolve Angular's documentation to reflect the latest best practices and increase the visibility of features that help web developers meet their goals.
CdXz5zHNQW_Q8whPTKrhS.png
Angular's developer preview process allows developers to try out APIs and features before they are promoted to production, and enables the Angular team to adjust those APIs based on real-world usage and feedback. Through feedback on the effect() API, the team has identified several improvements to the design that will address real issues with functionality and developer experience. One of the changes is the removal of the allowSignalWrites flag, which was intended to encourage good patterns but ultimately discouraged usage of effect() in cases where it would be reasonable to update signals. Instead, the team will focus on other ways of encouraging good patterns, including the addition of new reactivity helpers where needed. The timing of when effects run is also being changed, with effects now running as part of the component hierarchy during change detection. This change aims to make effect timing more predictable and useful, and resolve bugs around effects running too early or too late. Most uses of the effect API will continue to work as expected, but some use cases may be impacted, such as effects against view query results and toObservable() of input signals. The Angular team has fixed around 100 cases where the timing change meaningfully impacted code during testing at Google. As a result of these changes, the effect() API will remain in developer preview through at least v19.0, with plans to stabilize the API in an upcoming minor release. The Angular team thanks the community for their feedback and support, which has played a crucial role in the development of Angular.
Angular v17.3 introduces an improved API for declaring outputs, available as a developer preview. The new API simplifies the process of declaring outputs in directives and aligns with other function-based APIs like signal inputs. It also provides more correct types for emitting values, improving type safety and reducing the risk of subtle runtime errors.Developers can declare outputs using the output() function, which initializes a class field and allows values to be emitted by invoking the .emit function. For outputs based on observable streams, the outputFromObservable() function can be used.The new API is not a signal but an ergonomic improvement that reduces boilerplate code. It features automatic cleanup of outputs upon directive destruction and improved type safety for emitted values.All outputs implement the OutputRef interface, providing a consistent way for developers to listen to outputs programmatically. The RxJS interop package includes the outputToObservable function for listening to outputs in an RxJS-idiomatic way.The new output API is available in developer preview and Angular encourages feedback from the community. Developers can try the new APIs by installing the latest version of Angular with ng update.The improved output API in Angular v17.3 offers several benefits, including conceptual alignment with other function-based APIs, simplified syntax, automatic cleanup, improved type safety, and consistent programmatic listening.Developers are encouraged to provide feedback on the new output APIs through comments, GitHub discussions, or other channels. The feedback will be used to further refine and stabilize the APIs.