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

Bump versions + Add babel-plugin-auto-import for Automatic injection of Preact JSX imports #9

Closed

Conversation

jacobodeharo
Copy link

@jacobodeharo jacobodeharo commented Jun 2, 2021

What does this PR

  • This PR automatically injects import { h, Fragment } from 'preact'; by using babel-plugin-auto-import. So there is no need for importing them anymore.
  • Add unit test covering new scenarios.
  • Bump versions of Jest 27 and other dependencies.

Motivation
Some libraries and frameworks, including modern FE development tools like ViteJS, auto-injects the JSX imports. With these changes the jest-preset-preact spects to work in those scenarios.

@rschristian
Copy link
Member

rschristian commented Jun 2, 2021

The jsxInject looks like it's going to be killed of pretty soon here in Vite, see vitejs/vite#2369 (comment)

Not sure this is really needed (Edit: This is in reference to babel-plugin-auto-import alone)

@jacobodeharo
Copy link
Author

@rschristian good news then! Thanks.

Closing then.

@jacobodeharo jacobodeharo deleted the automatic_jsx_imports branch June 3, 2021 06:57
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.

2 participants