Skip to content
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

Merged
merged 15 commits into from
Feb 4, 2022
Merged

Conversation

DammneD
Copy link
Contributor

@DammneD DammneD commented Jan 21, 2022

No description provided.

also add assets for it

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.
Copy link
Contributor

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

@@ -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.
Copy link
Contributor

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"


- 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.
Copy link
Contributor

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.


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:
Copy link
Contributor

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.

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.
Copy link
Contributor

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.


![Introdaction demo](../assets/routes/introduction-demo.png)

#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like unnecessary markup


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.
Copy link
Contributor

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.

@StyleT
Copy link
Contributor

StyleT commented Jan 25, 2022

Pls add:

  • Flat vs 2-tiered routing
  • Why ILC sticks to 2-tiered routing
  • Links within applications: Link vs GlobalLink


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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Hard navigation describes a page transition where the browser
- **Hard navigation** - describes a page transition where the browser

- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- 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

- 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:


![Introdaction demo](../assets/routes/introduction-demo.png)

At ILC, we use a third approach called Unified SPA*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
At ILC, we use a third approach called Unified SPA*.
In ILC, we use third approach called **Unified SPA**.

![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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is meaningless...

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.
Copy link
Contributor

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?


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".
Copy link
Contributor

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

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.
Copy link
Contributor

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


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.).
Copy link
Contributor

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....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls rephrase

@bandantonio bandantonio added the documentation Improvements or additions to documentation label Feb 1, 2022
@bandantonio
Copy link
Contributor

@DammneD Please pay super close attention to formatting - it seems like every single line starts with a space. Remove them completely like you did in the PR #355

# Introduction

Most JavaScript frameworks come with a dedicated routing solution
like `angular/router` or `vue-router`. They make it possible to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
like `angular/router` or `vue-router`. They make it possible to
like `angular/router` or `vue-router`. They allow you to

Comment on lines 5 to 6
navigate through different pages of an application without having to
do a full page refresh on every link click.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Who are 'we'?
  2. 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

Copy link
Contributor

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.

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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Comment on lines 14 to 15
- **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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **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.


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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Comment on lines 43 to 46
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.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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).

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.


Otherwise, the ILC does not take any part in processing the click on the link.

Now let's recap:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Now let's recap:
Conclusion

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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`.
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Routing basics

Comment on lines +5 to +6
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.
Copy link
Contributor

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

@StyleT StyleT merged commit f1ec6df into namecheap:master Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants