npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vanilla-native-federation

v1.1.4

Published

A lightweight **runtime micro frontend orchestrator** that loads micro frontends built with native federation into any web page. It can cache dependencies across page reloads, making it perfect for traditional server-rendered hosts (PHP, Java, Rails, etc.

Downloads

3,682

Readme

vanilla-native-federation

A lightweight runtime micro frontend orchestrator that loads micro frontends built with native federation into any web page. It can cache dependencies across page reloads, making it perfect for traditional server-rendered hosts (PHP, Java, Rails, etc.) that refresh on navigation.

Verify library Coverage total

Read more in this in-depth article: Migrating a stateful monolith to micro frontend architecture using native federation.

Key Features

  • Zero Framework Dependencies - Built in vanilla JS so it works with any frontend/backend technology
  • 🚀 Simple Drop-in Integration - Add micro frontends with a single script tag
  • 💾 Advanced Caching - Optimized for page-reload scenarios with flexible storage options like localStorage and sessionStorage
  • 🔄 Smart Dependency Resolution - Automatic version conflict resolution and sharing based on the module federation mental model.
  • 🌐 Full native-federation compatibility - Works with standard remoteEntry.json format.
  • Lightweight & Fast - Minimal bundle size (~80kb) with tree-shaking support.
  • 🛠️ Highly Configurable - Extensive options and SDK for fine-tuning behavior.

How it works

The library runs in the browser to orchestrate the integration of micro frontends into plain HTML pages. While the host application can be SSR, the micro frontends are loaded as ES modules at runtime, providing the benefits of micro frontend architecture without requiring a full SPA framework.

Extends the Native Federation Ecosystem

This library provides an alternative runtime to @softarc/native-federation-runtime, extending native federation capabilities specifically for non-SPA environments while maintaining full compatibility with the broader ecosystem. It can load any remotes that have been built using @softarc/native-federation and expose a remoteEntry.json metadata file.

What makes this orchestrator different?

Next to the advanced dependency resolver, this orchestrator offers the possibility to cache the remoteEntries in localStorage or sessionStorage. This way the downloaded dependencies can be reused, even over multiple routes. This is not an issue with SPA websites that don't reload the page on rerouting but essential to traditional websites where every route is a full page refresh. However this orchestrator can also be used in SPAs.

Quick Start

Get up and running in under 2 minutes:

1. Add to your HTML page

<!DOCTYPE html>
<html>
  <head>
    <title>My Application</title>

    <!-- Define your micro frontends (remotes) -->
    <script type="application/json" id="mfe-manifest">
      {
        "team/mfe1": "http://localhost:3000/remoteEntry.json",
        "team/mfe2": "http://localhost:4000/remoteEntry.json"
      }
    </script>

    <!-- Handle loaded modules -->
    <script>
      window.addEventListener(
        'mfe-loader-available',
        e => {
          // Load your remote modules, a remote can have multiple modules
          e.detail.loadRemoteModule('team/mfe1', './Button');
          e.detail.loadRemoteModule('team/mfe2', './Header');
        },
        { once: true }
      );
    </script>

    <!-- Include the orchestrator runtime -->
    <script src="https://unpkg.com/[email protected]/quickstart.mjs"></script>
  </head>
  <body>
    <!-- Use your loaded components -->
    <my-header></my-header>
    <my-button>Click me!</my-button>
  </body>
</html>

2. That's it! 🎉

Your micro frontends are now loaded and ready to use. The runtime handles the whole flow of fetching the remote entries (metadata files), resolving and caching the shared dependencies and finally (lazy) loading the remote modules.

Available quickstart runtime

<!-- Development and quick testing -->
<script src="https://unpkg.com/[email protected]/quickstart.mjs"></script>

Advanced Usage

The quickstart is intended for experimenting. For production environments it is recommended to use a custom orchestrator based on the vnf library, this gives more control over the initialization process and allows for custom logging implementations like Bugsnag or Sentry rather than the default consoleLogger:

import { initFederation } from 'vanilla-native-federation';
import { consoleLogger, localStorageEntry } from 'vanilla-native-federation/options';

const { loadRemoteModule } = await initFederation(
  // Manifest
  {
    'team/mfe1': 'http://localhost:3000/remoteEntry.json',
    'team/mfe2': 'http://localhost:4000/remoteEntry.json',
  },
  // Options
  {
    logLevel: 'error',
    logger: consoleLogger,
    storage: localStorageEntry,
    // ... see docs for all available options
  }
);

// Load specific modules
const ButtonComponent = await loadRemoteModule('team/mfe1', './Button');
const HeaderComponent = await loadRemoteModule('team/mfe2', './Header');

📖 See the Configuration Guide for complete configuration options

Documentation

| Guide | Description | | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | 🚀 Getting Started | Detailed setup instructions and examples | | 🏗️ Architecture | Understanding the native federation domain | | ⚙️ Configuration | Complete configuration reference | | 🔄 Version Resolution | How dependency conflicts are resolved |

Native Federation Ecosystem

This library is part of the broader native federation

| ecosystem: | Purpose | | ------------------------------------------------------------------------------------------------------------ | --------------------------- | | @softarc/native-federation | Core build toolchain | | @softarc/native-federation-runtime | Core runtime | | vanilla-native-federation | Alternative runtime | | @angular-architects/native-federation | Build toolchain for Angular |

Full compatibility with standard remoteEntry.json format ensures seamless interoperability

More information

Read here more about the ecosystem!

Alternative orchestrators

While this orchestrator focusses on compatibility and native-federation support. There are other orchestrators out there that provide support for other use cases:

| Package | EcoSystem | Description | | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | -------------------------------------------------------------------------- | | @softarc/native-federation-runtime | Native federation | The default provided orchestrator for native federation | | picard | native-federation, module-federation and Piral | An agnostic orchestrator that focusses on compatibility between ecosystems | | @module-federation/runtime | module federation | The orchestrator specifically for module federation |