Always use pipeline compilers, add babel.
Review Request #7954 — Created Feb. 10, 2016 and submitted
This change switches us over to using pipeline's compilers all the time, not
just whenPIPELINE_ENABLED = True
, as well as adding the babel compiler to
the list. This means that compilation of LESS (and ES6!) happens on the
back-end instead of the front-end during development.This is better than before because instead of recompiling all the stylesheets
on page load, we do it on-demand, and pipeline does mtime checks to verify
whether it needs to actually do any work. This significantly speeds up reloads
during development.This adds new dev dependencies on lessc and babel. These are included in a
package.json file that allows one to just run "npm install" to get everything
necessary.
- Verified that recompile on-demand from within the devserver worked as
expected. - Converted common.js to common.es6 and made use of some ES6 features. Verified
that what I got in the browser was transpiled ES5. - Converted a JS file in an extension to ES6 and saw similar results.
Description | From | Last Updated |
---|---|---|
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
We don't use @param do we? |
brennie | |
Missing semicolon. |
ME medanat | |
`${$target.attr('href')}infobx/` |
ME medanat | |
infobox |
brennie | |
We use these flags for more than media building. They should stay. |
chipx86 | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'djblets' imported but unused |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot |
-
Awesome. It'll be really nice to be able to have the smarter recompilation and support for ES6 :)
We're discussing it in Slack already, but for posterity, the things I'm hoping we can change are:
1) Using
.js
(or.es6.js
) for the files instead, so everyone in the world (including Pygments) doesn't have to support.es6
. Also, having a version in there makes it hard down the road for ES7, etc.
2) I'd love to put built files in a separate directory, so we don't have a bunch of stuff all coming up when you grep. Something more manageable would be nice. Also, if we could do this, no need for.es6
at all. -
- Change Summary:
-
- Use new compiler in djblets that does filenames the way we want.
- Move common.es6 to common.es6.js.
- Turn on source maps for babel.
- Fix a few issues in common.es6.js that reviewers pointed out.
- Commit:
-
7279d5deb8e5bbd4d642dac5da0b9635537eb008ac31b7ad34ef0fd5b4d42d65d287d13273c9ac0d
-
Tool: PEP8 Style Checker Processed Files: reviewboard/settings.py reviewboard/test.py tests/runtests.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc Tool: Pyflakes Processed Files: reviewboard/settings.py reviewboard/test.py tests/runtests.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc
-
-
- Change Summary:
-
Simplify less arguments.
- Commit:
-
ac31b7ad34ef0fd5b4d42d65d287d13273c9ac0d3f154b7145440ad0bd41d924882562d252e430a7
-
Tool: Pyflakes Processed Files: tests/runtests.py reviewboard/settings.py reviewboard/test.py contrib/internal/conf/settings_local.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/css/pages/reviews.less Tool: PEP8 Style Checker Processed Files: tests/runtests.py reviewboard/settings.py reviewboard/test.py contrib/internal/conf/settings_local.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/css/pages/reviews.less
-
-
-
-
Tool: PEP8 Style Checker Processed Files: tests/runtests.py reviewboard/settings.py reviewboard/test.py contrib/internal/conf/settings_local.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/css/pages/reviews.less Tool: Pyflakes Processed Files: tests/runtests.py reviewboard/settings.py reviewboard/test.py contrib/internal/conf/settings_local.py reviewboard/staticbundles.py Ignored Files: package.json reviewboard/templates/base.html reviewboard/templates/js/pipeline.html .gitignore reviewboard/static/rb/js/common.es6.js reviewboard/static/rb/js/.jshintrc reviewboard/static/rb/css/pages/reviews.less
-
-