Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

What happens when update_assets is run today?This page describes the edx-platform static asset compilation as it exists today. A list of items being actively worked on (based on these findings) is at edx-platform Static Asset Work Log.

Table of Contents

Production Mode

...

Original SizeDirectoryOverviewCurrent SizeChanges
137M
/xmodule_js

This is the most confusing one because it contains within it outright copies of many of the top level directories. xmodule_js/common_static appears to be copied over to the root static dir with folders like fontsimages, etc. That being said, xmodule_js/common_static/js is just a subset of js, so it looks like the contents of xmodule_js/common_static are copied first, and then more things are added on top of that.

Most of this is xmodule_js/common_static at 96M, but there's also 35M here for xmodule_js/fixtures/hls.



63M
/js

The biggest items here are vendor files (25M) such as tinymce, pdfjs, ova (Open Video Annotation), and CodeMirror. After that, 11M is CapaModule related JavaScript, most prominently 8M of jsme and the closely related jsmolcalc (see additional notes about jsme in the row for /vendor).

We have a number of bundled application-specific files that weigh hundreds of KB (e.g. the 421K discovery_factory.js), each of which has its own copy of moment and moment.js and locale information.



31M
/xblock

These contain static assets that are copied over from XBlocks (XBlocks can specify their static assets in their setup.py). These files are also namespaced by XBlock tag name. This is problematic for the problem_builder family of XBlocks because the dozen or so separate XBlocks from that family all have copies of the same 1.2M of static assets. We could address this by allowing XBlocks to specify their own static resource namespace, or defaulting the namespace to something tied to the package setup file rather than to each tag name. This kind of duplication happens to a lesser extent with school_yourself and google_drive.

The largest individual block is edx_sga, mostly because it has its own copy of sinon.js (a 1.8M test framework), and copies of other third party dependencies such as JQuery, URIjs, underscore, and requirejs. Only about 84K out of the 3.7M of JavaScript for that XBlock represents non-redundant code specific to SGA. This is mostly because the XBlock framework doesn't provide a good way to specify or manage shared dependecies.



20M
/vendor
Despite the name, the only thing in here is static assets for edx-jsme, which provides the molecule editor for Capa. This tool is no longer supported, but has not been removed. Our actual vendor files are sprinkled everywhere in the source tree, usually multiple times at slightly different versions.

20M
/css
More than half of this are the large bundled CSS generated by our v1 sass files (~800K each), and the smaller per-app CSS generated by our v2 pattern lib sass (~160K each). We also have about 7M worth of vendor CSS, the most notable of which is for pdfjs (4M). There's also the somewhat mysterious 1.3M css/vendor/fonts binary file (not directory), which appears to be an accidental check-in of someone's OS X alias (with a terrifying amount of metadata).

17M
/standord-style

These are theme directories. 12M of this is CSS. Both lms-course.css and lms-main-v1.css are over 700K, and assorted v2 pattern lib CSS files weigh between 160K and 216K each. There's also a 4X multiplier at work – each file has an RTL translated version and md5-hash named copies.

The other 5MB is JavaScript. Our bundled JS files are copied into each theme.

Note: These directories should really be namespaced so that they are built to places like /themes/edx.org instead of the top-level name of /edx.org.



17M
/red-theme


17M
/edx.org


17M
/edge.edx.org


17M
/dark-theme


16M
/common
Again, vendor files dominate here, such as common/js/vendor/sinon.js at 2.1M. 13M of this is the common/js/vendor directory. Over 700K comes from spec files and helpers.

15M
/open-edx
This is actually a theme directory, but one that has 9.7M of CSS instead of the 12M other themes here have. I'm not completely sure on the root cause for this, but it appears that the open-edx theme is not compiling in Bootstrap, meaning both that there is no open-edx/css/bootstrap directory, and the open-edx/css/discussion is smaller.

14M
/bundles
Source map files are the largest items here, with commons.js.map topping out at 892K. Currency.js is dominated by a third party dependency (which-country requires point-in-polygon, which is > 500K). It's also worth noting that JS files here are getting post-processed into hash-names twice – once by webpack, and once by Django.

9.7M
/images

About half of this are two hilariously large copies of a placeholder image that could be replaced with something far smaller.

The other half are images from vsepr, which part of chemtools, a capa problem type.



4.8M
/templates
This is actually a little wacky, because these are mostly Django and Mako templates that shouldn't be compiled out at all, much less post-processed as publicly accessible static assets. However, a small portion of these are underscore templates.

4.5M
/edx-pattern-library
This is basically all fonts, both font-awesome and OpenSans. This is a different font-awesome font from the one that's named by just its hash in bundles.

4.0M
/rest_framework
Mostly documentation for the Django REST framework, and the fonts and JS needed to make that work. It has yet another copy of fontawesome fonts, in four different formats.

3.7M
/data
This is GeoIP data used for embargo code. We also post-process an MD5 hashed version of this, despite the fact that it's only used by Python code.

3.5M
/sass
608K of this is bourbon, but most of this is of our own making. Like templates, this doesn't seem to be something that belongs in the post-processed asset bundle.

3.4M
/fonts
Yet another copy of Open Sans and FontAwesome fonts, with a tiny Creative Commons font as well.

2.4M
/xmodule
The assets compiled out by xmodule_assets (step 3 in the first part of this wiki doc). Most of this is JavaScript, with the circuit simulator being the largest individual contributor at around 400K.

2.3M
/flags







(I'm punting investigating these until later, since they're really on the long tail right now.)





















2.2M
/certificates


1.8M
/teams


1.8M
/learner_profile


1.6M
/wiki


1.4M
/admin


872K
/applets


768K
/support


756K
/proctoring


676K
/course_bookmarks


580K
/course_experience


496K
/coffee


400K
/discussion


388K
/audio


280K
/course_search


240K
/edx-ui-toolkit


216K
/lms


208K
/debug_toolbar


164K
/enterprise


164K
/django_extensions


68K
/mptt



20K
/text



12K
/djcelery

...

  •  Dave Ormsbee: Consolidate JavaScript files across themes, so we don't replicate (and post-process) the same files repeatedly.
  •  Dave Ormsbee: Consolidate static assets that are currently duplicated across XBlock families (e.g. all the problembuilder.* blocks). They're just straight duplicates now because the pip is defined at the package level, but the asset mapping is done at the tag level.
  •  Remove xmodule_js altogether? Calen Pennington (Deactivated) mentioned that this is likely here via symlink to accomodate a part of our JS test framework.
  •  Remove HLS fixture data (25MB of vendor JS fixtures)
  •  Combine SASS compilation steps so we're not recompiling the same shared assets between LMS and Studio.
  •  Extract and isolate vendor JS files so that they aren't constantly re-processed by our pipeline.
  •  Investigate current "ideal" Bootstrap CSS compile performance (no v1 or v2 CSS code), to make sure < 1s latency is achievable.
  •  Change how Webpack configuration is extracted so that we don't waste so much time waiting on edx-platform to start up and give us a config value. (Complicated by Studio's git-hashed based static dir location.)