Strapi v4.2.0 fourth beta for TypeScript support

Strapi 4.2.0-beta.3 Release

Fourth beta for TypeScript support


Hello everyone, we’re releasing the fourth iteration of Strapi TypeScript support. It’s available now under the tag 4.2.0-beta.3.

You can find the Github release here.

:tada: What’s New

TL;DR:

:bug:

  • Fix some light typings issues

  • Fix a bug showing JS-related instructions when generating a plugin in TypeScript

:rocket:

  • 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


:mag_right: Changes in Details

:bug: Fix some light typings issues

Related PRs: #13290, #13289

Some typings issues for the factories and the entity-service have been fixed.

:bug: Fix a bug showing JS-related instructions when generating a plugin in TypeScript

Related PR: #13133

In the last release, when generating a TypeScript plugin, the instructions logged in the console were using JavaScript filenames and syntax.

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

Related PR: #13378

Based on some feedback concerning compilation time in development mode, we’ve decided to enable by default incremental builds for the server code.

It should boost performance when working with a large codebase.

:rocket: Handle custom outDir configuration

Related PR: #13309

It’s now possible to set the outDir property of the tsconfig.json file to something else than dist. Users can now choose their preferred wording for it.

:rocket: Added root-level typings for the Strapi class (StrapiInteface)

Related PR: #13281

While still really basic, those new typings should better match the actual shape of the Strapi class and thus prevent incorrect type errors.

They’ll also provide a solid basis on which we’ll iterate in order to provide better typings in the future.

:rocket: Added TS support for all CLI commands

Related PR: #13187

In the previous beta releases, some Strapi CLI commands were missing support for TypeScript as they weren’t able to detect the outDir directory. It’s now automatically detected and used if necessary.

:rocket: Force incremental build for some CLI commands

Related PR: #13245

Optimization of the build time by forcing the incremental build option on CLI commands. It should boost performances on CI environments.


:eyes: What’s coming?

In the next TS releases we would like to:

  • Polish and finalize working on the TypeScript support documentation to offer better support

  • Add typings for some core entities of Strapi (schemas, etc…)

  • Automatic types generation based on application code and configuration

  • JS to TS project conversion


As always, thanks for your support, your criticism, your feedback and your ideas. You rock! :heart:

5 Likes