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

Option to generate import for custom JSX pragma #10286

Open
kodekameleon opened this issue Jul 31, 2019 · 5 comments

Comments

@kodekameleon
Copy link

commented Jul 31, 2019

Feature Request

Is your feature request related to a problem? Please describe.
When using a custom JSX pragma the pragma is not imported, resulting in missing references in the generated code.

Describe the solution you'd like
An option to generate something like import pragma from "pragma-file".

Describe alternatives you've considered
I am currently using rollup-plugin-inject to inject the import during packaging; and @wordpress/babel-plugin-import-jsx-pragma to inject the import during testing with mocha.

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Jul 31, 2019

Hey @kodekameleon! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite.

@xtuc

This comment has been minimized.

Copy link
Member

commented Jul 31, 2019

With the default React JSX pragam you still need to import it yourself. I think that's expected.

@kodekameleon

This comment has been minimized.

Copy link
Author

commented Jul 31, 2019

I understand that it is expected, but just adding

import {mypragma} from "mypragmafile"

resulted in rollup resolving conflicting globals and renaming the calls to the pragma so that they did not match up.

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

That is unexpected. Can you provide an example?

@kodekameleon

This comment has been minimized.

Copy link
Author

commented Aug 8, 2019

Yes, I will try to get a minimal example of the behaviour shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.