3
3
* All rights reserved.
4
4
*
5
5
* This source code is licensed under the BSD-style license found in the
6
- * LICENSE file in the root directory of this source tree. An additional grant
6
+ * LICENSE file in the root directory of this source tree. An additional grant
7
7
* of patent rights can be found in the PATENTS file in the same directory.
8
8
*/
9
9
22
22
namespace React
23
23
{
24
24
/// <summary>
25
- /// Request-specific ReactJS.NET environment. This is unique to the individual request and is
25
+ /// Request-specific ReactJS.NET environment. This is unique to the individual request and is
26
26
/// not shared.
27
27
/// </summary>
28
28
public class ReactEnvironment : IReactEnvironment , IDisposable
@@ -70,7 +70,7 @@ public class ReactEnvironment : IReactEnvironment, IDisposable
70
70
/// </summary>
71
71
protected readonly Lazy < string > _version = new Lazy < string > ( GetVersion ) ;
72
72
/// <summary>
73
- /// Contains an engine acquired from a pool of engines. Only used if
73
+ /// Contains an engine acquired from a pool of engines. Only used if
74
74
/// <see cref="IReactSiteConfiguration.ReuseJavaScriptEngines"/> is enabled.
75
75
/// </summary>
76
76
protected Lazy < PooledJsEngine > _engineFromPool ;
@@ -141,7 +141,7 @@ IReactIdGenerator reactIdGenerator
141
141
_fileSystem = fileSystem ;
142
142
_fileCacheHash = fileCacheHash ;
143
143
_reactIdGenerator = reactIdGenerator ;
144
- _babelTransformer = new Lazy < IBabel > ( ( ) =>
144
+ _babelTransformer = new Lazy < IBabel > ( ( ) =>
145
145
new Babel ( this , _cache , _fileSystem , _fileCacheHash , _config )
146
146
) ;
147
147
_engineFromPool = new Lazy < PooledJsEngine > ( ( ) => _engineFactory . GetEngine ( ) ) ;
@@ -304,6 +304,7 @@ public virtual IReactComponent CreateComponent<T>(string componentName, T props,
304
304
305
305
var component = new ReactComponent ( this , _config , _reactIdGenerator , componentName , containerId )
306
306
{
307
+ ClientOnly = clientOnly ,
307
308
Props = props ,
308
309
ServerOnly = serverOnly
309
310
} ;
@@ -329,7 +330,7 @@ public virtual IReactComponent CreateComponent(IReactComponent component, bool c
329
330
}
330
331
331
332
/// <summary>
332
- /// Renders the JavaScript required to initialise all components client-side. This will
333
+ /// Renders the JavaScript required to initialise all components client-side. This will
333
334
/// attach event handlers to the server-rendered HTML.
334
335
/// </summary>
335
336
/// <param name="clientOnly">True if server-side rendering will be bypassed. Defaults to false.</param>
@@ -344,7 +345,7 @@ public virtual string GetInitJavaScript(bool clientOnly = false)
344
345
}
345
346
346
347
/// <summary>
347
- /// Renders the JavaScript required to initialise all components client-side. This will
348
+ /// Renders the JavaScript required to initialise all components client-side. This will
348
349
/// attach event handlers to the server-rendered HTML.
349
350
/// </summary>
350
351
/// <param name="writer">The <see cref="T:System.IO.TextWriter" /> to which the content is written</param>
@@ -371,12 +372,12 @@ public virtual void GetInitJavaScript(TextWriter writer, bool clientOnly = false
371
372
372
373
/// <summary>
373
374
/// Attempts to execute the provided JavaScript code using a non-pooled JavaScript engine (ie.
374
- /// creates a new JS engine per-thread). This is because Babel uses a LOT of memory, so we
375
+ /// creates a new JS engine per-thread). This is because Babel uses a LOT of memory, so we
375
376
/// should completely dispose any engines that have loaded Babel in order to conserve memory.
376
- ///
377
+ ///
377
378
/// If an exception is thrown, retries the execution using a new thread (and hence a new engine)
378
379
/// with a larger maximum stack size.
379
- /// This is required because JSXTransformer uses a huge stack which ends up being larger
380
+ /// This is required because JSXTransformer uses a huge stack which ends up being larger
380
381
/// than what ASP.NET allows by default (256 KB).
381
382
/// </summary>
382
383
/// <typeparam name="T">Type to return from JavaScript call</typeparam>
@@ -396,7 +397,7 @@ public virtual T ExecuteWithBabel<T>(string function, params object[] args)
396
397
397
398
catch ( Exception )
398
399
{
399
- // Assume the exception MAY be an "out of stack space" error. Try running the code
400
+ // Assume the exception MAY be an "out of stack space" error. Try running the code
400
401
// in a different thread with larger stack. If the same exception occurs, we know
401
402
// it wasn't a stack space issue.
402
403
T result = default ( T ) ;
0 commit comments