/// <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; }
/// <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; }
/// <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); }
/// <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(); }
/// <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) ); }
/// <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()); }