-
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
Changes from 4 commits
37e53d4
2d1b2a9
127d14d
7f4562e
bbb009b
33ddc9d
7271fd1
9ea44fc
a147916
63bf802
3e7501e
0e25598
d5bb06f
fc97bde
1735b21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||||||
# Introduction | ||||||||||
|
||||||||||
Most JavaScript frameworks come with a dedicated routing solution | ||||||||||
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. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
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 commentThe reason will be displayed to describe this comment to others. Learn more. Update: Problem statementWhen 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. |
||||||||||
|
||||||||||
The following describes how this is handled in the ILC, but first let's clear up the terminology: | ||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
- 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 commentThe 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. |
||||||||||
|
||||||||||
- Soft transitions - A transition handled by own routing of some application at the page, with such a transition, only the content inside the application changes. | ||||||||||
|
||||||||||
![Introdaction demo](../assets/routes/introduction-demo.png) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
# | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Looks like unnecessary markup |
||||||||||
|
||||||||||
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 commentThe 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. | ||||||||||
|
||||||||||
![Navigation example](../assets/routes/navigation-example.png) | ||||||||||
|
||||||||||
Now let's pick someone from the list: | ||||||||||
|
||||||||||
![Navigation example](../assets/routes/navigation-example2.png) | ||||||||||
|
||||||||||
Now our route looks like this: `/people/?selected=4/`, this time it's a `soft transition` because `/?selected=4/` is navigation within the app. | ||||||||||
|
||||||||||
Now let's recap: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
Due to the fact that we use one HTML template for all pages, SSR occurs only once, then all navigation happens with the help of CSR and uses both hard and soft transitions, depending on the situation. |
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.