Courses / JavaScript
80. Contract-driven API for frontends
Using clear public APIs/events for microfrontends to communicate while preserving encapsulation.
JavaScript
Contract-driven API for frontends
A contract-driven API is a small, explicit interface (methods and events) frontends use to communicate without reaching into each other's internals.
"I want two microfrontends to talk without depending on each other's DOM, code, or internal state."
Define a minimal public surface (functions, events, payload shapes) both sides agree on; implementers keep everything else private. The contract is the only allowed communication channel.
"I want two microfrontends to talk without depending on each other's DOM, code, or internal state."
Define a minimal public surface (functions, events, payload shapes) both sides agree on; implementers keep everything else private. The contract is the only allowed communication channel.