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

feat: enable all babel syntax plugins #9774

Merged
merged 8 commits into from
Apr 7, 2020

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Apr 6, 2020

Summary

Breaking due to the increased peer dep, so let's land this in Jets 26.

Also needs nicolo-ribaudo/babel-preset-current-node-syntax@565b63a to be published

Adds any babel syntax syntax plugins needed for the current runtime that exists in some version of node. Makes it so user don't have to care about the Babel implementation detail.

Ref

Test plan

Not sure... It looks correct? 😀

@SimenB SimenB changed the title feat: enable all bable syntax plugins feat: enable all babel syntax plugins Apr 6, 2020
@SimenB SimenB force-pushed the node-syntax-preset branch from c283c4a to 2b47385 Compare April 6, 2020 06:50
@@ -8,7 +8,6 @@
module.exports = () => ({
plugins: [
require.resolve('babel-plugin-jest-hoist'),
require.resolve('@babel/plugin-syntax-object-rest-spread'),
require.resolve('@babel/plugin-syntax-bigint'),
require.resolve('babel-preset-current-node-syntax'),
Copy link
Member Author

Choose a reason for hiding this comment

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

we could add the 3 the new preset adds manually, then replace all the plugins we add with this new preset in 26. We already add bigint and object spread anyways, so there's precedence

Copy link
Member Author

Choose a reason for hiding this comment

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

opened #9775 with that

@SimenB
Copy link
Member Author

SimenB commented Apr 6, 2020

This doesn't work on Node 8, which is fine - we will only land in Jest 26 anyways, which will drop node 8. However

Plugin/Preset files are not allowed to export objects, only functions.

@nicolo-ribaudo

@nicolo-ribaudo
Copy link
Contributor

Oh I can add Node 8 support (Babel still supports Node 8 anyway).

@SimenB
Copy link
Member Author

SimenB commented Apr 6, 2020

No need to on our account unless the next version of babel will support node 8 🙂

I opened up nicolo-ribaudo/babel-preset-current-node-syntax#1 as well for the other error

@SimenB SimenB merged commit 44a960d into jestjs:master Apr 7, 2020
@SimenB SimenB deleted the node-syntax-preset branch April 7, 2020 17:42
jeysal added a commit to mmkal/jest that referenced this pull request Apr 10, 2020
…pshots

* upstream/master: (225 commits)
  docs: add CLA link to contributing docs (jestjs#9789)
  chore: roll new version of docs
  v25.3.0
  chore: update changelog for release
  chore(jest-types): correct type testRegex for ProjectConfig (jestjs#9780)
  feat(circus): enable writing async test event handlers (jestjs#9397)
  feat: enable all babel syntax plugins (jestjs#9774)
  chore: add helper for getting Jest's config in e2e tests (jestjs#9770)
  feat: pass ESM options to transformers (jestjs#9597)
  chore: replace `any`s with `unknown`s (jestjs#9626)
  feat: pass ESM options to Babel (jestjs#9766)
  chore(website): add copy button the code blocks (jestjs#9750)
  chore: bump istanbul-reports for new uncovered lines design (jestjs#9758)
  chore: correct CHANGELOG.md (jestjs#9763)
  chore(jest-types): expose type `CacheKeyOptions` for `getCacheK… (jestjs#9762)
  docs: Fix simple typo, seperated -> separated (jestjs#9760)
  v25.2.7
  chore: update changelog for release
  fix: drop getters and setters when diffing objects for error (jestjs#9757)
  chore(jest-types): correct return type of shouldRunTestSuite fo… (jestjs#9753)
  ...
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants