@@ -64,7 +64,7 @@ public JsxTransformer(IReactEnvironment environment, ICache cache, IFileSystem f
6464 /// </summary>
6565 /// <param name="filename">Name of the file to load</param>
6666 /// <returns>JavaScript</returns>
67- public string TransformJsxFile ( string filename )
67+ public string TransformJsxFile ( string filename , bool useHarmony = false )
6868 {
6969 var fullPath = _fileSystem . MapPath ( filename ) ;
7070
@@ -91,7 +91,7 @@ public string TransformJsxFile(string filename)
9191 }
9292
9393 // 3. Not cached, perform the transformation
94- return TransformJsxWithHeader ( contents , hash ) ;
94+ return TransformJsxWithHeader ( contents , hash , useHarmony ) ;
9595 }
9696 ) ;
9797 }
@@ -103,13 +103,13 @@ public string TransformJsxFile(string filename)
103103 /// <param name="contents">Contents of the input file</param>
104104 /// <param name="hash">Hash of the input. If null, it will be calculated</param>
105105 /// <returns>JavaScript</returns>
106- private string TransformJsxWithHeader ( string contents , string hash = null )
106+ private string TransformJsxWithHeader ( string contents , string hash = null , bool useHarmony = false )
107107 {
108108 if ( string . IsNullOrEmpty ( hash ) )
109109 {
110110 hash = _fileCacheHash . CalculateHash ( contents ) ;
111111 }
112- return GetFileHeader ( hash ) + TransformJsx ( contents ) ;
112+ return GetFileHeader ( hash ) + TransformJsx ( contents , useHarmony ) ;
113113 }
114114
115115 /// <summary>
@@ -118,7 +118,7 @@ private string TransformJsxWithHeader(string contents, string hash = null)
118118 /// </summary>
119119 /// <param name="input">JSX</param>
120120 /// <returns>JavaScript</returns>
121- public string TransformJsx ( string input )
121+ public string TransformJsx ( string input , bool useHarmony = false )
122122 {
123123 // Just return directly if there's no JSX annotation
124124 if ( ! input . Contains ( "@jsx" ) )
@@ -131,7 +131,8 @@ public string TransformJsx(string input)
131131 {
132132 var output = _environment . ExecuteWithLargerStackIfRequired < string > (
133133 "ReactNET_transform" ,
134- input
134+ input ,
135+ useHarmony
135136 ) ;
136137 return output ;
137138 }
@@ -178,11 +179,11 @@ public string GetJsxOutputPath(string path)
178179 /// </summary>
179180 /// <param name="filename">Name of the file to load</param>
180181 /// <returns>File contents</returns>
181- public string TransformAndSaveJsxFile ( string filename )
182+ public string TransformAndSaveJsxFile ( string filename , bool useHarmony = false )
182183 {
183184 var outputPath = GetJsxOutputPath ( filename ) ;
184185 var contents = _fileSystem . ReadAsString ( filename ) ;
185- var result = TransformJsxWithHeader ( contents ) ;
186+ var result = TransformJsxWithHeader ( contents , useHarmony : useHarmony ) ;
186187 _fileSystem . WriteAsString ( outputPath , result ) ;
187188 return outputPath ;
188189 }
0 commit comments