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 support for import.meta.hot #15

Merged
merged 3 commits into from
Jan 22, 2023
Merged

Conversation

0kzh
Copy link
Contributor

@0kzh 0kzh commented Jan 15, 2023

Closes #3

What/Why:
Some modules use import.meta.hot to implement hot module reloading support. However, when running these test in Jest, this causes an error.

How:
Created a new plugin that looks for import.meta.hot and replaces it with module.hot

Checklist:

  • Documentation updated
  • Tests
  • Ready to be merged
  • Added myself to contributors table

@codecov
Copy link

codecov bot commented Jan 15, 2023

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (664b14b) compared to base (081c514).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #15   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         4    +1     
  Lines           67        93   +26     
  Branches        22        32   +10     
=========================================
+ Hits            67        93   +26     
Impacted Files Coverage Δ
.../babel-plugin-transform-vite-meta-hot/src/index.ts 100.00% <100.00%> (ø)
packages/babel-preset-vite/src/index.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@mpeyper mpeyper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job with this!

Functionally I’m happy with it, just some documentation needs updating.

packages/babel-plugin-transform-vite-meta-hot/README.md Outdated Show resolved Hide resolved
packages/babel-plugin-transform-vite-meta-hot/package.json Outdated Show resolved Hide resolved
@0kzh
Copy link
Contributor Author

0kzh commented Jan 15, 2023

Thanks! And good catch, missed those on my first pass. Should be updated now.

@0kzh
Copy link
Contributor Author

0kzh commented Jan 20, 2023

Hey @mpeyper, bumping this whenever you're free to merge!

Thanks again for your work on this library :)

@mpeyper mpeyper merged commit 2605da6 into OpenSourceRaidGuild:main Jan 22, 2023
@github-actions
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version 1.1.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Support import.meta.hot
2 participants