DEV Community

Discussion on: A progressive micro frontends framework - Fronts

Collapse
 
kleveland profile image
Kacey Cleveland

How does communication work between micro-frontends using fronts? If I have a parent frontend that has state management and I want all of my child frontends to pull in some of the parent's state, is there a way to handle this with fronts? First thing that comes to mind is user authentication and storing a user's state in the parent state with the child frontends pulling the user's session in from the parent state.

Collapse
 
unadlib profile image
Michael Lin

Yes, you can use fronts-transport. For example, globalTransport.listen('increase', (count) => count + 1) and const result = await globalTransport.emit('increase', 1), and the result should be 2.

fronts-transport can be used in any iframe or non-iframe micro frontend, they can communicate as long as they have a dependency, either indirect or direct.

So sorry, the documentation for fronts is still in progress.

Collapse
 
kleveland profile image
Kacey Cleveland

No worries; it is a very cool project and I am looking forward to seeing your progress going forward!