Home

>

Tools

>

Strapi

>

Releases

>

5.0.0-rc.0

Strapi Release: 5.0.0-rc.0

Pre Release

Tag Name: v5.0.0-rc.0

Release Date: 6/26/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.0 marks a significant milestone in the evolution of the headless CMS, introducing a complete architectural overhaul with TypeScript integration, improved database handling, and a modernized admin interface. This release candidate brings major performance improvements, enhanced developer experience, and new features like Content History while maintaining backward compatibility through migration tools. It's a foundational release that sets the stage for the future of Strapi with better scalability, maintainability, and extensibility.

Highlight of the Release

    • Complete TypeScript integration throughout the codebase
    • New Document Service API for better data handling and relations
    • Content History feature for tracking and restoring previous versions
    • Improved Draft & Publish workflow with better relation handling
    • Modernized admin UI with updated design system and navigation
    • Enhanced database handling with identifier shortening and migrations
    • Upgrade tool with codemods for easier migration from v4
    • Better performance with optimized database queries and caching

Migration Guide

Upgrading from Strapi v4 to v5

Strapi v5 includes an upgrade tool to help you migrate from v4. Here's how to use it:

  1. Install the upgrade tool:

    npm install @strapi/upgrade@latest -g
    
  2. Run the upgrade command in your project directory:

    strapi upgrade v5
    
  3. Follow the interactive prompts to upgrade your project.

The upgrade tool will:

  • Update your dependencies
  • Run codemods to update your code
  • Migrate your database schema
  • Update your configuration files

Key Breaking Changes to Be Aware Of:

  1. TypeScript Integration:

    • The codebase is now fully TypeScript
    • You may need to update your custom code to work with TypeScript
  2. Database Changes:

    • MySQL v5 is no longer supported, use MySQL 8+
    • Only better-sqlite3 package is supported for SQLite
    • mysql2 is now used as the package for MySQL
  3. API Changes:

    • Create endpoints now return 201 status code instead of 200
    • Entity Service is deprecated in favor of Document Service
    • Content API validate input in create and update controllers
  4. Admin UI Changes:

    • React Router updated to v6+
    • Styled Components updated to v6
    • Many helper-plugin components and utilities have been moved or removed
  5. Configuration Changes:

    • Configuration filenames are now restricted
    • Some environment variables have been moved to configuration
    • Default log level is now 'http'

For detailed migration instructions and handling specific features, please refer to the official Strapi v5 migration guide.

Upgrade Recommendations

For Production Environments: This is a release candidate (RC) version, so we recommend waiting for the final stable release before upgrading production environments. Use this time to test the upgrade process in a staging environment and identify any potential issues specific to your implementation.

For Development/Testing Environments: We highly recommend upgrading development and testing environments to v5.0.0-rc.0 to familiarize yourself with the new features and changes. This will help you prepare for the eventual upgrade of your production environment.

Upgrade Process:

  1. Create a complete backup of your database and codebase
  2. Use the official upgrade tool: npm install @strapi/upgrade@latest -g && strapi upgrade v5
  3. Test thoroughly after upgrading, especially custom plugins and extensions

Dependencies to Check:

  • Ensure you're using Node.js 18 or higher
  • If using MySQL, ensure you're on version 8+
  • If using SQLite, ensure you're using better-sqlite3

Custom Code Considerations:

  • Review any custom plugins or extensions for compatibility
  • Update any code that uses deprecated APIs like Entity Service
  • Check for TypeScript compatibility issues in your custom code

The upgrade to v5 is substantial but brings significant improvements in developer experience, performance, and features that make it worthwhile for most users.

Bug Fixes

Content Manager

  • Fixed issues with blocks editor selection and rendering
  • Fixed displayed fields drag-and-drop functionality
  • Fixed navigation issues when switching between content types
  • Fixed issues with relation fields in the content editor
  • Fixed date and time field format on saving
  • Fixed issues with filters for relations, enums, and UIDs
  • Fixed self-referencing relations
  • Fixed content manager header spacings

Content History

  • Fixed crash when viewing versions with added media or relation fields
  • Fixed sanitization of history versions data
  • Fixed duplicate history versions on publish
  • Added proper handling for relations in history versions

Draft & Publish

  • Fixed discard action in different locales than the default one
  • Fixed validation errors in bulk publish operations
  • Fixed modified entry status in bulk publish

Database

  • Fixed dropping foreign keys before dropping indexes
  • Fixed creation of locale column when migrating from v4
  • Fixed handling of document ID in data transfer

UI/UX

  • Fixed main navigation issues and styling
  • Fixed media library interface issues
  • Fixed confirmation dialog button colors
  • Fixed date picker timezone issues

New Features

Document Service API

A new Document Service API has been introduced to replace the Entity Service, providing better handling of data, relations, and document status. This service is designed to be more consistent and easier to use, with improved error handling and validation.

Content History

Track and restore previous versions of your content with the new Content History feature. This allows you to see what changes were made, when they were made, and by whom, and to restore previous versions if needed.

Enhanced Draft & Publish

The Draft & Publish feature has been significantly improved, with better handling of relations, validation, and UI. You can now see which related content is in draft mode when publishing, and bulk publish/unpublish content more efficiently.

Language Selector for Code Blocks

The blocks editor now includes a language selector for code blocks, making it easier to format and highlight code in your content.

Improved Bulk Actions

New and improved bulk actions for publishing, unpublishing, and deleting content, with better confirmation dialogs and error handling.

Client Router API

A new client router API has been added to make it easier to navigate between pages in the admin panel.

Audit Logs

Enhanced audit logs for better tracking of system changes and user actions.

Security Updates

Authentication & Authorization

  • Enhanced RBAC (Role-Based Access Control) middleware
  • Improved validation of input in content API controllers
  • Better handling of user passwords in the Users & Permissions service

API Security

  • Improved validation of query parameters to prevent potential exploits
  • Enhanced sanitization of history versions data
  • Better handling of GraphQL authentication with GET requests

General Security

  • Updated dependencies to address potential security vulnerabilities
  • Improved error handling to prevent information leakage

Performance Improvements

Database Optimizations

  • Added database identifier shortening to prevent issues with long identifiers
  • Improved database schema handling with better naming functions
  • Enhanced database migrations with better logging and error handling
  • Optimized database queries for better performance

Admin Panel Performance

  • Switched to Vite as the default bundler for faster builds and HMR
  • Updated to React 18.3 for better rendering performance
  • Improved state management with Redux Toolkit Query for better caching
  • Reduced bundle size by removing unnecessary dependencies
  • Optimized component rendering with better memoization

API Performance

  • Improved query parameter validation and handling
  • Enhanced relation counting logic for better performance
  • Better handling of deep sorting to prevent duplicate rows
  • Optimized populate mechanism for relations

Impact Summary

Strapi v5.0.0-rc.0 represents a fundamental evolution of the platform, transitioning to a fully TypeScript-based architecture with significant improvements to core systems. This release focuses on developer experience, performance, and maintainability while introducing valuable new features like Content History.

The impact on developers is substantial, with a completely modernized codebase that leverages TypeScript for better type safety and developer tooling. The new Document Service API provides a more consistent and powerful way to interact with content, while database improvements enhance performance and reliability. The upgrade tool with codemods significantly eases the migration process from v4.

For content editors, the new Content History feature transforms how content changes are tracked and managed, allowing for better collaboration and content governance. Improvements to the Draft & Publish workflow, especially around relation handling, make content management more intuitive and error-resistant.

Administrators benefit from enhanced RBAC, better audit logging, and improved webhook management, providing more control and visibility into system operations.

API consumers will notice more consistent responses, better validation, and improved handling of relations, making integration with Strapi more reliable and predictable.

While this is a breaking change release with significant architectural updates, the provided migration tools and documentation aim to make the transition as smooth as possible. The improvements in performance, developer experience, and feature set make this upgrade highly valuable for most Strapi users.

Full Release Notes

What's Changed

Full Changelog: v4.25.1...v5.0.0-rc.0

Statistics:

File Changed109
Line Additions1,603
Line Deletions676
Line Changes2,279
Total Commits21

User Affected:

  • Complete TypeScript integration for improved type safety and developer experience
  • New document service API for better data handling
  • Modernized codebase with updated dependencies (React 18.3, React Router v6)
  • Enhanced configuration system with better validation
  • Improved database handling with identifier shortening and migration tools

Contributors:

FeranchzConvlyremidejmadhurisandbhoralexandrebodinsimotae14derrickmehaffyjhoward1994Marc-Roig