Skip to content

v0.14.0

Compare
Choose a tag to compare
@agilgur5 agilgur5 released this 21 Sep 21:05
· 21 commits to master since this release

BREAKING CHANGES

Slightly Breaking Changes

Node 10+

Updated the required Node version from 8 to 10.

While previous versions of TSDX began deprecating support for Node 8, it was not officially dropped.
In this release, we have officially dropped Node 8: TSDX now requires Node 10+ as many dependencies that were upgraded similarly do.

This should not impact most users as Node 8 has been EoL for ~9 months now.
Many packages had already required Node 10+ and the vast majority already have support for it.
Most users are on Node 12 or Node 14 already.

Jest 25

Updated the Jest version used by tsdx test from 24 to 25.

The main breaking change in Jest 25 is the upgrade of the default JSDOM environment from JSDOM v11 to JSDOM v15.
For most Jest users, this change either has no impact or will reduce configuration if you've manually set a more up-to-date jest-environment-jsdom in your jest.config.js.
In some rare cases, where code relied on the old version of JSDOM, this may result in breakage.

ts-jest and jest-plugin-typeahead have also been upgraded to support Jest 25.

Babel Changes

babel-plugin-transform-async-to-promises -> babel-plugin-polyfill-regenerator

async-to-promises has been unmaintained for around a year now and has several correctness issues, many of which have affected TSDX users. For that reason, we've switched to using babel-plugin-polyfill-regenerator instead, which will add a pure, non-polluting regenerator-runtime polyfill if your targets require it.

The vast majority of browsers (94.37%) now support async/await and generators with no polyfilling necessary, but the default preset-env will add it. If you don't already have one, we recommend adding a .browserslistrc (or preset-env targets) to specify the environments you're targeting.

This should be totally backward-compatible, but it may change the output quite a bit, including making bundles larger due to inclusion of regenerator-runtime.

babel-plugin-macros

TSDX's internal Babel plugin ordering has changed, moving babel-plugin-macros to be first.
This was done in order to support several use-cases like styled-components/macro, which previously did not work due to the ordering.

This shouldn't really break anything, but there is an off chance it might have an impact on some rare builds.

Improvements

  • Jest 25 / JSDOM 15 usage per above
  • Due to the babel-plugin-polyfill-regenerator change above, TSDX now supports polyfilling generators out-of-the-box. Previously we only supported async/await with babel-plugin-transform-async-to-promises and required users to configure their own plugins for generator polyfilling
  • styled-components/macro support per above
  • A --max-warnings flag has been added to tsdx lint, which works the same as ESLint's --max-warnings flag

Template Improvements

  • Storybook template has been updated to Storybook v6, which significantly simplifies the config and adds some features
  • Storybook template has now been configured to type-check during Storybook builds
  • size-limit has been added to all templates for bundle analysis via NPM/Yarn scripts and a GitHub Action
  • All templates' GitHub Actions now have matrix testing for different Node versions and OSes out-of-the-box
  • All templates' GitHub Actions now have simplified config and improved caching using bahmutov/npm-install
  • All templates' tsconfig.json now set skipLibCheck, forceConsistentCasingInFileNames, and noEmit
    • The former two are now recommended by TS and the latter one is just a usability improvement for those who use tsc for type-checking. skipLibCheck will also greatly increase performance of tsc's type-checking
  • All templates' tsconfig.json now have detailed comments explaining nearly every configuration option in use

Docs

  • patch-package is now officially listed as a customization option

Dependencies

  • Jest 25 and Node 10+ per above. Most deps were updated by a major or two.
  • @babel/preset-env was updated to the latest minor to support nullish coalescing and optional chaining without additional plugins, as well as to update the compatibility table.
    • If you have snapshots that rely on specific output from preset-env or Autoprefixer, as TSDX's internal test suite does, you may need to update those snapshots.
  • All vulnerabilities and deprecation warnings should now be resolved
  • Due to some upgrades, clean-up, and use of yarn-deduplicate, overall install size should have decreased a good bit

Commits

Lists of commits:

Improvements

Bugfixes

  • change: replace useBuiltIns with polyfill-regenerator (#795) 6e405d5
  • change: replace async-to-promises with regenerator (#795) 2aefc3d
  • (fix): change plugin order to make styled-components/macro work (#644) 6d7257c

Template Improvements

  • feat: type-check stories during Storybook build (#876) f1ddccb
  • feat: add test matrix to all templates' CI (#882) 8449699
  • fix: use @bahmutov/npm-install in templates' CI (#882) f109fe9
  • Remove redundant CI=true from templates' github workflows (#870) 6ba173f
  • docs: add comment that noUnused* overlaps with an ESLint rule (#864) e50bc51
  • docs: add comments for nearly all tsconfig options in use (#864) 10a6137
  • feat: add noEmit to templates' tsconfigs (#864) c802b8b
  • feat: add skipLibCheck and forceConsistentCasingInFileNames (#864) e0f79fe
  • feat: add size-limit bundle size analysis tool to templates (#705) 2938ed9
  • update react-with-storybook template for Storybook v6 (#805) 51e47a7

Docs

  • docs: remove reference to Node 10+ req for create (#881) a95d2d8
  • multi-entry: temporarily change docs to singular "module" (#862) ac98a73
  • docs: capitalize 'S' in TypeScript (#752) da4b189
  • docs: add patch-package reference to Customization section (#855) 08a8ef8
  • docs: update features and comparison with changes from past year (#847) 1619bc1
  • docs/fix: missing "to" infinitive marker (#843) 49fb303

Dependencies

  • deps: upgrade several more deps' majors (#879) a9434f9
  • deps: update extractErrors plugin's evalToString file (#878) 0e45050
  • deps: update extractErrors Babel plugins to Babel 7 (#878) 33a6bde
  • license: add FB License header to all extractErrors code (#878) 2caad24
  • Migrate from rollup-plugin-babel to @rollup/plugin-babel (#789) f592595
  • fix/deps: dependabot YAML doesn't support anchors/aliases (#850) f8b8317
  • env/deps: remove greenkeeper.json, configure dependabot.yml (#846) 45aea66
  • deps: upgrade Babel preset-env, remove now redundant plugins (#838) 8e2d750
  • clean/deps: remove unused Babel plugins: transform-runtime, dynamic-import (#837) 485e04b
  • deps: apply yarn-deduplicate and add deduplicate script (#683) d053912
  • security/deps: audit fix several deps' vulnerabilities (#824) 4966edd
  • (deps): upgrade to Jest 25 (#679) 116a043
  • (deps): upgrade several deps' majors; require Node 10+ (#678) e018210

GitHub

  • github: use envinfo for getting versions in issue reports (#820) 349f299

Internal

  • ci: make internal job names more consistent w/ templates' (#882) 49a3521
  • ci: update matrix to use Node 14 instead of Node 13 (#880) dac1fd7
  • clean: bad whitespace and Flow types in extractErrors (#878) 2d0f279
  • test: compatible targets shouldn't insert regeneratorRuntime (#795) 794e5ad
  • test: add an async syntax regression test (#795) 814c83b
  • refactor/test: move generator test to build-default (#795) 2f8544d
  • ci: add deduplicate:check script and run on precommit and CI (#683) 22133ce
  • deps: update np to fix MFA bug during publishes (#816) fff9a43

All Contributors

Commit Range

v0.13.3...v0.14.0


Postscript

Apologies again for the delay on getting to v0.14.0, COVID added a lot of stress and work had been busy, to say the least. Unfortunately I wasn't able to get to all the changes I wanted to into it, but v0.14.0 has been waiting long enough. Only two complex issues were left out and many more PRs added in, though not everything had made it into v0.13.x either.

I also wanted to push Rollup 2, TS 4.0, Prettier 2, and ESLint upgrades into this, but the breaking changes in the changelog started getting too big, so I decided to wait a bit to split those changes across more releases to not throw too much breakage at users at once.

If you're wondering, all of my co-workers, my team, and I were suddenly laid off just over a week ago, so that's why I had time (and want to distract myself) to push out ~2 dozen PRs the past week 😕

Best wishes and stay safe to everyone!