-
-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer): JSX source: add
var _jsxFileName
statement (#5894)
Fix JSX source transform when run alone without main JSX transform. The added test case is same as one of Babel's exec test cases, but the exec test fails due to `transformAsync` not being present.
- Loading branch information
1 parent
bd7a653
commit 9758c1a
Showing
6 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/input.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
var x = <sometag />; |
6 changes: 6 additions & 0 deletions
6
...abel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/output.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
var _jsxFileName = "<CWD>/tests/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/basic-sample/input.jsx"; | ||
var x = <sometag __source={{ | ||
fileName: _jsxFileName, | ||
lineNumber: 1, | ||
columnNumber: 9 | ||
}} />; |
3 changes: 3 additions & 0 deletions
3
...nce/tests/babel-plugin-transform-react-jsx-source/test/fixtures/react-source/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["syntax-jsx", "transform-react-jsx-source"] | ||
} |