A Minimal React Server Components Bundler & Library
MIT License
⚗️ A Minimal React Server Components Bundler & Library
MFNG offers two packages that together enable the building of a production-ready RSC app.
@mfng/core
This package contains the essential building blocks required on both the server and the client to create a streaming, server-side rendered, and properly hydrated RSC app. It also provides utilities that are needed for server-centric, client-side navigation.
@mfng/webpack-rsc
This package provides a set of Webpack loaders and plugins required for building
an RSC application bundle for the browser, as well as for the server. The server
bundle can be deployed to any serverless, edge, or Node.js-based environment.
@mfng/webpack-rsc
can be used standalone as an RSC bundling solution or in
conjunction with @mfng/core
.
'use server'
directiveThe name MFNG stands for "Microfrontends Next Generation". The project was originally motivated by the following questions:
Do we still need to deploy microfrontends and their APIs (also known as BFFs – Backends for Frontends) independently of the main app? Or can we integrate them at build-time, though dynamically composed at run-time, and allow them to use server components to fetch their data on the server?
It has since evolved into a general-purpose RSC library, not specifically targeted at the microfrontends use case... until we explore some form of federation integration, as pioneered by federated-rsc, perhaps.