You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lift and shift the discussion block's code from edx-platform to xblocks contrib repo #451
Course level discussion tab is django view and discussion xblock is load from xmodule both uses same java script files which bundle up with django pipelines.
Course level discussion tab load it with method in view.py
Discussion xblock loads it with methods in xblock_utils
Team discussion and thoughts:
We discussed about the bundling of js files for discussion xblock in edx-platform either we should use the webpack or django pipeline, Right now the platform using django pipeline to bundle the files so we decided to follow the same architecture to minimize the efforts.
Problem Statement:
As part of the discussion block extraction, we need to move all JavaScript files to the xblocks-contrib repository. Currently, these files are bundled via the Django pipeline in edx-platform and are used by both the XBlock and the discussion Django view. The settings point all paths to the common static folder.
If I update these paths directly to reference xblocks-contrib, the course-level Discussion tab (the Django view) would also become dependent on xblocks-contrib, which is not desired.
To avoid this, I introduced a separate pipeline specifically for the extracted discussion block. This pipeline is responsible for loading JavaScript files (or bundled assets in production) from the xblocks-contrib repository, while the course-level Discussion tab (Django view) continues to function exactly as before, using its existing pipeline configuration.
There is a draft PR for this solution: openedx/openedx-platform#37841
Note: Right now the PR is using the local path as this is testing draft PR but i believe in actual it will load the path from package resource as the xblocks-contrib is installing as a package in edx-platform.
As per discussion in the meeting we decided to not go with this implementation of django pipeline openedx/openedx-platform#37841 as this creates circular dependency between edx-platform and xblocks-contrib.
I am facing some difficulty in using webpack.
as per my understanding
The js code using for discussion is classic ES5 JavaScript using an IIFE (Immediately Invoked Function Expression) with Backbone.js, jQuery, and global references.(Ref file)
Webpack does support classic ES5 + IIFE code, but it changes the execution context, which breaks legacy code that assumes this === window and globals exist implicitly.
Right now i have extracted all files in xblocks-contrib PR and using them directly instead of bundled files. I am creating separate ticket(Ref) to look it up in detail so that i can complete the scope of this ticket's work.
All the files including (JS, CSS and python) have been moved to xblocks-contrib repo under the scope of this ticket and the PR has created.
PR: openedx/xblocks-core#134
Right now i am using all JS files directly instead of bundled files. I have creating separate ticket(#480) to look it up in detail.
I am closing this ticket as the scope of this task has been completed and i will do other subtasks on the base of this PR.
Thanks for the updates @salman2013 . Can you confirm that we will be removing the legacy view of the course discussion tab (mentioned here) and thus do not need to factor that into the strategy for this extraction?
@kdmccormick Yes, we will remove the legacy course-level discussion tab and will not refactor any code within it, as outlined in [DEPR]: Non-MFE course tab interface for discussions.
At this time, there is no direct blocker or dependency between this removal and the discussion block extraction. Therefore, the team has decided to defer this work and address it after the extraction effort is complete.
Activity
farhan commentedon Dec 24, 2025
On the way we will decide either to adopt webpack or django pipeline
salman2013 commentedon Jan 7, 2026
Course Level discussion tab:
Discussion xblock:
Implementation in platform
Course level discussion tab is django view and discussion xblock is load from xmodule both uses same java script files which bundle up with django pipelines.
Course level discussion tab load it with method in view.py
Discussion xblock loads it with methods in xblock_utils
Team discussion and thoughts:
We discussed about the bundling of js files for discussion xblock in edx-platform either we should use the webpack or django pipeline, Right now the platform using django pipeline to bundle the files so we decided to follow the same architecture to minimize the efforts.
Problem Statement:
As part of the discussion block extraction, we need to move all JavaScript files to the xblocks-contrib repository. Currently, these files are bundled via the Django pipeline in edx-platform and are used by both the XBlock and the discussion Django view. The settings point all paths to the common static folder.
If I update these paths directly to reference xblocks-contrib, the course-level Discussion tab (the Django view) would also become dependent on xblocks-contrib, which is not desired.
To avoid this, I introduced a separate pipeline specifically for the extracted discussion block. This pipeline is responsible for loading JavaScript files (or bundled assets in production) from the xblocks-contrib repository, while the course-level Discussion tab (Django view) continues to function exactly as before, using its existing pipeline configuration.
There is a draft PR for this solution: openedx/openedx-platform#37841
Note: Right now the PR is using the local path as this is testing draft PR but i believe in actual it will load the path from package resource as the xblocks-contrib is installing as a package in edx-platform.
salman2013 commentedon Jan 7, 2026
@feanil @kdmccormick Please share your thoughts and feedback on this.
#451 (comment)
salman2013 commentedon Jan 12, 2026
As per discussion in the meeting we decided to not go with this implementation of django pipeline openedx/openedx-platform#37841 as this creates circular dependency between edx-platform and xblocks-contrib.
We decided to bundle up files with webpack
salman2013 commentedon Jan 12, 2026
I am facing some difficulty in using webpack.
as per my understanding
The js code using for discussion is classic ES5 JavaScript using an IIFE (Immediately Invoked Function Expression) with Backbone.js, jQuery, and global references.(Ref file)
Webpack does support classic ES5 + IIFE code, but it changes the execution context, which breaks legacy code that assumes
this === windowand globals exist implicitly.Right now i have extracted all files in xblocks-contrib PR and using them directly instead of bundled files. I am creating separate ticket(Ref) to look it up in detail so that i can complete the scope of this ticket's work.
salman2013 commentedon Jan 20, 2026
All the files including (JS, CSS and python) have been moved to xblocks-contrib repo under the scope of this ticket and the PR has created.
PR: openedx/xblocks-core#134
Right now i am using all JS files directly instead of bundled files. I have creating separate ticket(#480) to look it up in detail.
I am closing this ticket as the scope of this task has been completed and i will do other subtasks on the base of this PR.
kdmccormick commentedon Jan 22, 2026
Thanks for the updates @salman2013 . Can you confirm that we will be removing the legacy view of the course discussion tab (mentioned here) and thus do not need to factor that into the strategy for this extraction?
salman2013 commentedon Jan 23, 2026
@kdmccormick Yes, we will remove the legacy course-level discussion tab and will not refactor any code within it, as outlined in [DEPR]: Non-MFE course tab interface for discussions.
At this time, there is no direct blocker or dependency between this removal and the discussion block extraction. Therefore, the team has decided to defer this work and address it after the extraction effort is complete.