Skip to content

Latest commit

 

History

3,104 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The hyperfrontend cube

hyperfrontend

Compose web apps built on different stacks into one product at run time, over a typed, secured channel.

Docs · Get started · How it works · Demos · Packages · Manifesto

Build status of the main branch Test coverage Latest version of @hyperfrontend/features on npm MIT license

A host page with three empty slots. Three application windows, a React one, an Angular one and a jQuery one, each served from its own address, slide in from the right and seat into the slots one after another; a wire draws from the host's hub to each seated window, and named messages such as order-placed cross the wires in both directions. Each window keeps its own chrome and origin inside the host, and a faint outline stays at its original address.

Your React app, the Angular one next door, and that jQuery thing from 2014 can share a page without sharing a build. Each stays its own deployment at its own origin. The host installs one shell package and talks to it over a typed contract, sealed with per-session keys when the payload matters. That is @hyperfrontend/features: the SDK, the hf CLI and the dev server.

How it works

A host application at app.example.com loads a feature shell, which draws an isolation boundary, a browsing context, around the feature application served from checkout.team-b.dev; contract messages cross between them. Four numbered ideas: runtime loading, isolation boundary, typed validated contract, independent deployment. Below, a cross-section of the channel shows its layers: features for the shell, display modes and session lifecycle; nexus for the handshake, contract and heartbeat; network-protocol for the sealed session envelope; cryptography for AES-GCM, ECDH and HKDF at the core.

The architecture guide walks the seam in depth: the handshake, the four-state liveness watchdog, and the polite teardown. The security model says what the sealed envelope is worth against which adversary, and which controls stay yours.

See it running

Eight koi swimming in a single pond, each one rendered by a different framework app

Eight koi, eight frameworks, eight separately deployed apps, one pond. The gallery also runs Clock, a Vue timepiece in a React host across a cross-site boundary, and Heartbeat, liveness and latency, and what a host should do when a feature stops answering.

Get started

npm install @hyperfrontend/features

A feature declares what it sends and accepts; a host mounts it and gets a typed handle back:

// In the feature app, from '@hyperfrontend/features/hostee'
const feature = createFeature({ name: 'checkout', contract })
await feature.ready()
feature.send('order-placed', { id: 'A-1094' })

// In the host app, from '@hyperfrontend/features/host'
const checkout = createShell({ modes: { dialog: mountDialog }, url: 'https://checkout.example.com' })
checkout.on('order-placed', (order) => showReceipt(order))
checkout.open({ displayMode: DisplayMode.Dialog })

The bundled hf CLI turns an existing app into a feature and packs the shell a host installs:

# scaffold the feature side into an existing app
npx @hyperfrontend/features init
# bundle a self-contained shell package, with the security envelope baked in
npx @hyperfrontend/features build --protocol v4
# serve both sides locally, with a debug UI for the traffic between them
npx @hyperfrontend/features dev

Start with Core Concepts, then the guides and tutorials, each one verified against code that runs. Every option, handle and payload type is in the API reference. Not sure the pattern fits your case? Take the fit assessment.

Packages

The published packages as a map: features at the top; nexus and network-protocol under it as cross-window messaging, with an arrow from network-protocol to cryptography, which seals the channel; cryptography, state-machine and logging grouped as packages that stand on their own; builder, which packs the shell, versioning, project-scope and questions grouped as build and release tooling; and nine utilities along the foot, from json-utils to function-utils.

Every package is published on its own and documented on the libraries index, the flagship first and the single-purpose utilities last. The ones under the flagship exist because it needed them, and each one solves a problem an application has whether or not it is a micro-frontend.

All nineteen packages
npm What it does
@hyperfrontend/features The SDK, CLI and dev server: embed another team's app over a typed, supervised channel · docs
@hyperfrontend/nexus Contract-validated messaging between windows, frames and workers, over a real handshake · docs
@hyperfrontend/network-protocol A session-keyed, replay-proof envelope for cross-window messages, on any transport · docs
@hyperfrontend/builder Bundles a TypeScript library into ESM, CJS, IIFE and UMD, and writes the manifest that ships with it · docs
@hyperfrontend/versioning From conventional commits to the bump, the version and the changelog entry · docs
@hyperfrontend/project-scope Reads a repository it has never seen, scores what it finds, and stages writes until you commit them · docs
@hyperfrontend/questions Terminal prompts that return a value, never an exception · docs
@hyperfrontend/json-utils JSON Schema validation that reports every violation at once, with the pointer that found it · docs
@hyperfrontend/ui-utils DOM utilities that hand back their own teardown: styles, gestures, element lifecycle, colour · docs
@hyperfrontend/immutable-api-utils Built-ins captured before untrusted code runs, and objects nothing can tamper with after · docs
@hyperfrontend/state-machine The lifecycle of an async operation as a store, with the states a lone isLoading cannot tell apart · docs
@hyperfrontend/logging Structured, levelled logging with channels and timers · docs
@hyperfrontend/cryptography Password and key encryption with one call, the same in the browser and in Node.js · docs
@hyperfrontend/data-utils Walk, compare and repair data structures, circular references included · docs
@hyperfrontend/time-utils Timers that can be paused and resumed, intervals, and time normalisation · docs
@hyperfrontend/random-generator-utils Seeded, reproducible random draws from real distributions, plus UUIDs · docs
@hyperfrontend/string-utils Base64 and friends that encode UTF-8 first, identical in the browser and in Node.js · docs
@hyperfrontend/list-utils FIFO and LIFO lists of objects held by reference, with the filtering and iteration to match · docs
@hyperfrontend/function-utils Wrappers that change what a call does without changing what it looks like · docs

Documentation

Contributing

Read the contributing guide for the development setup (GitHub Codespaces works out of the box), the contribution process, and the coding and commit conventions. Every contributor signs the Contributor License Agreement before a pull request can merge. If you use LLM assistance, REGARDING_AI.md describes how AI tooling is used here.

Security

Report vulnerabilities through the security policy, never through a public issue.

Support

Star the repository, write to the project with a question, or see FUNDING.md for ways to support the work.

Contributors

All Contributors

Andrew Redican
Andrew Redican

💻 📖 🚇 🚧 📆 🤔
Brian Smith
Brian Smith

🤔
Add your contributions

This project follows the all-contributors specification. Contributions of any kind are welcome.

License

MIT

Releases

Sponsor this project

Packages

Used by

Contributors

Languages