,

Vue Micro-Frontends Made Simple

Posted by



HTML tags are an essential part of creating web pages, and when combined with a framework like Vue, they can be used to simplify the development of micro-frontends. Micro-frontends are an architectural approach that allows teams to independently develop and deploy smaller, more focused parts of a larger application. In this article, we will explore how HTML tags can be used to implement simplified micro-frontends in Vue.

One of the advantages of using HTML tags in Vue is that they provide a clear and intuitive way to define components. By encapsulating the HTML tags within custom components, we can easily reuse them across different micro-frontends. This modular approach allows us to break down complex UIs into smaller, manageable pieces, making development and maintenance more efficient.

To illustrate this concept, let’s consider a simple e-commerce application. Suppose we have two micro-frontends: one for displaying the product catalog and another for handling the shopping cart functionality. In each micro-frontend, we can define HTML tags that represent the different components of the application.

For example, in the product catalog micro-frontend, we can define a custom `` component. This component can encapsulate the HTML structure for displaying a single product card, including its image, name, price, and an “Add to Cart” button. By defining this component, we can easily reuse it throughout the product catalog micro-frontend, which makes it easier to maintain and update the UI.

Similarly, in the shopping cart micro-frontend, we can define a custom `` component. This component can represent a single item in the shopping cart, including its image, name, price, and quantity. By encapsulating this HTML structure within a custom component, we can reuse it whenever we need to display a cart item, making our code more modular and reusable.

To use these custom components within the micro-frontends, we can simply include their tags in the HTML code. Vue will automatically render the custom components and handle their lifecycle. For example, in the product catalog micro-frontend, we can include the `` component within a loop to dynamically render all the product cards. In the shopping cart micro-frontend, we can include the `` component within a loop to display the items in the cart.

By leveraging HTML tags and Vue components, we can create simplified micro-frontends that are easier to develop, maintain, and scale. The modular nature of HTML tags allows us to break down complex UIs into smaller, reusable components, making it easier to collaborate and deliver features more rapidly.

In conclusion, HTML tags in Vue provide a powerful mechanism for implementing simplified micro-frontends. By encapsulating HTML structures within custom components, we can easily reuse them across different micro-frontends, making our code more modular and maintainable. This approach enhances productivity and promotes collaboration, enabling teams to build complex web applications with ease.

0 0 votes
Article Rating
20 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Marcos Piemontez
7 months ago

Firstly, forgive my English, I'm Brazilian and I don't know the line.
Would it be possible to demonstrate how we would upload a CI/CD with micro-front-end?
I mean, make a build for a server like "vercel" for example where the two front-ends talk to each other… I would be very grateful!

Mauro Esposito
7 months ago

Thank you for this, Jack! Super clear! Off topic question: which VSCode theme are you using?

Kiran Kothandan
7 months ago

Great video sir❤

Jason Thorpe
7 months ago

2023 update: Valley Growlers is now Valley Public House. Oh, and they're still using an Iframe…

Rattlesnake Renegades
7 months ago

This is incredible, thanks!

Pratik Wadekar
7 months ago

How do I make the host app communicate with the mfe's ? Or even two different mfe's interact with each other ?

S
S
7 months ago

Appreciate it. This video is truly useful. Thanks for sharing!

Qiksar
7 months ago

Absolutely fantastic walkthrough!

Glowie
7 months ago

I still don't get how to do it in production. Do we point the address to the dev server or the production server?

Shivam Gupta
7 months ago

That was awesome, Thanks, man.

David Cueter
7 months ago

your videos and explanations are pretty cool, thank you, you makes it easier for beginners on these subjects, like me

Tolga Kulu
7 months ago

again me sir, how to connect mfe to microservice? (i dont like subdomain for backend such as api.host.com idea) i mean also server side rendering should work so google can work with my site. (i want grpc to frontend and respond from frontend server) i cant find anything sample for this. (i made golang microservices which a service is frontend coded by golang response inertia js vue. now i wanna learn mfe way to do it)

Tolga Kulu
7 months ago

hello, how to create this project scratch from by ourself? what is commands to create it from zero? thank you.

Nicol P
7 months ago

very cool!what would you do if the consumer doesn't know anything about how many micro-frontends are available and where they can be found?it would be nice to see how to handle this, when you have to discover the remotes during runtime.Thank you

Veronica B
7 months ago

Nice video! But why if you update the data into the hv-taplist.json file , is not automatically updating into the page?How can you do this without refreshing the page?Thanks!

Géraud Gratacap
7 months ago

Just a quick question. Is there any way to have the type definition to be exposed by the 'growlers' project ? Defining the types in the consuming app prevents any compilation error in it, and in the case of different teams working each on a remote this could be problematic, as API changes in the store could go unnoticed.

Samuel Weber
7 months ago

At this point you are my favorite content creator by far. Thanks for your awesome work! Best voice aswell!

Michael S
7 months ago

Hi Jack, we use Vue.js at my workplace. Does your book (or will it) have examples and how-to for Vue? Thanks!

Sam Elie
7 months ago

very cool tech
like you say, this is a step up from iframe world. In a way this approach has much more potential to be used for good & cooporation since it requires both parties implementing a common build process; rather than say, throwing some sketchy thing onto your site with no defined way to share info
+1 for vue3 too
great videos

Damian Perez
7 months ago

Bro I have a question, on your store.ts file, in line 46:
" store.filteredTaps = filter();"

What is that line suppose to mean? If you call store.filteredTaps, will it run the filter function?