-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[2/3] build: include built-in XBlock JS directly rather than copying it #32480
Merged
kdmccormick
merged 1 commit into
openedx:master
from
kdmccormick:kdmccormick/xmodule-js-no-copy
Jul 26, 2023
Merged
[2/3] build: include built-in XBlock JS directly rather than copying it #32480
kdmccormick
merged 1 commit into
openedx:master
from
kdmccormick:kdmccormick/xmodule-js-no-copy
Jul 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kdmccormick
changed the title
build: commit XModule SCSS entrypoints of generating them
build: include XModule JS directly rather than copying it
Jun 15, 2023
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
6 times, most recently
from
June 21, 2023 17:31
fc8ae8c
to
284ce1d
Compare
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 7, 2023 17:52
284ce1d
to
a208e8e
Compare
kdmccormick
changed the title
build: include XModule JS directly rather than copying it
[2] build: include XModule JS directly rather than copying it
Jul 7, 2023
kdmccormick
changed the title
[2] build: include XModule JS directly rather than copying it
[2/3] build: include XModule JS directly rather than copying it
Jul 7, 2023
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 7, 2023 18:23
a208e8e
to
f9fda6a
Compare
This was referenced Jul 7, 2023
kdmccormick
changed the title
[2/3] build: include XModule JS directly rather than copying it
[2/3] build: include built-in XBlock JS directly rather than copying it
Jul 7, 2023
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
3 times, most recently
from
July 7, 2023 18:57
66216d6
to
5391623
Compare
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 10, 2023 21:27
5391623
to
5c867ed
Compare
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
4 times, most recently
from
July 21, 2023 02:40
ead1eef
to
b99b7b1
Compare
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 24, 2023 21:14
b99b7b1
to
8cb61df
Compare
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 25, 2023 15:03
8cb61df
to
2cdee1c
Compare
feanil
approved these changes
Jul 25, 2023
TODO: will copy in commit message from PR when squash merging Part of: openedx#32481
kdmccormick
force-pushed
the
kdmccormick/xmodule-js-no-copy
branch
from
July 26, 2023 13:06
2cdee1c
to
e87b57d
Compare
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
kdmccormick
added a commit
to kdmccormick/edx-platform
that referenced
this pull request
Jul 27, 2023
The Webpack configuration file for built-in XBlock JS used to be generated at build time and git-ignored. It lived at common/static/xmodule/webpack.xmodule.config.js. It was generated because the JS that it referred to was also generated at build-time, and the filenames of those JS modules were not static. Now that its contents have been made entirely static [1], there is no reason we need to continue generating this Webpack configuration file. So, we check it into edx-platform under the name ./webpack.builtinblocks.config.js. We choose to put it in the repo's root directory because the paths contained in the config file are relative to the repo's root. This allows us to behead both the xmodule/static_content.py (`xmodule_assets`) script andthe `process_xmodule_assets` paver task, a major step in removing the need for Python in the edx-platform asset build [2]. It also allows us to delete the `HTMLSnippet` class and all associated attributes, which were exclusively used by xmodule/static_content.py.. We leave `xmodule_assets` and `process_xmodule_assets` in as stubs for now in order to avoid breaking external code (like Tutor) which calls Paver; the entire pavelib/assets.py function will be eventually removed soon anyway [3]. Further, to avoid extraneous refactoring, we keep one method of `HTMLSnippet` around on a few of its former subclasses: `get_html`. This method was originally part of the XModule framework; now, it is left over on a few classes as a simple internal helper method. References: 1. openedx#32480 2. openedx#31800 3. openedx#31895 Part of: openedx#32481
kdmccormick
added a commit
that referenced
this pull request
Jul 27, 2023
…ts` (#32685) The Webpack configuration file for built-in XBlock JS used to be generated at build time and git-ignored. It lived at common/static/xmodule/webpack.xmodule.config.js. It was generated because the JS that it referred to was also generated at build-time, and the filenames of those JS modules were not static. Now that its contents have been made entirely static [1], there is no reason we need to continue generating this Webpack configuration file. So, we check it into edx-platform under the name ./webpack.builtinblocks.config.js. We choose to put it in the repo's root directory because the paths contained in the config file are relative to the repo's root. This allows us to behead both the xmodule/static_content.py (`xmodule_assets`) script andthe `process_xmodule_assets` paver task, a major step in removing the need for Python in the edx-platform asset build [2]. It also allows us to delete the `HTMLSnippet` class and all associated attributes, which were exclusively used by xmodule/static_content.py.. We leave `xmodule_assets` and `process_xmodule_assets` in as stubs for now in order to avoid breaking external code (like Tutor) which calls Paver; the entire pavelib/assets.py function will be eventually removed soon anyway [3]. Further, to avoid extraneous refactoring, we keep one method of `HTMLSnippet` around on a few of its former subclasses: `get_html`. This method was originally part of the XModule framework; now, it is left over on a few classes as a simple internal helper method. References: 1. #32480 2. #31800 3. #31895 Part of: #32481
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of a series of PRs:
The previous one is:
The next one is:
xmodule_assets
#32685To review this PR, look at just the latest commit (the one matching the PR title).
Description and supporting info
As part of the static asset build, JS modules for most built-in XBlocks were unnecessarily copied from the original locations (under xmodule/js and common/static/js) to a git-ignored location (under common/static/xmodule), and then included into the Webpack builld via common/static/xmodule/webpack.xmodule.config.js.
With this commit, we stop copying the JS modules. Instead, we have common/static/xmodule/webpack.xmodule.config.js just reference the original source under xmodule/js and common/static/js.
This lets us us radically simplify the xmodule/static_content.py build script. It also sets the stage for the next change, in which we will check webpack.xmodule.config.js into the repository, and delete xmodule/static_content.py entirely.
common/static/xmodule/webpack.xmodule.config.js before:
common/static/xmodule/webpack.xmodule.config.js after:
Testing
I recommend building assets with this branch and smoke-testing the built-in XBlocks.
You can build assets and start the platform with Tutor Nightly:
or do it standalone (I haven't tried this):
Go into the demo course and try out a few built-in XBlocks. Affected XBlocks include: