-
Notifications
You must be signed in to change notification settings - Fork 46
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
docs: add introduction.md #354
Conversation
also add assets for it
docs/routing/introduction.md
Outdated
|
||
The following describes how this is handled in the ILC, but first let's clear up the terminology: | ||
|
||
- Hard transitions - Transition in which the application on the page is replaced by another one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emphasize the fact that one is when routing is handled via ILC, and another is when routing handled inside the fragment
docs/routing/introduction.md
Outdated
@@ -8,9 +8,9 @@ Since we no longer have one monolithic application that handles all routes, inst | |||
|
|||
The following describes how this is handled in the ILC, but first let's clear up the terminology: | |||
|
|||
- Hard transitions - Transition in which the application on the page is replaced by another one. | |||
- Hard transitions - A transition handled by ILC, with such a transition, the application on the page changes to another one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"A transition handled by ILC"
"A transition handled by ILC routing"
docs/routing/introduction.md
Outdated
|
||
- Soft transitions - A transition that only replaces the content within the app, not the app itself. | ||
- Soft transitions - A transition that is handled inside the application, with such a transition, only the content inside the application changes, but not the application itself. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To have consistent definitions, instead of "A transition that is handled inside the application" I would use "A transition handled by own routing of some fragment at the page.
And ", but not the application itself" confuses me, so let's remove it.
docs/routing/introduction.md
Outdated
|
||
Now, let's talk a little about the theory, after which we will move on to practical examples: | ||
|
||
In ILC, we can use one HTML template for all of our applications. With this approach, SSR occurs once when the page is first loaded, then all navigation occurs through CSR. So let's look at navigation in more detail: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"we can use one HTML template" - no, we use always one template, and we don't have the capability to change it. Please correct this sentence.
docs/routing/introduction.md
Outdated
For clarity, here is the routing table: | ||
![Routing table](../assets/routes/route.png) | ||
|
||
Let's go to the `/people/` route, it will be a `hard transitions` because we render a new application on the `/people/*` route. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in your example it's not a hard transition, it's just SSR. it can confuse people.
you should say something like "for example, we are at /plants page and want to open '/people' page. in this case we have hard transition".
correct and rephrase this sentense.
also add asset
docs/routing/introduction.md
Outdated
|
||
![Introdaction demo](../assets/routes/introduction-demo.png) | ||
|
||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like unnecessary markup
docs/routing/introduction.md
Outdated
|
||
The following describes how this is handled in the ILC, but first let's clear up the terminology: | ||
|
||
- Hard transitions - A transition handled by ILC routing, with such a transition, the application on the page changes to another one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Manning book "Hard transitions" are the ones that cause full page reload. And I think it's counterintuitive to change the meaning of the statement here. As you still need somehow to call transitions with full page reload.
Also you've missed the whole explanation of the App Shell concept (which is basically what ILC does). As well as at least basic explanation of how ILC actually turns hard transitions into "soft ones" by intercepting one events and re-emitting the others....
Another point: there is a nice visualization of Two-level routing (Figure 7.7) in the book. Would be nice to also have it here with all related theory behind it.
Pls add:
|
docs/routing/introduction.md
Outdated
|
||
The following describes how this is handled in the ILC, but first let's dive a little into the general theory of the micro frontend routing and clear up the terminology: | ||
|
||
- Hard navigation describes a page transition where the browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Hard navigation describes a page transition where the browser | |
- **Hard navigation** - describes a page transition where the browser |
docs/routing/introduction.md
Outdated
- Hard navigation describes a page transition where the browser | ||
loads the complete HTML for the next page from the server. | ||
|
||
- Soft navigation refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Soft navigation refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this | |
- **Soft navigation** - refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this |
docs/routing/introduction.md
Outdated
- Soft navigation refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this | ||
scenario the client fetches its data via an API from the server. | ||
|
||
So, we have several approaches to implement navigation, the image below shows two of them: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, we have several approaches to implement navigation, the image below shows two of them: | |
Generally, we have several approaches to implement navigation, the image below shows two most popular of them: |
docs/routing/introduction.md
Outdated
|
||
![Introdaction demo](../assets/routes/introduction-demo.png) | ||
|
||
At ILC, we use a third approach called Unified SPA*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At ILC, we use a third approach called Unified SPA*. | |
In ILC, we use third approach called **Unified SPA**. |
docs/routing/introduction.md
Outdated
![Introdaction demo](../assets/routes/introduction-demo.png) | ||
|
||
At ILC, we use a third approach called Unified SPA*. | ||
ILC will appear in it as an application shell, it's job is to map URLs to the correct team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is meaningless...
docs/routing/introduction.md
Outdated
At ILC, we use a third approach called Unified SPA*. | ||
ILC will appear in it as an application shell, it's job is to map URLs to the correct team. | ||
|
||
* The Unified SPA (Single Page Application) approach introduces a central application container. It handles page transitions between the teams. Here all navigations are soft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless bulletpoint... Why are you making lists which contain 1 item only?
docs/routing/introduction.md
Outdated
|
||
Now more detail about ILC: | ||
|
||
In ILC, we can use one HTML template for all of our applications. With this approach, SSR occurs once when the page is first loaded, then all navigation occurs through CSR. In addition to the fact that all navigation inside the ILC is soft, it also uses "2-tiered routing". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSR is an optional thing in ILC. Also it has nothing to do with routing
docs/routing/introduction.md
Outdated
In ILC, we can use one HTML template for all of our applications. With this approach, SSR occurs once when the page is first loaded, then all navigation occurs through CSR. In addition to the fact that all navigation inside the ILC is soft, it also uses "2-tiered routing". | ||
ILC looks at the first part of the URL to determine which team is responsible (top-level routing). The router of the matched team processes the complete URL to find the correct page inside its single-page application (second-level routing). | ||
|
||
- top-level routing - A transition handled by ILC routing, with such a transition, the application on the page changes to another one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's 100% wrong definition
docs/routing/introduction.md
Outdated
|
||
In ILC, we can use one HTML template for all of our applications. With this approach, initial page loading occurs only once when the page is first time loaded, then all navigation occurs through CSR. In addition to the fact that all navigation inside the ILC is soft, it also uses **2-tiered routing**. | ||
|
||
Unlike the **flat routing** approach, where we would have to specify in the ILC the full route to every page of all our applications, with a **2-tiered routing** approach, we just need to specify in the ILC route to the application. All navigation within the application can be implemented by each developer team using the native tools of their application (like react-router, vue-router etc.). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unlike the flat routing approach, where we would have to specify in the ILC the full route to every page of all our applications, with a 2-tiered routing approach, we just need to specify in the ILC route to the application.
This statement doesn't make any sense to me....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls rephrase
docs/routing/introduction.md
Outdated
# Introduction | ||
|
||
Most JavaScript frameworks come with a dedicated routing solution | ||
like `angular/router` or `vue-router`. They make it possible to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
like `angular/router` or `vue-router`. They make it possible to | |
like `angular/router` or `vue-router`. They allow you to |
docs/routing/introduction.md
Outdated
navigate through different pages of an application without having to | ||
do a full page refresh on every link click. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navigate through different pages of an application without having to | |
do a full page refresh on every link click. | |
navigate through pages of an application without a full page refresh on every click. |
docs/routing/introduction.md
Outdated
like `angular/router` or `vue-router`. They make it possible to | ||
navigate through different pages of an application without having to | ||
do a full page refresh on every link click. | ||
Since we no longer have one monolithic application that handles all routes, instead we have several independent applications, we need to solve an important issue, namely routing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Who are 'we'?
- Is it necessary to talk about monolith at all?
I would just indicate the current state and why the routing issue still exists in the current state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update:
Problem statement
When you have a monolithic application, it handles all the routes on its own. When there are two or more applications, they also handle all their routes independently. Since, by default, one independent application know nothing about routes and pages of other independent application. This gives you a problem to solve - a routing issue.
docs/routing/introduction.md
Outdated
do a full page refresh on every link click. | ||
Since we no longer have one monolithic application that handles all routes, instead we have several independent applications, we need to solve an important issue, namely routing. | ||
|
||
The following describes how this is handled in the ILC, but first let's dive a little into the general theory of the micro frontend routing and clear up the terminology: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following describes how this is handled in the ILC, but first let's dive a little into the general theory of the micro frontend routing and clear up the terminology: | |
Before proceeding with details on how the issue is handled by ILC, get familiar with the basics of routing in the micro-frontends and terminology: |
docs/routing/introduction.md
Outdated
- **Soft navigation** refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this | ||
scenario the client fetches its data via an API from the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- **Soft navigation** refers to a page transition that’s entirely clientside rendered, typically by using a client-side router. In this | |
scenario the client fetches its data via an API from the server. | |
- **Soft navigation** describes a page transition that is rendered entirely on the client-side, typically by using a client-side router. In this scenario, the client fetches data from the server via API. |
docs/routing/introduction.md
Outdated
|
||
Within the application, we can use our native tools (for example `<Link>` in `React router`) to navigate between pages within the application, and `global link` - it's just <a>, tags to navigate between applications. | ||
|
||
As mentioned before, transition between applications in ILC occurs thanks to the `<a>` tags. To do this, ILC keeps track of all `<a>` tags on the page and handles clicking on them, provided that: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned before, transition between applications in ILC occurs thanks to the `<a>` tags. To do this, ILC keeps track of all `<a>` tags on the page and handles clicking on them, provided that: | |
In ILC, as mentioned before, the transition between applications occurs via the `<a>` tags. To do this, ILC keeps track of all `<a>` tags on the page and handles clicks on them, provided that: |
docs/routing/introduction.md
Outdated
1. tag contains non-empty `href`. | ||
2. `event.PreventDefault` not equal `false` | ||
3. `target` not equal `_self` | ||
4. This is not a special url (`mailto`, `tel`, etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. tag contains non-empty `href`. | |
2. `event.PreventDefault` not equal `false` | |
3. `target` not equal `_self` | |
4. This is not a special url (`mailto`, `tel`, etc.) | |
1. Tag contains a non-empty `href`. | |
1. `event.PreventDefault` does not equal `false`. | |
1. `target`does not equal `_self`. | |
1. This is not a special url (`mailto`, `tel`, etc). |
docs/routing/introduction.md
Outdated
3. `target` not equal `_self` | ||
4. This is not a special url (`mailto`, `tel`, etc.) | ||
|
||
Otherwise, the ILC does not take any part in processing the click on the link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, the ILC does not take any part in processing the click on the link. | |
If one of the above points is not met, ILC ignores the processing of the clicks on the link. |
docs/routing/introduction.md
Outdated
|
||
Otherwise, the ILC does not take any part in processing the click on the link. | ||
|
||
Now let's recap: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now let's recap: | |
Conclusion |
docs/routing/introduction.md
Outdated
Otherwise, the ILC does not take any part in processing the click on the link. | ||
|
||
Now let's recap: | ||
ILC acts as an wrapper for other applications, making all our transitions soft. In addition, we use two-level routing, so that each team can configure routing inside their application as they like, in ILC, you only need to specify the path to the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ILC acts as an wrapper for other applications, making all our transitions soft. In addition, we use two-level routing, so that each team can configure routing inside their application as they like, in ILC, you only need to specify the path to the application. | |
ILC acts as a wrapper for other applications making all the transitions soft. Furthermore, it uses two-level routing so that teams can configure routing inside their application as they need to, whereas, in ILC, you only need to specify the path to the application. |
You can use native tools (for example `<Link>` in `React router`) to navigate between pages within the application, and `global link` - a link (`<a>` tag) to navigate between applications. | ||
|
||
In ILC, as mentioned before, the transition between applications occurs via the `<a>` tags. To do this, ILC keeps track of all `<a>` tags on the page and handles clicks on them, provided that: | ||
1. Tag contains a non-empty `href`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent a list with a blank line
If one of the above points is not met, ILC ignores the processing of the clicks on the link. | ||
|
||
### Conclusion | ||
ILC acts as a wrapper for other applications making all the transitions soft. Furthermore, it uses two-level routing so that teams can configure routing inside their application as they need to, whereas, in ILC, you only need to specify the path to the application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent a heading with a blank line
Most JavaScript frameworks come with a dedicated routing solution like `angular/router` or `vue-router`. | ||
They allow you to navigate through pages of an application without a full page refresh on every click. | ||
When you have a monolithic application, it handles all the routes on its own. When there are two or more applications, they also handle all their routes independently. Since, by default, one independent application know nothing about routes and pages of other independent application. This gives you a problem to solve - a routing issue. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Routing basics | |
Most JavaScript frameworks come with a dedicated routing solution like `angular/router` or `vue-router`. | ||
They allow you to navigate through pages of an application without a full page refresh on every click. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this under the introduction
No description provided.