Use babel-plugin-dedent in Review Board.
Review Request #8515 — Created Nov. 2, 2016 and submitted
In another change, I've added an npm dependency to Djblets to install
babel-plugin-dedent, which allows us to use ES6 template strings without
filling our compiled output with a ton of ugly spaces. This change enables it
for Review Board as well.
- Ran
setup.py develop
and saw babel-plugin-dedent get installed correctly. - Used the dedent tag in extension code.
Description | From | Last Updated |
---|---|---|
This will need to also handle the extension packaging side. Right now, djblets.extensions.packaging:BuildStaticFiles.install_pipeline_dependencies installs the necessary NPM packages depending on … |
chipx86 | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot | |
Should be alphabetical. |
chipx86 | |
'django_reset' imported but unused |
reviewbot | |
'from settings_local import *' used; unable to detect undefined names |
reviewbot |
-
-
This will need to also handle the extension packaging side. Right now,
djblets.extensions.packaging:BuildStaticFiles.install_pipeline_dependencies
installs the necessary NPM packages depending on what's being used. We should either say that we're leaning on this for Djblets (which we probably should anyway -- we might want this plugin for Djblets JavaScript code) or we'll need to override this behavior in Review Board (which will require some Djblets work anyway to make that easier).I'd say let's just move this change over to Djblets instead, and then we'll get the best of all worlds.
-
- Summary:
-
Add babel-plugin-dedent to Review Board build.Use babel-plugin-dedent in Review Board.
- Description:
-
~ The way we do a lot of multi-line templates in JavaScript code is pretty ugly,
~ building a big list of strings and then joining them. ES6 template strings are ~ a potential solution, but they introduce a lot of ugly whitespace if there's ~ any indentation in them. ~ In another change, I've added an npm dependency to Djblets to install
~ babel-plugin-dedent, which allows us to use ES6 template strings without ~ filling our compiled output with a ton of ugly spaces. This change enables it ~ for Review Board as well. - - This change adds babel-plugin-dedent to our build, which adds a preprocessing
- step that removes leading indentation from template strings which are marked - with the dedent
tag. This looks like an ordinary tag, but it's processed- during the compilation step instead of at runtime. - Depends On:
-
- Commit:
14a995bf35314749ae501be2680adf4bd1a923697357b397c432341325ce8a8cac255ae5d0aaf358- Diff:
Revision 2 (+2 -1)