-
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(transformer/react): support emit_full_signatures option in refres…
…h plugin
- Loading branch information
Showing
10 changed files
with
99 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
4 changes: 4 additions & 0 deletions
4
...el-plugin-transform-react-jsx/test/fixtures/refresh/emit-full-signatures-option/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,4 @@ | ||
export default function Bar () { | ||
useContext(X) | ||
return <Foo /> | ||
}; |
12 changes: 12 additions & 0 deletions
12
...plugin-transform-react-jsx/test/fixtures/refresh/emit-full-signatures-option/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,12 @@ | ||
{ | ||
"plugins": [ | ||
[ | ||
"transform-react-jsx", | ||
{ | ||
"refresh": { | ||
"emitFullSignatures": false | ||
} | ||
} | ||
] | ||
] | ||
} |
12 changes: 12 additions & 0 deletions
12
...el-plugin-transform-react-jsx/test/fixtures/refresh/emit-full-signatures-option/output.js
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,12 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
var _s = $RefreshSig$(); | ||
export default function Bar() { | ||
_s(); | ||
useContext(X); | ||
return _jsx(Foo, {}); | ||
} | ||
_s(Bar, "gDsCjeeItUuvgOWf1v4qoK9RF6k="); | ||
_c = Bar; | ||
; | ||
var _c; | ||
$RefreshReg$(_c, "Bar"); |
13 changes: 10 additions & 3 deletions
13
...orm_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"plugins": [["transform-react-jsx", { | ||
"refresh": {} | ||
}]] | ||
"plugins": [ | ||
[ | ||
"transform-react-jsx", | ||
{ | ||
"refresh": { | ||
"emitFullSignatures": true | ||
} | ||
} | ||
] | ||
] | ||
} |
18 changes: 12 additions & 6 deletions
18
...est/fixtures/refresh/uses-custom-identifiers-for-refresh-reg-and-refresh-sig/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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"plugins": [["transform-react-jsx", { | ||
"refresh": { | ||
"refreshReg": "import.meta.refreshReg", | ||
"refreshSig": "import.meta.refreshSig" | ||
} | ||
}]] | ||
"plugins": [ | ||
[ | ||
"transform-react-jsx", | ||
{ | ||
"refresh": { | ||
"refreshReg": "import.meta.refreshReg", | ||
"refreshSig": "import.meta.refreshSig", | ||
"emitFullSignatures": true | ||
} | ||
} | ||
] | ||
] | ||
} |