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 :
-
In 14_client_side_two_level_routing example in the app shell code here
The order of the route entry mappings is important such that the resolving is happening properly by putting the / path as the last entry.
-
In the same chapter, we need to set the appHistoryinstance in the window object so that they can be accessed outside in the respective team-* pages components
|
window.appHistory = window.History.createBrowserHistory(); |
-
In the same chapter we can reuse the template function from the previous example in the following way instead of in-lining it.
const template = product => {
return `
<a href="/">< home</a> -
<a href="/checkout/cart">view cart ></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.
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 :
In
14_client_side_two_level_routingexample in the app shell code heremicro-frontends-in-action-code/14_client_side_two_level_routing/app-shell/index.html
Line 19 in 31b23dc
The order of the route entry mappings is important such that the resolving is happening properly by putting the / path as the last entry.
In the same chapter, we need to set the
appHistoryinstance in the window object so that they can be accessed outside in the respective team-* pages componentsmicro-frontends-in-action-code/14_client_side_two_level_routing/app-shell/index.html
Line 46 in 31b23dc
In the same chapter we can reuse the
templatefunction from the previous example in the following way instead of in-lining it.micro-frontends-in-action-code/14_client_side_two_level_routing/team-decide/pages.js
Line 19 in 31b23dc
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.