-
Notifications
You must be signed in to change notification settings - Fork 34
fix(CodeModal): Switch over to lazy loading Monaco #763
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
Conversation
|
Preview: https://chatbot-pr-chatbot-763.surge.sh A11y report: https://chatbot-pr-chatbot-763-a11y.surge.sh |
b4f1316 to
371c5c3
Compare
371c5c3 to
6435445
Compare
|
Just renaming commit to be something compatible with automatic release - no code changes. |
jschuler
left a comment
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.
Looks great apart from a minor comment!
packages/module/package.json
Outdated
| "react": "^18 || ^19", | ||
| "react-dom": "^18 || ^19" | ||
| "react-dom": "^18 || ^19", | ||
| "monaco-editor": "^0.54.0" |
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.
should probably also list @monaco-editor/react here?
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.
All set; thank you!
Red Hat Developer Hub needs a smaller bundle size. They and we are unable to use Webpack plugins directly, so this is a solution that works independently of the Monaco Webpack plugin. Does add a loading state if the third-party dependency needs a moment. Consumers will need to add their own peer dependencies for monaco-editor and @monaco-editor/react.
b7c859d to
4fd320b
Compare
|
🎉 This PR is included in version 6.5.0-prerelease.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Red Hat Developer Hub needs a smaller bundle size. Checking with Karthik to see if lazy loading/peer dep changes work - Backstage doesn't have webpack plugin configuration and neither do we. Backstage uses Webpack under the hood in a non-accessible way, so it may pick this up and reduce the bundle size.
Am interested to know if they can also try using React.lazy/Suspense when loading the Code Modal - it may be that Backstage is able to optimize if that is done, but I am unsure.
Does add a loading state if the third-party dependency needs a moment.
Will also see if Joachim has ideas.