launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #09173
[Merge] lp:~rharding/launchpad/raw_dev_js into lp:launchpad
Richard Harding has proposed merging lp:~rharding/launchpad/raw_dev_js into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~rharding/launchpad/raw_dev_js/+merge/111877
= Summary =
When doing development, JS developers want the non-minified version of files to be better able to debug things. The combo loader supports the idea with the filter="raw" config option. This enables that for devmode.
== Pre-impl ==
Quick chat about it with Deryck where he suggested tying into the existing devmode setting.
== Implementation details ==
This adds a setting to the global LP. object if devmode is enabled. The config block then uses that to determine if the filter should be adjusted.
== Tests ==
No tests for this as it's just a loader option.
--
https://code.launchpad.net/~rharding/launchpad/raw_dev_js/+merge/111877
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/raw_dev_js into lp:launchpad.
=== modified file 'lib/lp/app/templates/base-layout-macros.pt'
--- lib/lp/app/templates/base-layout-macros.pt 2012-06-15 18:21:34 +0000
+++ lib/lp/app/templates/base-layout-macros.pt 2012-06-25 15:36:36 +0000
@@ -62,6 +62,11 @@
links: {}
};
</script>
+
+ <script type="text/javascript" tal:condition="devmode">
+ LP.devmode = true;
+ </script>
+
<tal:js-legacy condition="not: request/features/js.combo_loader.enabled">
<script type="text/javascript"
tal:attributes="src string:${icingroot}/build/launchpad.js"></script>
@@ -86,10 +91,15 @@
<script type="text/javascript"
tal:attributes="src string:${combo_url}/?yui/yui/yui-min.js&lp/meta.js&yui/loader/loader-min.js"></script>
<script type="text/javascript" tal:content="string:
+ var raw = null;
+ if (LP.devmode) {
+ raw = 'raw';
+ }
YUI.GlobalConfig = {
combine: true,
comboBase: '${combo_url}/?',
root: 'yui/',
+ filter: raw,
debug: ${yui_console_debug},
fetchCSS: false,
groups: {
Follow ups