Home

>

Tools

>

Strapi

>

Releases

>

5.0.0-rc.11

Strapi Release: 5.0.0-rc.11

Pre Release

Tag Name: v5.0.0-rc.11

Release Date: 8/21/2024

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 v5.0.0-rc.11 introduces important migration tools with new codemods to help developers transition to v5, fixes draft relation counting in the Content Manager, and adds restrictions to prevent naming conflicts in the Content-Type Builder. This release continues to refine the v5 experience with developer-focused improvements for a smoother upgrade path.

Highlight of the Release

    • New codemods to assist with v5 migration for lifecycle hooks
    • Fixed draft relation counting in Content Manager list views
    • Added codemod for useRBAC import statement updates
    • Added codemod for useAPIErrorHandler import path changes
    • Restricted strapi prefixes in Content-Type Builder to prevent conflicts

Migration Guide

Migrating to v5.0.0-rc.11

Lifecycle Hooks

Use the provided codemods to help with commenting out lifecycle hooks that need migration. The codemods will add descriptive comments to guide you through the necessary changes.

Import Path Updates

  1. For useRBAC imports:

    • Run the codemod to update import paths
    • The codemod preserves aliases and adds import statements after other import statements
  2. For useAPIErrorHandler imports:

    • Run the codemod to change imports to @strapi/strapi/admin

Content-Type Builder Restrictions

  • Avoid using strapi prefixes in your content type names as these are now restricted
  • Review any existing content types that might use these prefixes and rename them

Upgrade Recommendations

This release contains important migration tools and fixes for Strapi v5. If you're already testing v5 release candidates, upgrading to rc.11 is recommended to take advantage of the new codemods that will help with your migration process.

For developers working on plugins or custom code that uses lifecycle hooks or the affected import paths, this update is particularly important as it provides tools to help with the transition.

The upgrade process should be straightforward:

npm install @strapi/[email protected]

After upgrading, consider running the new codemods to help with migration tasks.

Bug Fixes

Content Manager Improvements

  • Fixed an issue where draft relations were being counted in the list view, causing inaccurate relation counts (#20973)

New Features

Migration Codemods

  • Added codemods to comment out lifecycle hooks with descriptions for migration to v5
  • Created a codemod for updating useRBAC import statements to the new path
  • Implemented a codemod for changing useAPIErrorHandler import to @strapi/strapi/admin
  • Abstracted changeImportSpecifier as a utility method for codemods

These codemods will help developers migrate their Strapi v4 projects to v5 by automatically updating import paths and providing guidance on lifecycle hook changes.

Security Updates

No security fixes were mentioned in this release.

Performance Improvements

No specific performance improvements were mentioned in this release.

Impact Summary

This release focuses on easing the migration path to Strapi v5 by providing automated tools (codemods) that help developers update their code. The addition of these codemods represents a significant investment in developer experience, making the transition to v5 less manual and error-prone.

The fix for draft relation counting improves the accuracy of the Content Manager interface, providing content editors with more reliable information about their content relationships.

The restriction of strapi prefixes in the Content-Type Builder is a breaking change that prevents potential naming conflicts with internal Strapi components. While this might require renaming some content types, it prevents future issues that could arise from namespace collisions.

Overall, this release continues to refine the v5 experience with a focus on migration tooling and interface accuracy.

Full Release Notes

Statistics:

File Changed57
Line Additions420
Line Deletions134
Line Changes554
Total Commits6

User Affected:

  • Benefit from new codemods to help migrate lifecycle hooks and import statements to v5
  • Need to adapt to restricted prefixes in Content-Type Builder
  • Must update import paths for useRBAC and useAPIErrorHandler

Contributors:

jhoward1994Marc-RoigBassel17innerdvations