@@ -59,13 +59,13 @@ public JsxTransformer(IReactEnvironment environment, ICache cache, IFileSystem f
59
59
_fileCacheHash = fileCacheHash ;
60
60
}
61
61
62
- /// <summary>
63
- /// Transforms a JSX file. Results of the JSX to JavaScript transformation are cached.
64
- /// </summary>
65
- /// <param name="filename">Name of the file to load</param>
66
- /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
67
- /// <returns>JavaScript</returns>
68
- public string TransformJsxFile ( string filename , bool useHarmony = false )
62
+ /// <summary>
63
+ /// Transforms a JSX file. Results of the JSX to JavaScript transformation are cached.
64
+ /// </summary>
65
+ /// <param name="filename">Name of the file to load</param>
66
+ /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
67
+ /// <returns>JavaScript</returns>
68
+ public string TransformJsxFile ( string filename , bool useHarmony = false )
69
69
{
70
70
var fullPath = _fileSystem . MapPath ( filename ) ;
71
71
@@ -97,15 +97,15 @@ public string TransformJsxFile(string filename, bool useHarmony = false)
97
97
) ;
98
98
}
99
99
100
- /// <summary>
101
- /// Transforms JSX into regular JavaScript, and prepends a header used for caching
102
- /// purposes.
103
- /// </summary>
104
- /// <param name="contents">Contents of the input file</param>
105
- /// <param name="hash">Hash of the input. If null, it will be calculated</param>
106
- /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
107
- /// <returns>JavaScript</returns>
108
- private string TransformJsxWithHeader ( string contents , string hash = null , bool useHarmony = false )
100
+ /// <summary>
101
+ /// Transforms JSX into regular JavaScript, and prepends a header used for caching
102
+ /// purposes.
103
+ /// </summary>
104
+ /// <param name="contents">Contents of the input file</param>
105
+ /// <param name="hash">Hash of the input. If null, it will be calculated</param>
106
+ /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
107
+ /// <returns>JavaScript</returns>
108
+ private string TransformJsxWithHeader ( string contents , string hash = null , bool useHarmony = false )
109
109
{
110
110
if ( string . IsNullOrEmpty ( hash ) )
111
111
{
@@ -114,14 +114,14 @@ private string TransformJsxWithHeader(string contents, string hash = null, bool
114
114
return GetFileHeader ( hash ) + TransformJsx ( contents , useHarmony ) ;
115
115
}
116
116
117
- /// <summary>
118
- /// Transforms JSX into regular JavaScript. The result is not cached. Use
119
- /// <see cref="TransformJsxFile"/> if loading from a file since this will cache the result.
120
- /// </summary>
121
- /// <param name="input">JSX</param>
122
- /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
123
- /// <returns>JavaScript</returns>
124
- public string TransformJsx ( string input , bool useHarmony = false )
117
+ /// <summary>
118
+ /// Transforms JSX into regular JavaScript. The result is not cached. Use
119
+ /// <see cref="TransformJsxFile"/> if loading from a file since this will cache the result.
120
+ /// </summary>
121
+ /// <param name="input">JSX</param>
122
+ /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
123
+ /// <returns>JavaScript</returns>
124
+ public string TransformJsx ( string input , bool useHarmony = false )
125
125
{
126
126
// Just return directly if there's no JSX annotation
127
127
if ( ! input . Contains ( "@jsx" ) )
@@ -135,7 +135,7 @@ public string TransformJsx(string input, bool useHarmony = false)
135
135
var output = _environment . ExecuteWithLargerStackIfRequired < string > (
136
136
"ReactNET_transform" ,
137
137
input ,
138
- useHarmony
138
+ useHarmony
139
139
) ;
140
140
return output ;
141
141
}
@@ -176,14 +176,14 @@ public string GetJsxOutputPath(string path)
176
176
) ;
177
177
}
178
178
179
- /// <summary>
180
- /// Transforms a JSX file to JavaScript, and saves the result into a ".generated.js" file
181
- /// alongside the original file.
182
- /// </summary>
183
- /// <param name="filename">Name of the file to load</param>
184
- /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
185
- /// <returns>File contents</returns>
186
- public string TransformAndSaveJsxFile ( string filename , bool useHarmony = false )
179
+ /// <summary>
180
+ /// Transforms a JSX file to JavaScript, and saves the result into a ".generated.js" file
181
+ /// alongside the original file.
182
+ /// </summary>
183
+ /// <param name="filename">Name of the file to load</param>
184
+ /// <param name="useHarmony"><c>true</c> if support for es6 syntax should be rewritten.</param>
185
+ /// <returns>File contents</returns>
186
+ public string TransformAndSaveJsxFile ( string filename , bool useHarmony = false )
187
187
{
188
188
var outputPath = GetJsxOutputPath ( filename ) ;
189
189
var contents = _fileSystem . ReadAsString ( filename ) ;
0 commit comments