Urgent.News

What's breaking now, across thousands of outlets.

Tech

Build-Time, End to End - From federation.config to remoteEntry.json

Part 3 of an 8-part series on Native Federation v4 for enterprise architecture teams. New to the series? Start with Part 1: The Mental Model, Revisited . In Part 2, we mapped the four layers of Native Federation v4 and saw that one file, remoteEntry.json , connects the build to the browser. This article zooms in on the build side and answers three questions: What do you write in…

Build-Time, End to End - From federation.config to remoteEntry.json

In the final part of the eight-part series on Native Federation v4 for enterprise architecture teams, we dive into the build process and explore how the federation.config.mjs file influences the creation of remoteEntry.json and other essential files.

What is contained in federation.config.mjs?

The federation.config.mjs file is a crucial part of a federated project. It provides configuration for Native Federation v4 and includes settings such as name, exposes, shared, skip, features, etc. For example, the Angular adapter's ng add schematic generates a default configuration for a remote, which is then customized as per project requirements.

What happens during a federated build?

A federated build is different from a normal Angular build. In a traditional build, all libraries are bundled together, causing redundancy in the number of Angular downloads. However, in a federated build, each shared library is split into its own file, allowing browsers to download them only once and reuse them across applications. Additionally, two small description files, remoteEntry.json and importmap.json, are generated. These files help the browser understand what is available for loading.

What is the role of remoteEntry.json?

remoteEntry.json is the file that connects the build process to the browser. It contains information about the shared libraries, their URLs, and other necessary details for the browser to load the required components. RemoteEntry.json is created during the build process through the federated build workflow.

How does the browser find remote libraries it hasn't seen before?

When the federated build is complete, the browser needs to discover remote libraries that are required for the application to function properly. To achieve this, it relies on the manifest, which is a list of remote names and their corresponding remoteEntry.json file URLs. With this information, the browser can dynamically request and load the necessary remote libraries from the host application.

In summary, the federation.config.mjs file plays a significant role in the Native Federation v4 build process. It defines the shared libraries, their configurations, and other settings that ultimately influence the creation of remoteEntry.json and other essential files. By understanding the inner workings of this configuration file and the build process, enterprise architecture teams can better utilize Native Federation v4 to optimize their applications for better performance and resource sharing.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

111 and 2049: RPC and NFS Endpoints in an Internet-Facing Population

111 and 2049: RPC and NFS Endpoints in an Internet-Facing Population Services that were never meant to leave the data centre Some protocols exist to make a private network work.

  • RPC and NFS endpoints found on internet-facing assets
  • Redis and memcached caches accept unauthenticated connections
  • Recommendation to verify reachability and enforce authentication

Phishing domains impersonate govt agencies

ISLAMABAD: The National Cyber Security Emergency Response Team (NCERT) has detected a number of suspected phishing domains created in the name of key national institutions, apparently aimed at…

Phishing domains impersonate govt agencies

ISLAMABAD: The National Cyber Security Emergency Response Team (NCERT) has detected a number of suspected phishing domains created in the name of key national institutions, apparently aimed at…

I have completely abandoned MicroFeed.

Github因为我发的一些比基尼的图片直接给我删库了,其实用的也不是GitHub的图床了还是被废了。虽然GitHub/GitLab注册很简单,但对这些第三方代码平台有点烦了。 SaaS全托管的最后考虑Mataroa…

More from Tuesday 6 October →