Skip to content

Commit

Permalink
Add support for a ?_debug_lab=1 parameter (#864)
Browse files Browse the repository at this point in the history
Triggers un-minified LABjs source with debug output to the console.
  • Loading branch information
gigabo authored Jan 31, 2017
1 parent 933ab01 commit fef3417
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-server/core/renderMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,8 @@ function renderScriptsAsync(scripts, res) {
if (!RLS().didLoadLAB){

// This is the full implementation of LABjs.
res.write(flab.min);
// Pass `?_debug_lab=1` for unminified source with debugging output.
res.write(DebugUtil.getLab() ? flab.src : flab.min);

// We always want scripts to be executed in order.
res.write("$LAB.setGlobalDefaults({AlwaysPreserveOrder:true});");
Expand Down
1 change: 1 addition & 0 deletions packages/react-server/core/util/DebugUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const RLS = RequestLocalStorage.getNamespace();
const DEBUG_PARAMS = {
getRenderTimeout : "_debug_render_timeout",
getOutputLogs : "_debug_output_logs",
getLab : "_debug_lab",
getLogLevel : "_react_server_log_level",
getLogLevelMain : "_react_server_log_level_main",
getLogLevelTime : "_react_server_log_level_time",
Expand Down

0 comments on commit fef3417

Please sign in to comment.