@@ -21,7 +21,7 @@ const safe = goog.require('goog.dom.safe');
2121/**
2222 * A define to control the behavior of SoyJS. If set to true, all Soy templates
2323 * will check for the the presence of a stub template generated by Incremental
24- * Dom, and delegate to it if present.. If it is set, then it delegates to the
24+ * Dom, and delegate to it if present. If it is set, then it delegates to the
2525 * function instead.
2626 *
2727 * This is a define because this adds a set amount of code per template to check
@@ -30,6 +30,30 @@ const safe = goog.require('goog.dom.safe');
3030 */
3131exports . shouldStub = goog . define ( 'goog.soy.SHOULD_STUB' , false ) ;
3232
33+ /**
34+ * A define to always stub SoyJS with Incremental DOM templates.
35+ * @define {boolean}
36+ */
37+ exports . alwaysStub = goog . define ( 'goog.soy.ALWAYS_STUB' , false ) ;
38+
39+ let shouldStubAtRuntime = true ;
40+
41+ /**
42+ * A runtime control for whether a Soy template will be replaced with an
43+ * Incremental DOM template. This is to allow teams to run a 3-arm experiment
44+ * with the default being NOOP (IDOM not not loaded), A1 (IDOM and SoyJS code
45+ * loaded), and A2 (A1 but code stubbed at runtime).
46+ * @return {boolean }
47+ */
48+ exports . shouldStubAtRuntime = function ( ) {
49+ return shouldStubAtRuntime ;
50+ } ;
51+
52+ /** See above. */
53+ exports . disableStubbingAtRuntime = function ( ) {
54+ shouldStubAtRuntime = false ;
55+ } ;
56+
3357/**
3458 * A structural interface for injected data.
3559 *
0 commit comments