naltatis / micro-frontends-in-action-code

The Tractor Store - sample code from the book Micro Frontends in Action
https://the-tractor.store
MIT License
403 stars 154 forks source link

Great book and a few suggestions #10

Open rajasegar opened 3 years ago

rajasegar commented 3 years ago

Michael, first of all thanks a lot for putting up such a huge effort for the book and the examples here. They are greatly helpful to follow along the book. I am trying the examples one by one and made some observations on why you have written code in such a way by tweaking the code in many different ways and learning from it. Things such as :

const template = product => {
  return `
    <a href="/">&lt; home</a> -
    <a href="/checkout/cart">view cart &gt;</a>
    <h1>${product.name}</h1>
    <img src="https://mi-fr.org/img/${product.img}" width="200">
  `;
};

this.innerHTML = template(product);

These things can be in the form of simple comments within the example code would be of great help. I can create PRs with these documentation comments if possible.

Once again, thanks a lot for the book, it is the goto-guide for micro frontends and I am enjoying each and every line of it, the sections this chapter covers, summary , the graphics and the demo page are all phenomenal, and overall a great learning experience.

naltatis commented 3 years ago

Thanks for the compliments. Love to hear, that you enjoyed reading it.

And yes, adding some explanation to the code to make it easier to to follow is a good idea. I had to walk a walk the fine line of keeping the examples brief, so that they don’t fill too much space, but at the same time I wanted them to be very explicit and not use to much boilerplate or clever tricks that make them hard to follow.

I would be glad to add your comments in the places that Ned more clarity.