-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a micro frontends prototype with JHipster #10189
Comments
I will provide a small proof of concept using tailor/mosaic here https://github.com/atomfrede/jh-10189-poc/tree/master. If that works out well we can go on with a real world prototype using real jhipster services and authentication etc. |
@mraible Just to keep you updated, I have first version with spring cloud gateway, a simple shell service, tailor based layout service and will try to create two fragment services during the next week. When that is done we should have a look at how to integrate auth etc. |
That's awesome! Thanks for the update.
… On Sep 13, 2019, at 13:53, Frederik Hahne ***@***.***> wrote:
@mraible Just to keep you updated, I have first version with spring cloud gateway, a simple shell service, tailor based layout service and will try to create two fragment services during the next week. When that is done we should have a look at how to integrate auth etc.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
To add some support, thoughts, and potential opportunities for contributions around MFEs. The TL;DR I am the CTO at Entando (an open source company) that is doing a lot of work around Micro Frontends and modernizing what we do from a development perspective. We're migrating our plugin and widget architecture to JHipster generated microservices and micro-frontends now. We're actively working on generating a collection of micro-frontends using JHipster from JDL or an entity that we can then composed into a complete application using our engine and App Builder application. For example, each entity will have an MFE for a table, detail view, and form in MFE form. All exposed as custom elements. We're using JHipster for our microservice generation (with customizations via blueprint) and adding the MFE generation to our blueprint. As we get further into our development, if it is interesting to the community/team, we would be open to moving our MFE generation code up into the mainline generator and out of our blueprint. We're also going to be doing work around making the spring boot services for JH more kubernetes focused. We've got an operator and some sidecars now to tie it all together including our JH services. If there is ever interest in a more K8s flavored Jhipster we could pull some of that up into the main project as well. You can follow along on our github as well if there is interest: The base POCs for generated widgets that we'll eventually migrate into the blueprint: Some K8s stuff: cc @salaboy for k8s and operator thoughts |
We've updated our blueprint to generate Micro-frontends using custom elements based on entities processed through JHipster. For each entity we generate a React MFE including a table, details view, and form. Each MFE also exposes custom events that are consumable by the other MFEs on the page. We're working through the full flow between MFEs now. An example event flow,
The objective is to standardize the custom events so that they can be easily consumed by other MFEs (or other assets generally) on the page. Latest is here |
@joewhite101 awesome stuff! |
@joewhite101 Good stuff! |
@joewhite101 Can you please provide the steps necessary to try out your blueprint? I'd like to take a look and try it. Related: I stumbled across https://github.com/eavichay/microfronts today. Seems lean and mean, but also pretty new. |
@mraible if you try microfronts, keep us posted! I, too, found my way to the repo. Unfortunately I haven't had the time to dive into it. |
Microfronts looks a lot like zalandos approach with tailor but done in the frontend, very interesting. Need to find some time to complete the prototype with project Mosaic/tailor |
Hey @mraible, @MathieuAA and @atomfrede, and others, Here are some intro instructions and links. We're also working to keep the READMEs up to date and the generator itself creates a README inside of the generated MFEs. Refer to those as this post ages for more up to date instructions. A quick summary of where we are at now is at the bottom. Some of the work here is related to things we have specifically in flight at Entando but it should be relatively straightforward to disconnect the MFEs for other uses as desired. Run JHipster with the Entando blueprint
Now add entities to the project (make sure you're still linked to the blueprint. Mine gets unlinked for some reason but i seem to be alone on this). You can follow the normal flow for adding entities here. Once difference is that at the conclusion of the entity flow a call to Detailed steps for the entities
At the end you'll be prompted to override a file called Output Running the MFEs Known Issues
|
You can also follow along with our work in progress for our general docs updates here with instructions that are more nicely formatted. The general steps are the same but there is additional focus outside of the MFEs https://es-entando.github.io/build-your-first-app/#entando-blueprint |
@joewhite101 I tried the tutorial today and was able to make everything work. Nice work! A few things I thought of:
I propose we use something like the following to implement micro frontends in JHipster:
The only micro frontends with this setup would be entities that are generated. Since we already have those available at different routes, I think this will work. We might need to do some additional work to figure out how to load a micro frontend into another micro frontend, but I think using segmented-by-route is a good start. @jhipster/developers What do you think? |
@mraible Great points. A few notes and thoughts.
Good idea. We will add this.
I don't remember exactly why we chose create react app but we can take a look at the JHipster CRUD for sure. I'll have to check with my team. Giuseppe or Martynas can you add some more detail here?
This step is where we diverge a bit from the JHipster architecture. We are building a Micro Frontend composition engine for Kubernetes and our objective is to take the SpringBoot service and the MFEs and wire them into our composition engine. And our users can also use an Entando Digital Exchange (marketplace) to deploy the services and MFEs. So rather than embedding them in the gateway we plan to provide builds and steps to deploy them to an Entando app. However, it doesn't look like it would be a huge amount of work to provide different options post generation on how/where somebody wants to deploy and host their MFEs. Could also be useful to use JHipster MFEs to embed in legacy applications via custom elements. Provides a path for JHipster as a way to modernize legacy apps in a modular way. So as long as we design carefully we could have multiple good choices. The Gateway support would be a great area for somebody to join us on the MFE generation journey. We'd help with the blueprint understanding if somebody wants to jump in.
Good idea. We will add the option.
Makes sense to me. I think gateway as a follow on step or integration option makes a lot of sense given the utility of MFEs in different deployments.
We'll review this and can help if the team thinks it is the right way forward. Seems like a good approach. We have some built in identity management assumptions in our environment for the composition layer. But we can look at abstracting so that what you recommend could be the default or an option and give some flexibility on how the MFEs tokens are managed. |
@atomfrede : what is the state of this ticket plz ? |
Sadly I didn't made much progress. But I think Matt tried a different approach which might fit better. |
Yes, I plan on trying the Module Federation that's coming in Webpack 5. https://github.com/module-federation If folks are interested in helping with this effort, I can create tickets with small tasks and assign bounties to them. Here's a high-level plan:
I think we should only target OIDC for now because it'll make authentication into the standalone apps the easiest. If we want JWT support, the stand-alone apps will need their own shell and login UI. |
Hey @mraible, I'd like to help. I'm not a webpack guru but I'm following with great interest all the module federation stuff since a couple of months. I'm working with @joewhite101 at Entando. |
@gidesan Cool! Do you have any feedback on the high-level plan? Are there things I'm missing? |
I started trying to upgrade a microservices architecture with Angular to use Webpack 5. I made progress, but ultimately failed. You can see my PR with changes at mraible/jhipster-microfrontends-angular#1. |
@mraible your high-level plan sounds good to me, but MF is not feature-complete yet, lots of things are being added. Does it make sense to wait for a Webpack 5 RC / final version? |
@gidesan Possibly. However, I think trying to make it work now may give us an opportunity to provide feedback and fixes before everything is final. |
I may try and pick up where @mraible left off. However, i'm the furthest thing from a webpack expert so it will be slow going. If there is a webpack expert out there who wants to take the lead I'm happy to follow. FWIW We're looking at module federation as a pretty key technological update in webpack 5 for micro frontends. Seems like a pretty compelling use case. cc @gidesan |
Commenting to keep open and active. |
Just made cypress to succeed.
|
This issue is stale because it has been open 30 days with no activity. |
Support is almost ready, waiting for angular 12. |
This issue is stale because it has been open 30 days with no activity. |
Keep it open |
@avdev4j : I'd like to know what can be done on generator-jhipster side ? I thought this part was done by Entando blueprint, unless I'm wrong ? |
@pascalgrimaud here are several things here. Entando's blueprint allow the user to generate an MFE app within his entity to deploy it into the Entando platform. It matches well with the Entando way of work and features but not probably with the a most common micro frontend architecture. This is @mshima worked on the Webpack 5 upgrading to be able to use the module federation feature (yes, it comes with Webpack 5) to make the JHipster generated app a micro frontend based application. From my POV, another step would be to be able to directly generate MFE with JHipster as we can do with microservices (aka adding a new applicationType). But for this last thing, I don't really know if it's something some people work on or just an idea in my mind :D. |
@pascalgrimaud We currently generate a monolith UI, which kinda breaks the whole point of microservices. A monolith UI on the gateway means a microservice + gateway needs to be redeployed when there's changes. With microfrontends, only the microservice that's updated needs to be redeployed. |
This issue is stale because it has been open 30 days with no activity. |
The generator part is kind of ready. |
This issue is stale because it has been open 30 days with no activity. |
I'm still interested in this feature.
… On Jun 7, 2021, at 18:55, github-actions[bot] ***@***.***> wrote:
This issue is stale because it has been open 30 days with no activity.
Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted.
We are accepting PRs 😃.
Comment or this will be closed in 7 days
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Rebased the microfrontend branch, and took a while to discover that zone.js needs to be imported as umd. PR created, I will create a series of PRs for minor improvements. i18n is not working correctly for microservices, need to fix lazy loading microservice translations. |
Overview of the feature request
JHipster has a monolith frontend when using microservices. I think it’d be hip if we supported micro frontends too. It probably won’t be easy to implement since the patterns I’ve seen call for serving up the UI on the microservice itself, then including it into a gateway via that URL using SSI, ESI, or h-include.
Motivation for or Use Case
Micro frontends have moved from trial to adopt in ThoughtWorks Radar.
These resources explain some implementation options:
And this is a great podcast on how IKEA has implemented them:
There are a couple of frameworks that aim to simplify micro frontends too:
Once this prototype is complete, I'll open a new issue to create a blueprint or integrate it into JHipster itself.
The text was updated successfully, but these errors were encountered: