This repository has been archived by the owner on May 15, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* This is the app entry point. It detects the current page | ||
* and renders the corresponding component. | ||
*/ | ||
|
||
import 'babel-polyfill'; | ||
|
||
import renderHome from './components/Home'; | ||
import initDevelopmentHelpers from './initDevelopmentHelpers'; | ||
|
||
// This sets up things that help you during development. | ||
// Feel free to not think about this call. | ||
initDevelopmentHelpers(); | ||
|
||
renderHome(document.querySelector('#root')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70011b0
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 commit splits the app by pages using entry points. Corresponding article section
The idea behind this is as follows. The
/
and the/users/
pages are separate. When a user visits the landing (/
), they don’t need to load the app code. We split the app by entry points to avoid downloading extra bytes.Generated files
Before:
After:
In our case, splitting the code by entry points doesn’t provide a large benefit because the app is small. However, in a larger app, this might have a great effect.