-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
chore(rebuild): improve static html utilization #2108
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
chore(rebuild): improve static html utilization #2108
Conversation
This change delays the dynamic part of app from mounting until the first page's content has loaded. This prevents the static content from being stripped from the DOM until dynamic bundle is there to replace it. Once we migrate to `remark-react`, the elements won't even be re-mounted as React's diffing algorithm will be used. All other pages are still loaded using dynamic `import()`s.
src/utilities/content-utils.js
Outdated
* @return {array} - All markdown descendants of the given `tree` | ||
*/ | ||
export const ExtractPages = tree => { | ||
return FlattenContent(tree).filter(item => { |
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.
item => item.extension === '.md'
src/utilities/content-utils.js
Outdated
* @return {array} - Immediate children of the given `tree` that are directories | ||
*/ | ||
export const ExtractSections = tree => { | ||
return tree.children.filter(item => ( |
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.
item => item.type === 'directory'
Looks good, would need to clone and check locally though, still trying to get some time to do that this weekend 👍 |
Just checked locally and it works like a charm, great work @skipjack. I think this is a big step towards the direction we are heading. Are we keeping the TODO up to date? |
This is an addition to #2074 that addresses some core issues with how entry content is loaded. The changes contained here accomplish the following...
render
call.Site
component for use elsewhere in the site.