The Front End Commands We Use (and Why)

There are many ways to invoke static asset building (webpack, make commands from devstack, paver, Django management commands, etc.) That can make it challenging to figure out exactly what people are really using and why, which is vital to our prioritization efforts. If you have a moment, please add an entry to this page with:

  1. Your name
  2. The top 1-5 commands you use to trigger any sort of asset building or watching.
  3. The reasons why you use those particular commands (what do they do or not do)?
  4. Which commands cause you the most pain?

Thank you!


Learner IDAs—credentials, discovery, ecommerce (posted by ClintonB (Deactivated))

All IDAs have two Make targets: static and clean_static. As its name implies, clean_static removes all build artifacts (e.g. Webpack bundles, Django compressor output). Credentials is leading the pack (no pun intended) by using Webpack exclusively. Discovery uses Webpack for everything but Publisher (which still relies on Bower+RequireJS+Django Compressor). E-Commerce uses Bower+RequireJS+Django Compressor, and also does some extra work for theme SASS compilation. Thus, the ultimate output of the static target depends on the IDA. Links are below.

Additionally, Credentials has two additional targets for Webpack—static.dev and static.watch—that build Webpack for development (without minification) and watch for changes (also, without minification).

I am unaware of any pain points at this time. There were initial issues around the need to run the watch command for Webpack, but improved communication/documentation has resolved those issues.


Andy Armstrong (Deactivated)

For edx-platform, I have comprehensive theming enabled and all white label themes (edx-themes) installed. A full update_assets is much too slow, so I use more targeted commands:

Full rebuild when switching branches:
paver devstack lms  (or studio)

Compile a single theme:
paver compile_sass --theme-dirs=/edx/app/edxapp/edx-platform/themes --themes=edx.org

Update all assets on a sandbox:
sudo /edx/bin/edxapp-update-assets-cms; sudo /edx/bin/edxapp-update-assets-lms; sudo /edx/bin/supervisorctl restart edxapp:

Here are some challenges I have with assets:

  • the various watchers don't understand themes so don't recompile when they are changed
  • Paver doesn't have access to Django configuration settings so you have to pass --theme-dirs every time
  • Karma tests are now cached so in debug mode I need to restart the whole test run on each change