Skip to content

Commit

Permalink
Improve transform-react-jsx typings (#13820)
Browse files Browse the repository at this point in the history
* improve transform-react-jsx typings

* rename test fixtures

* remove unreachable sourceSelf check

* update test fixtures

* Update packages/babel-core/src/index.ts

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>

* Update packages/babel-plugin-transform-react-jsx/src/create-plugin.ts

Co-authored-by: Henry Zhu <hi@henryzoo.com>
  • Loading branch information
JLHwung and hzoo committed Oct 7, 2021
1 parent 4132564 commit c2f747c
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 60 deletions.
1 change: 1 addition & 0 deletions packages/babel-core/src/index.ts
Expand Up @@ -2,6 +2,7 @@ declare const PACKAGE_JSON: { name: string; version: string };
export const version = PACKAGE_JSON.version;

export { default as File } from "./transformation/file/file";
export type { default as PluginPass } from "./transformation/plugin-pass";
export { default as buildExternalHelpers } from "./tools/build-external-helpers";
export { resolvePlugin, resolvePreset } from "./config/files";

Expand Down
@@ -0,0 +1 @@
var x = <div __self={self}></div>;
@@ -0,0 +1,4 @@
{
"throws": "Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.",
"plugins": ["transform-react-jsx-development"]
}
@@ -0,0 +1 @@
var x = <div __source={source}></div>;
@@ -0,0 +1,4 @@
{
"throws": "Duplicate __source prop found. You are most likely using the deprecated transform-react-jsx-source Babel plugin. Both __source and __self are automatically set when using the automatic runtime. Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.",
"plugins": ["transform-react-jsx-development"]
}

0 comments on commit c2f747c

Please sign in to comment.