Example #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="JsxTransformer"/> class.
		/// </summary>
		/// <param name="environment">The ReactJS.NET environment</param>
		/// <param name="cache">The cache to use for JSX compilation</param>
		/// <param name="fileSystem">File system wrapper</param>
		/// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
		public JsxTransformer(IReactEnvironment environment, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash)
		{
			_environment = environment;
			_cache = cache;
			_fileSystem = fileSystem;
			_fileCacheHash = fileCacheHash;
		}
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="JsxTransformer"/> class.
 /// </summary>
 /// <param name="environment">The ReactJS.NET environment</param>
 /// <param name="cache">The cache to use for JSX compilation</param>
 /// <param name="fileSystem">File system wrapper</param>
 /// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
 /// <param name="siteConfig">Site-wide configuration</param>
 public JsxTransformer(IReactEnvironment environment, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash, IReactSiteConfiguration siteConfig)
 {
     _environment   = environment;
     _cache         = cache;
     _fileSystem    = fileSystem;
     _fileCacheHash = fileCacheHash;
     _config        = siteConfig;
 }
Example #3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="JsxTransformer"/> class.
		/// </summary>
		/// <param name="environment">The ReactJS.NET environment</param>
		/// <param name="cache">The cache to use for JSX compilation</param>
		/// <param name="fileSystem">File system wrapper</param>
		/// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
		/// <param name="siteConfig">Site-wide configuration</param>
		public JsxTransformer(IReactEnvironment environment, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash, IReactSiteConfiguration siteConfig)
		{
			_environment = environment;
			_cache = cache;
			_fileSystem = fileSystem;
			_fileCacheHash = fileCacheHash;
			_config = siteConfig;
		}
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Babel"/> class.
 /// </summary>
 /// <param name="environment">The ReactJS.NET environment</param>
 /// <param name="cache">The cache to use for compilation</param>
 /// <param name="fileSystem">File system wrapper</param>
 /// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
 /// <param name="siteConfig">Site-wide configuration</param>
 public Babel(IReactEnvironment environment, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash, IReactSiteConfiguration siteConfig)
 {
     _environment   = environment;
     _cache         = cache;
     _fileSystem    = fileSystem;
     _fileCacheHash = fileCacheHash;
     _config        = siteConfig;
     _babelConfig   = siteConfig.BabelConfig.Serialize(_config.BabelVersion);
 }
Example #5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="Babel"/> class.
		/// </summary>
		/// <param name="environment">The ReactJS.NET environment</param>
		/// <param name="cache">The cache to use for compilation</param>
		/// <param name="fileSystem">File system wrapper</param>
		/// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
		/// <param name="siteConfig">Site-wide configuration</param>
		public Babel(IReactEnvironment environment, ICache cache, IFileSystem fileSystem, IFileCacheHash fileCacheHash, IReactSiteConfiguration siteConfig)
		{
			_environment = environment;
			_cache = cache;
			_fileSystem = fileSystem;
			_fileCacheHash = fileCacheHash;
			_config = siteConfig;
			_babelConfig = siteConfig.BabelConfig.Serialize();
		}
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReactEnvironment"/> class.
 /// </summary>
 /// <param name="engineFactory">The JavaScript engine factory</param>
 /// <param name="config">The site-wide configuration</param>
 /// <param name="cache">The cache to use for JSX compilation</param>
 /// <param name="fileSystem">File system wrapper</param>
 /// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
 public ReactEnvironment(
     IJavaScriptEngineFactory engineFactory,
     IReactSiteConfiguration config,
     ICache cache,
     IFileSystem fileSystem,
     IFileCacheHash fileCacheHash
     )
 {
     _engineFactory  = engineFactory;
     _config         = config;
     _cache          = cache;
     _fileSystem     = fileSystem;
     _fileCacheHash  = fileCacheHash;
     _jsxTransformer = new Lazy <IJsxTransformer>(() =>
                                                  new JsxTransformer(this, _cache, _fileSystem, _fileCacheHash, _config)
                                                  );
 }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ReactEnvironment"/> class.
 /// </summary>
 /// <param name="engineFactory">The JavaScript engine factory</param>
 /// <param name="config">The site-wide configuration</param>
 /// <param name="cache">The cache to use for JSX compilation</param>
 /// <param name="fileSystem">File system wrapper</param>
 /// <param name="fileCacheHash">Hash algorithm for file-based cache</param>
 public ReactEnvironment(
     IJavaScriptEngineFactory engineFactory,
     IReactSiteConfiguration config,
     ICache cache,
     IFileSystem fileSystem,
     IFileCacheHash fileCacheHash
     )
 {
     _engineFactory    = engineFactory;
     _config           = config;
     _cache            = cache;
     _fileSystem       = fileSystem;
     _fileCacheHash    = fileCacheHash;
     _babelTransformer = new Lazy <IBabel>(() =>
                                           new Babel(this, _cache, _fileSystem, _fileCacheHash, _config)
                                           );
     _engineFromPool = new Lazy <IJsEngine>(() => _engineFactory.GetEngine());
 }