Modular 4.0.0

New Features

  • Node 18 Support
  • Added support for TypeScript 4.5.3 and above
  • Updated Jest to 29.3
  • Support for a dedicated Modular configuration file
  • Overhauled modular build command to now support --decendant and --ancestor flags that can be combined with existing flags for selective building, such as building only changed packages and their dependants (see also “Breaking Changes”)
  • Updated modular test command interface to align with modular build behaviour (see also “Breaking Changes”)
  • App type modular packages are no longer required to be private
  • Modular source package type has been introduced for packages that are never built
  • LICENSE files are now copied over when building packages
  • modular test testing pattern now includes .jsx
  • Fixed modular build crashing when selected workspace(s) are not in packages directory
  • Changed default TypeScript version of newly created Modular repos with create modular-react-app to ^4.8.3

Breaking Changes

Upgraded to Jest 29

Jest has been bumped up three major versions from Jest 26, and it comes with a number of breaking changes.

We suggest reading through the following migration guides:

Some noteworthy breaking changes:

  • Changed default snapshot formatting options to {escapeString: false, printBasicPrototype: false} as outlined by this blogpost - Any snapshots tests will have to be updated with the new format, or you can override the snapshotFormat option to the old defaults.
  • As of Jest 28 jest-environment-jsdom is no longer shipped with Jest and needs to be installed separately
  • Jest now includes full support of package.json exports - some existing imports might not resolve correctly

Upgraded to ESLint 8

ESLint has been bumped up from version 7 to 8. As with all major version changes, read through their migration guide for more information.

The biggest impact will likely be linting errors from new rules introduced with the update.

Removed Commands

We no longer provide the following commands:

  • modular convert
  • modular init
  • modular port
  • modular rename

Refer to the How To section for instructions on how to manually complete the tasks previously covered by these commands.

test / build commands interface changed

  • modular test now accepts package names as arguments instead of regular expressions. Regular expressions are still accepted with the --regex option
  • modular test now supports all the selective options that modular build supports (multiple packages, changed, --ancestors, --descendants and all their combinations).
  • modular build without arguments now builds all the workspaces in the monorepo, in build order.

Other

  • Dropped support for TypeScript versions below 4.5.3
  • Jest --watchAll flag when running modular test is now false by default (Previously set to true unless running in CI)
  • Dropped support for minor versions of Node 14.17 and Node 16 version 16.9 and below
    • Now support Node ^14.18.0, >=16.10.0, and >=18.0.0
  • Dropped USE_MODULAR_WEBPACK environment variable, as Webpack is used by default. Use USE_MODULAR_ESBUILD env variable or useModularEsbuild in a modular configuration file to use esbuild
  • Changed default Content Delivery Network for ESM Views to esm.sh instead of Skypack, as it is no longer actively maintained. The CDN can still be configured through the EXTERNAL_CDN_TEMPLATE environment variable or through a modular configuration file.

Merged Changes

Patch Versions

Patch versions of this release do not have a dedicated summary. For details of patch releases, please visit the GitHub releases page.