Skip to content
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

build: restructure "vendor" directories to improve build #32835

Closed

Commits on Aug 31, 2023

  1. Configuration menu
    Copy the full SHA
    5315d8f View commit details
    Browse the repository at this point in the history
  2. build: lms/static/css/vendor/* -> common/static/css/vendor

    Sass compilation includes the LMS's "vendored-in" CSS libraries at
    lms/static/css/vendor as a source, and output CSS is written to the
    parent directory, lms/static/css. This violates the constraint that
    source directories cannot be written to while they are bind-mounted.
    
    To resolve the issue, we merge the contents of lms/static/css/vendor
    into common/static/css/vendor. (The directory common/static/css only
    contains sources: no CSS is outputted there.)
    
    Now, common/static/css only contains sources for the Sass build, and
    lms/static/css is only used for output.
    
    More details: openedx#32835
    Part of: https://github.com/openedx/wg-developer-experience/issues/166
    kdmccormick committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e6b40b1 View commit details
    Browse the repository at this point in the history
  3. build: common/static/common/[js|css]/vendor -> common/static/node_cop…

    …ies/[js|css]
    
    To support our old RequireJS-based frontends, a post-install hook on npm
    clean-install copies certain JS & CSS modules into
    common/static/common/[js|css]/vendor. However, the copied modules'
    ancestor directory, common/static/common, is a source for the Webpack
    build that we need to bind-mount. This violates the constraint that we
    must not bind-mount items that were previously modified by the build.
    
    To resolve the issue, we relocate common/static/common/[js|css]/vendor
    to new directories, common/static/node_copies/[js|css]. We provide a
    symlink from the original location to a new location.
    
    Now, common/static/common and common/static/node_copies can both be used
    as inputs to the Webpack build, but the latter will not be clobbered
    when we bind-mount the former. Furthermore, the new directory name
    ("node_copies") is more illustrative than the old one ("vendor").
    
    (Note: I originally attempted to make this change without the symlink--I
    updated all references to the old path to the new path. I struggled for
    several hours to get tests passing for JS using RequireJS, and concluded
    that I don't understand our RequireJS setup well enough to safely make
    that change.)
    
    More details: openedx#32835
    Part of: https://github.com/openedx/wg-developer-experience/issues/166
    kdmccormick committed Aug 31, 2023
    Configuration menu
    Copy the full SHA
    8ec506c View commit details
    Browse the repository at this point in the history