Open
Conversation
Also removed previously-added TypeScript instructions, as it turns out that using it through TSC doesn't work without type declarations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By exporting these functions (which just delegate to the existing implementation), users who set Babel (or TypeScript or any other tool with support) to the
automaticmode and configure the module don't need to manually add the imports, as the compiler will be able to automatically insert them.I've had to change the project's
.babelrcto useautomaticin order to run the new tests, because the@jsxRuntimepragma can be used to revert to the older mode for a single file but can't be used to update to the newer one, as it's implemented in thetransform-react-jsxplugin that only gets used in auto mode.I've also added the
transform-modules-commonjsplugin in order to transpileauto.test.js, as for whatever reasonautomaticmode always inserts ESM imports even when it's a CommonJS file, but Jest's support for ESM is buggy so running the file as-is doesn't work.