Building Tech Startups
That could be a sign for you, when you have a big enterprise application where you can easily divide logic by domain accessory. There’re a bunch of apps in Google nowadays e.g. Google Drive, Google Docs, Gmail etc and it’s quite obvious that Google Drive and Google Docs should not be a single app just because both use authentication and same frameworks.
Your case might not be so obvious as Google’s one but let me describe some Benefits of front-end microservices architecture:
Of course, it goes with some Costs:
I did a research. And even asked the community for any existing examples:
P.S. I was looking for any solutions besides iFrame.
I have successfully built Polymer with AngularJS as a nested component. But, somewhere on forums, there was a restriction about doing that. So I decided to go lower level and built the same approach on the level of Web Components.
Idea is to predefine components as HTML imports, while each of them could include their own scripts and styles. So we can decide on the top level which HTML import should be presented in DOM at the moment, and rest of things should be handled by the imported document itself.
Shell — is a top level wrapper which consists of component picker and container for components. Also should include views or controllers which allow user manipulating components.
Container — the actual root place where HTML of nested application should be injected. (It should have a single entry point for all nested apps).
Component picker —service which allows managing nested application which is active at the moment.
HTML imports — our abstract microservices. Could be whole apps written in different frameworks.
16 LOC: Container for nested applications.
Two nested applications —
react-app.html. By clicking on one of two buttons we load corresponding application with the help of
loader.js is a kind of Component picker which I’ve described in the previous paragraph.
This approach was implemented for a production application. It was proven by thousands of users.
I would suggest to answer yourself few questions before you start dividing your application to front-end microservices:
Create your free account to unlock your custom reading experience.