-
Notifications
You must be signed in to change notification settings - Fork 36
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
DOP-4208: lazy load OpenAPI component #975
Conversation
import React, { lazy } from 'react'; | ||
|
||
const ComponentMap = { | ||
openapi: lazy(() => import('./OpenAPI')), |
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.
I included a few other components that should obviously be lazy loaded
If any objections, could revert this change to track the changes in separate ticket
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.
I think this is a good set of components to lazy load together
|
||
const ComponentMap = { | ||
openapi: lazy(() => import('./OpenAPI')), | ||
video: lazy(() => import('./Video')), |
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.
example of video being lazy loaded on this page:
const ComponentMap = { | ||
openapi: lazy(() => import('./OpenAPI')), | ||
video: lazy(() => import('./Video')), | ||
instruqt: lazy(() => import('./Instruqt')), |
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.
instruqt seems to be getting redirected to a login page for both staging on master and test branches:
https://docs-mongodbcom-staging.corp.mongodb.com/master/docs/seung.park/master/tutorial/getting-started/
import React, { lazy } from 'react'; | ||
|
||
const ComponentMap = { | ||
openapi: lazy(() => import('./OpenAPI')), |
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.
I think this is a good set of components to lazy load together
Stories/Links:
DOP-4208
This PR is focused on reducing app bundle size by lazy loading OpenAPI component (which uses redoc as a dependency), as it is used as a single page component (for testing https://mongodb.com/docs/openapi/preview )
Current Behavior:
staged a couple on the same CDN to compare master branch vs test branch:
docs landing
open api preview page on docs landing
cloud docs
docs
Staging Links:
docs landing
openAPI preview page on docs landing
cloud docs
docs
Notes:
vs app bundle size on master
as well as bundle
b19b3968-67eaf58023f606c6395f.js
not being present in test branch (for redoc package)