openedx / openedx/frontend-app-learning
Don't include Learning Assistant in the bundle
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 70
- Forks
- 335
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 35
Description
To reduce the bundle size for everyone, we need to make a few fixes to https://github.com/edx/frontend-lib-learning-assistant :
- It's
peerDependenciesare overly specified. For example, it shouldn't pinreduxto the exact version4.1.2as that blocks us from bumping the version infrontend-app-learning. Specifying^4or^4.1is fine. - It should not be part of frontend-app-learning's redux store. Instead it should have its own store and its own
<Provider>. Or better yet, don't use redux at all. - The
<Xpert>component inside<Chat>should use React.lazy so that the learning-assistant code is only loaded on demand, and not always bundled into the main learning MFE app bundle. - Optional: It should be a plugin using frontend-plugin-framework, and not even mentioned in the code at all.
Numbers 2 and 3 are the main thing I'd like to achieve here, as having both of those will result in a bundle size reduction.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/store.js and src/courseware/course/chat/Chat.jsx, especially the Learning Assistant store entry and the Xpert component usage. Review the linked Learning Assistant package.json peerDependencies as context. Done means the assistant is isolated from the app store and loaded on demand so it is no longer included in the main bundle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100