Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add JSX support. #12

wants to merge 3 commits into from

Conversation

jeresig
Copy link

@jeresig jeresig commented Jul 15, 2024

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.

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';
Copy link
Author

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/).

@Xunnamius
Copy link
Owner

Xunnamius commented Jul 16, 2024

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 tomorrow morning before the weekend.

@Xunnamius
Copy link
Owner

Update: waiting until https://github.com/Xunnamius/xscripts is finished before merging this in

@2K-Es
Copy link

2K-Es commented Sep 17, 2024

hi @Xunnamius is there any update to this? I am also getting the same error, hoping it solves that problem.

@Xunnamius
Copy link
Owner

Xunnamius commented Sep 17, 2024

@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 the weekend of the 28th :) sooooon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants