openedx / openedx/frontend-app-learning

Don't include Learning Assistant in the bundle

Open
#1,482 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

business-specific code health
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 :

  1. It's peerDependencies are overly specified. For example, it shouldn't pin redux to the exact version 4.1.2 as that blocks us from bumping the version in frontend-app-learning. Specifying ^4 or ^4.1 is fine.
  2. 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.
  3. 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.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.