-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Support Babel 8 in plugins and presets #15750
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
d09e5c0
to
e1c717f
Compare
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
create-jest
@jest/diff-sequences
expect
@jest/expect-utils
jest
jest-changed-files
jest-circus
jest-cli
jest-config
@jest/console
@jest/core
@jest/create-cache-key-function
jest-diff
jest-docblock
jest-each
@jest/environment
jest-environment-jsdom
@jest/environment-jsdom-abstract
jest-environment-node
@jest/expect
@jest/fake-timers
@jest/get-type
@jest/globals
jest-haste-map
jest-jasmine2
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
@jest/pattern
jest-phabricator
jest-regex-util
@jest/reporters
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
@jest/schemas
jest-snapshot
@jest/snapshot-utils
@jest/source-map
@jest/test-result
@jest/test-sequencer
@jest/transform
@jest/types
jest-util
jest-validate
jest-watcher
jest-worker
pretty-format
commit: |
501bd08
to
0d9a720
Compare
2e3d659
to
be3b812
Compare
I assume we'll release this as a major, and we'll drop Node 18 next so don't worry about those. |
Oh I was planning to go with this PR first just allowing users to use Babel 8, and then a separate one (major) upgrading the whole repo to it. I'll do the whole upgrade immediately then. |
In: - babel-plugin-jest-hoist - babel-preset-jest - babel-jest
e821886
to
1813d34
Compare
Summary
The only remaining blocker for the Babel 8 stable release is to make sure that it works for major Babel consumers. This PR is the first step towards making Jest ready for it. It updates
babel-plugin-jest-hoist
,babel-preset-jest
andbabel-jest
to support running with Babel 8 in addition to supporting Babel 7.Test plan
Tests updated to run both with Babel 7 and Babel 8.
Unfortunately, while the Babel plugins/presets maintained in this repo work reasonably well with Babel 8, Babel 8 itself cannot be loaded inside Jest-run tests, because it's written in ESM. Or maybe it's possible, but not the way that Jest is configured in this repo.
As a workaround, I'm loading the Babel 8 ESM packages using Node.js' native
require
, rather than Jest's sandboxed version.Most of the diff in tests is indentation changes. I suggest disabling whitespace diff when reviewing.
(fyi @JLHwung @liuxingbaoyu)