Home

>

Tools

>

Strapi

>

Releases

>

4.2.0-beta.3

Strapi Release: 4.2.0-beta.3

Pre Release

Tag Name: v4.2.0-beta.3

Release Date: 5/24/2022

Strapi LogoStrapi

Open-source headless CMS built with Node.js. Provides developers with complete freedom in choosing their favorite tools and frameworks for frontend development.

TL;DR

Strapi v4.2.0-beta.3 continues to enhance TypeScript support with improved typings, better CLI command handling, and incremental builds by default. This beta addresses several bugs in TypeScript implementation and adds significant enhancements to make TypeScript development smoother in Strapi projects.

Highlight of the Release

    • Incremental build enabled by default in generated tsconfig.json files
    • Added root-level typings for the Strapi class (StrapiInterface)
    • Fixed TypeScript CLI commands to handle custom outDir configurations
    • Added TypeScript support for all CLI commands
    • Fixed bug showing JavaScript instructions when generating TypeScript plugins

Migration Guide

No migration is required for this beta release. This is a continuation of the TypeScript support implementation in Strapi v4.2.0.

If you're already using a previous beta version with TypeScript:

  1. Update your Strapi version to v4.2.0-beta.3
  2. If you've manually configured your tsconfig.json files, consider enabling the incremental option for better build performance
  3. Take advantage of the new StrapiInterface typings for better type safety when working with the global Strapi instance

Upgrade Recommendations

This release is recommended for developers who are:

  1. Currently testing Strapi with TypeScript
  2. Developing plugins with TypeScript
  3. Experiencing issues with TypeScript CLI commands or build configurations

As this is a beta release, it's not recommended for production environments. However, testing this release in development environments is encouraged to provide feedback on TypeScript support before the final v4.2.0 release.

Bug Fixes

TypeScript-related Fixes

  • Fixed a bug showing JavaScript-related instructions when generating a plugin in TypeScript
  • Fixed issues with CLI commands when using custom output directories
  • Fixed missing StrapiInterface export
  • Fixed factories typings
  • Fixed handling of TypeScript compilation when executing CLI commands
  • Fixed error handling when outDir folder doesn't exist

New Features

TypeScript Enhancements

  • Incremental Build Support: Now enabled by default in generated tsconfig.json files, significantly improving build performance for TypeScript projects
  • Root-level Strapi Typings: Added typings for the global Strapi class (StrapiInterface), making it easier to work with the Strapi instance in TypeScript
  • CLI Command TypeScript Support: All CLI commands now fully support TypeScript, including proper handling of custom output directories
  • Force Incremental Build: Some CLI commands now force incremental builds for better performance
  • Custom outDir Support: CLI commands now correctly handle custom outDir configurations in tsconfig.json

Database Typings

  • Added missing WhereParams attributes to the type definition in @strapi/database

Security Updates

No specific security fixes were mentioned in this beta release.

Performance Improvements

Build Performance

  • Incremental TypeScript Builds: Now enabled by default in generated tsconfig.json files, which significantly reduces compilation time for subsequent builds
  • Optimized CLI Commands: Force incremental build for some CLI commands to improve execution speed
  • Better TypeScript Compilation: Improved TypeScript compilation process for CLI commands, making development workflows more efficient

Impact Summary

This beta release significantly improves the TypeScript development experience in Strapi by addressing several pain points:

  1. Better Developer Experience: Incremental builds, improved typings, and fixed CLI commands make TypeScript development smoother and more efficient.

  2. Enhanced Type Safety: The addition of root-level Strapi typings (StrapiInterface) and improved database typings provide better type checking and code completion.

  3. Build Performance: Incremental builds enabled by default will significantly reduce compilation times during development.

  4. Plugin Development: Fixed issues with TypeScript plugin generation and added better support for TypeScript in the plugin development workflow.

These improvements collectively move Strapi closer to full TypeScript support, making the framework more accessible to TypeScript developers and improving code quality through better type checking.

Full Release Notes

๐ŸŽ‰ Whatโ€™s New

๐Ÿ› Fixes

  • Fix some light typings issues
  • Fix a bug showing JS-related instructions when generating a plugin in TypeScript

๐Ÿš€ Enhancements

  • Use incremental build by default in the generated tsconfig.json files

  • Handle custom outDir configuration

  • Added root-level typings for the strapi class (StrapiInterface)

  • Added TS support for all CLI commands

  • Force incremental build for some CLI commands

  • You can read the full changelog here

Statistics:

File Changed292
Line Additions6,567
Line Deletions6,530
Line Changes13,097
Total Commits239

User Affected:

  • Improved TypeScript support with better typings and incremental builds
  • Fixed issues with CLI commands when using custom output directories
  • Better handling of TypeScript configurations in plugin generation

Contributors:

cupofnestoriicdiiDanieleAurilioderrickmehaffykayac-changsunnysonxmarincatanjamidwyerWalkingPizzae23thrpetersg83markkaylorConvlyBassel17ronronscelestesremidejbglidwelldavefvdependabot[bot]vincentbproalexandrebodinfingegtahaziaucipointoutrgoupilKrito1997heartlessnanlonnie-nguyensargreal