-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JSX support. #12
base: main
Are you sure you want to change the base?
Add JSX support. #12
Conversation
import { NodePath, PluginObj, PluginPass } from '@babel/core'; | ||
import debugFactory from 'debug'; | ||
import * as util from '@babel/types'; | ||
import template from '@babel/template'; | ||
|
||
const pkgName = 'babel-plugin-explicit-exports-references'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to change this to get the tsconfig.build.json
to work (since the root is now src/
).
Thank you for this! This is a super old project that I use often but have neglected to bring up to date with my lastest infra. I'll take a look |
Update: waiting until https://github.com/Xunnamius/xscripts is finished before merging this in |
hi @Xunnamius is there any update to this? I am also getting the same error, hoping it solves that problem. |
@2K-Es I'm focusing on unifying my dev-integrate-release loop across my projects, but perhaps I'll cut an ad hoc release for this package containing John's fixes first. UPDATE: Will handle this |
This adds in JSX support to the explicit-exports-references babel plugin. When attempting to replace a JSXMemberExpression with a plain MemberExpression there was an error generated by Babel. This fixes that by explicitly creating a JSXMemberExpression when replacing a JSXIdentifier or the name of the openingElement of a JSXElement.
In the process I noticed that there was no ability to generate a production build, there is no Webpack config. So I changed the logic so that the build is generated by TypeScript now, no Webpack needed.
Test Plan:
The tests pass! This required updating a bunch of infrastructure to support React.