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

[5/6] build: commit XModule SCSS entrypoints instead of generating them #32290

Merged

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented May 23, 2023

Supporting information

This is a part of a series of PRs:

The previous PR is:

The next PR is:

Description

xmodule_assets generated a series of SCSS "entrypoint"
files, where each entrypoint file imported from the
SCSS "sources" in xmodule/css.

This process was more complicated up until very
recently; for context, make sure you've seen:

Now that the process is simpler, though, there
is no reason to generated the SCSS entrypoints;
we can just commit them to the repository instead!
So, we go from this:

# GENERATED: SCSS entrypoints files for CMS
common/static/xmodule/descriptors:  
   AboutBlockStudio.scss
   AnnotatableBlockStudio.scss
   ConditionalBlockStudio.scss
   ...
# GENERATED: SCSS entrypoints files for LMS
common/static/xmodule/modules:  
   AboutBlockPreview.scss
   AnnotatableBlockPreview.scss
   ConditionalBlockPreview.scss
   ...
# VERSION CONTROLLED: SCSS source files
xmodule/css:                
  annotatable/...
  capa/...
  ... 

to this:

# VERSION CONTROLLED: All XModule SCSS
xmodule/static/sass:
  # Source files
  include:
    annotatable/...
    capa/...
    ...
  # CMS entrypoint files
  cms:
    AboutBlockStudio.scss
    AnnotatableBlockStudio.scss
    ...
  # LMS source files
  lms:
    AboutBlockPreview.scss
    ConditionalBlockPreview.scss
    ...

Also, we are able to remove all SCSS-related logic from the
xmodule_assets script and from the HTMLSnippet class.
XModule JS assets still need processing, but we will address
those in a separate series of PRs.

Part of: #31624

Testing Instructions

  • Build the Tutor openedx image with this branch
  • Browse the demo course in the Studio outline editor
  • Browse the demo course in Learning MFE

Deadline

Medium-high urgency, as this is in the critical path to a long line of DevX improvement PRs.

@kdmccormick kdmccormick force-pushed the kdmccormick/xmodule-scss-commit branch from eb1088a to 7220a30 Compare June 6, 2023 13:45
@kdmccormick kdmccormick marked this pull request as ready for review June 6, 2023 13:46
@kdmccormick kdmccormick force-pushed the kdmccormick/xmodule-scss-commit branch 2 times, most recently from aecaef9 to 8c0009c Compare June 14, 2023 16:46
@kdmccormick kdmccormick changed the title [5/6] build: commit XModule SCSS entrypoints of generating them [5/6] build: commit XModule SCSS entrypoints instead of generating them Jun 14, 2023
Copy link
Contributor

@feanil feanil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested in tutor, and looks good to me.

@kdmccormick kdmccormick force-pushed the kdmccormick/xmodule-scss-commit branch from 8c0009c to 9e3bb3a Compare June 14, 2023 19:11
`xmodule_assets` generated a series of SCSS "entrypoint"
files, where each entrypoint file imported from the
SCSS "sources" in xmodule/css.

This process was more complicated up until very
recently; for context, make sure you've seen:
 * openedx#32288
 * openedx#32289

Now that the process is simpler, though, there is no
reason to generate the SCSS entrypoints; we can just
commit them to the repository instead!
So, we go from this:

    # GENERATED: SCSS entrypoints files for CMS
    common/static/xmodule/descriptors:
       AboutBlockStudio.scss
       AnnotatableBlockStudio.scss
       ...
    # GENERATED: SCSS entrypoints files for LMS
    common/static/xmodule/modules:
       AboutBlockPreview.scss
       AnnotatableBlockPreview.scss
       ...
    # VERSION CONTROLLED: SCSS source files
    xmodule/css:
      annotatable/...
      capa/...
      ...

to this:

    # VERSION CONTROLLED: All XModule SCSS
    xmodule/static/sass:
      # Source files
      include:
        annotatable/...
        capa/...
        ...
      # CMS entrypoint files
      cms:
        AboutBlockStudio.scss
        AnnotatableBlockStudio.scss
        ...
      # LMS source files
      lms:
        AboutBlockPreview.scss
        AnnotatableBlockPreview.scss
        ...

Also, we are able to remove all SCSS-related logic from the
`xmodule_assets` script and from the `HTMLSnippet` class.
XModule JS assets still need processing, but we will address
those in a separate series of PRs.

Part of: openedx#32292
@kdmccormick kdmccormick force-pushed the kdmccormick/xmodule-scss-commit branch from 9e3bb3a to b93e41d Compare June 16, 2023 03:51
@kdmccormick kdmccormick merged commit 0b455e0 into openedx:master Jun 16, 2023
@kdmccormick kdmccormick deleted the kdmccormick/xmodule-scss-commit branch June 16, 2023 12:51
kdmccormick added a commit that referenced this pull request Jun 16, 2023
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants