Home

>

Tools

>

Strapi

>

Releases

>

5.0.0-alpha.0

Strapi Release: 5.0.0-alpha.0

Pre Release

Tag Name: v5.0.0-alpha.0

Release Date: 3/19/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-alpha.0 introduces significant architectural changes and new features, marking the first alpha release of Strapi's next major version. Key improvements include a new Document Service replacing the Entity Service, enhanced content history tracking, optional Draft & Publish functionality, database optimizations, and modernized frontend dependencies. This release focuses on improving developer experience with better TypeScript support, streamlined configuration, and updated tooling, while removing support for older technologies like MySQL v5.

This alpha release represents a substantial step forward in Strapi's evolution, with breaking changes that will require migration planning for existing projects. It's intended for early testing and feedback, not production use.

Highlight of the Release

    • New Document Service API replacing the Entity Service with improved functionality
    • Content History feature for tracking and managing content versions
    • Draft & Publish is now optional and disabled by default
    • Enhanced TypeScript support with improved type definitions
    • Database optimizations including support for long identifiers
    • Modernized frontend with React Router v6+ and Vite as default bundler
    • New upgrade tool to help migrate from v4 to v5
    • Improved i18n with locale attributes extended to every content type

Migration Guide

Preparing for Migration to Strapi v5

Important: This is an alpha release and not intended for production use. Use it for testing and providing feedback only.

Database Changes

  1. MySQL Requirements:

    • MySQL v5 is no longer supported
    • Update to MySQL 8+ before migrating
    • The package has changed from mysql to mysql2
  2. SQLite Changes:

    • Only better-sqlite3 package is supported
    • If using another SQLite package, switch to better-sqlite3

API Changes

  1. Entity Service to Document Service:

    • The Entity Service is now deprecated and delegates to the Document Service
    • Update your code to use the Document Service API directly
    • Review the Document Service documentation for the updated API
  2. HTTP/HTTPS to Fetch API:

    • strapi.fetch now uses the Fetch API
    • Replace any direct usage of http/https modules with Fetch API
  3. GraphQL Changes:

    • Updated to Apollo v4
    • Review your GraphQL queries and mutations for compatibility

Admin Interface Changes

  1. Helper Plugin Changes:

    • Many components have been moved from helper-plugin to the admin package
    • Components removed: GenericInput, CheckPermissions, DynamicTable, and more
    • Update imports to use components from their new locations
  2. React Router Update:

    • Updated to React Router v6+
    • Review and update your custom admin routes
  3. Webpack to Vite:

    • Vite is now the default bundler
    • Webpack aliases have been removed
    • Update your plugin development setup if needed

Draft & Publish Changes

  1. Disabled by Default:

    • Draft & Publish is now disabled by default
    • Enable it explicitly for content types that need it
    • Review your content types and enable as needed
  2. Migration Process:

    • When enabling/disabling Draft & Publish, data migration will occur
    • Test this process thoroughly in a non-production environment

Configuration Changes

  1. File Structure:

    • Config filenames are now restricted
    • Review your configuration files for compatibility
  2. Environment Variables:

    • Many env-only values have been refactored into configuration
    • Update your environment setup accordingly
  3. Logging:

    • Default log level is now 'http' (previously 'info')
    • Adjust your logging configuration if needed

Using the Upgrade Tool

Strapi provides an upgrade tool to help with migration:

# When v5 is stable, you'll use:
npx @strapi/upgrade

The tool will:

  1. Analyze your project
  2. Update dependencies
  3. Run codemods to update your code
  4. Guide you through manual changes needed

Testing Your Migration

  1. Create a copy of your v4 project
  2. Run the upgrade tool on the copy
  3. Test thoroughly before applying to production
  4. Pay special attention to custom code, plugins, and extensions

Upgrade Recommendations

for Strapi v5.0.0-alpha.0

Who Should Upgrade

This is an alpha release intended for:

  • Developers who want to explore and provide feedback on Strapi v5
  • Teams planning for future migration who need to understand the scope of changes
  • Plugin developers who want to start adapting their plugins for v5

Who Should Wait

  • Production environments should not upgrade to this alpha release
  • Projects with critical stability requirements
  • Teams without resources to handle potential issues and breaking changes

Upgrade Path

  1. For Testing Only: Create a separate environment for testing v5.0.0-alpha.0
  2. Wait for Stable Release: For production environments, wait for the stable v5.0.0 release
  3. Prepare: Review the migration guide and start planning your upgrade strategy
  4. Plugin Compatibility: Check if your essential plugins have v5 compatibility plans

Preparation Steps

  1. Update to the latest v4.x release before planning your v5 migration
  2. Ensure your database is compatible (MySQL 8+ or better-sqlite3)
  3. Review your custom code for dependencies on deprecated features
  4. Test the upgrade tool in a non-production environment
  5. Document any custom implementations that might be affected by the architectural changes

Technical Requirements

  • Node.js 18 or higher recommended
  • MySQL 8+ if using MySQL (v5 no longer supported)
  • better-sqlite3 if using SQLite
  • Updated frontend dependencies for admin customizations

When the stable v5.0.0 is released, a comprehensive upgrade guide with step-by-step instructions will be provided.

Bug Fixes

Core Fixes

  • Re-added deleted afterSync hook that was accidentally removed
  • Fixed unique field validation per content type and locale
  • Fixed unique and UID validation logic
  • Fixed validation when validating locale by removing regex validation
  • Fixed issues with query populate validation

Admin Interface Fixes

  • Fixed content-manager navigation issues
  • Fixed list-view delete action
  • Fixed errors leaking from draft to published tab
  • Fixed CM access when using custom conditions
  • Fixed issues with creating entries in content manager
  • Fixed failed dynamic chunk loading

Database Fixes

  • Fixed infinite loop opening pool connections in MySQL
  • Fixed updated_at value when enabling Draft & Publish

Plugin Fixes

  • Added React resolutions into root package.json to fix dependency conflicts
  • Fixed content-releases test rendering
  • Fixed i18n modal to close after successful locale creation

Content Management Fixes

  • Fixed CM metadata when Draft & Publish is disabled
  • Fixed document status computation based on locale
  • Fixed history page back button functionality
  • Fixed history version refetching on mount
  • Fixed single-types fetching in history

New Features

Core Architecture

  • Document Service: New API replacing Entity Service with improved functionality for content management
  • Content History: Track and manage content versions with history tracking capabilities
  • Optional Draft & Publish: Now disabled by default and can be enabled per content type
  • Internal Migrations: Added support for database schema migrations
  • Document ID: Added document identification system

Database & Performance

  • MySQL 8+ Support: Removed support for MySQL v5, now using mysql2 package
  • SQLite Improvements: Only supporting better-sqlite3 package for SQLite
  • Database Naming: Added centralized methods for handling database identifiers with support for shortening long identifiers
  • Connection Pool: Improved dialect initializations on every new connection in the pool

Developer Experience

  • TypeScript Enhancements:

    • Added types for configuration files
    • Improved type inference for subtypes in Attribute.Relation properties
    • Support for models and content types in DTS generation
  • Modern API Usage:

    • Using Fetch API for strapi.fetch instead of http/https modules
    • Updated to Apollo v4 for GraphQL
  • Configuration Improvements:

    • Refactored env-only values into configuration
    • Added logger level to server config
    • Restricted config filenames

Admin Interface

  • Vite Integration: Made Vite the default bundler for the admin
  • React Router Update: Updated to use react-router@6+
  • Relation Improvements: Added drag-and-drop functionality to relations
  • UI Enhancements: Various design updates and component refactoring

Internationalization

  • Extended i18n: Locale attributes extended to every content type
  • Locale Handling: Improved validation for locales and better handling of relations with locales

Tools

  • Upgrade Tool: New comprehensive tool to help migrate from v4 to v5
  • CLI Testing: Initialized CLI e2e testing framework with seeding capabilities

Security Updates

Authentication & Authorization

  • Made policy error messages public for better debugging while maintaining security
  • Updated Users & Permissions plugin configuration with register.allowedFields defaulting to an empty array for improved security
  • Enhanced validation for unique fields per content type and locale to prevent potential data conflicts

Content Protection

  • Added protection to history page with proper permission checks
  • Improved handling of Draft & Publish status in relations to prevent unauthorized access to unpublished content

API Security

  • Updated authentication providers with a new native Keycloak provider for Users & Permissions
  • Improved error handling in the Document Service to prevent potential information leakage

Database Security

  • Removed support for older MySQL v5 in favor of more secure MySQL 8+
  • Enhanced database connection handling to prevent potential connection leaks

Performance Improvements

Database Performance

  • Optimized database schema with improved naming conventions
  • Added support for shortening long database identifiers to improve compatibility
  • Enhanced connection pool handling for MySQL with better dialect initializations
  • Improved query performance with refactored database schema

Admin Interface Performance

  • Switched to Vite as the default bundler for faster build times and improved development experience
  • Refactored content manager to use redux-toolkit-query for more efficient data fetching
  • Removed circular dependencies to improve module loading performance
  • Simplified code structure with flattened core files organization

API Performance

  • Replaced fast-deep-equal with lodash/fp isEqual for more consistent performance
  • Optimized fetch API usage instead of http/https modules
  • Improved content API response format with optimized headers

Build System

  • Removed webpack aliases and forced installing dependencies for more predictable builds
  • Simplified configuration setup to improve startup time
  • Streamlined core utils organization for better maintainability

Impact Summary

Strapi v5.0.0-alpha.0 represents a significant evolution of the Strapi CMS with substantial architectural changes that will impact developers, content managers, and system administrators. This alpha release introduces the new Document Service API, which replaces the Entity Service, providing a more robust foundation for content management. It also brings content history tracking, makes Draft & Publish optional (disabled by default), and enhances internationalization by extending locale attributes to every content type.

On the technical side, the release modernizes Strapi's stack by adopting Vite as the default bundler, upgrading to React Router v6+, and improving TypeScript support. Database handling has been optimized with better naming conventions, support for long identifiers, and removal of support for older technologies like MySQL v5 in favor of MySQL 8+ and better-sqlite3 for SQLite.

The admin interface has undergone significant refactoring, with many components moved from the helper-plugin to the admin package, and new features like drag-and-drop for relations. The upgrade tool has been enhanced to help with migration from v4 to v5, which will be essential given the breaking changes in this release.

As an alpha release, v5.0.0-alpha.0 is not intended for production use but provides developers with an early look at Strapi's future direction. Organizations should use this release for testing and planning purposes, while continuing to use v4 for production environments until the stable v5.0.0 is released.

Full Release Notes

What's Changed

Full Changelog: v4.20.5...v5.0.0-alpha.0

Statistics:

File Changed12
Line Additions260
Line Deletions257
Line Changes517
Total Commits1

User Affected:

  • Need to adapt to the new Document Service API which replaces Entity Service
  • Must update database configurations as MySQL v5 support has been removed
  • Will need to use better-sqlite3 package for SQLite as it's now the only supported option
  • Need to update code that uses fetch API which now replaces http/https for requests
  • Will benefit from improved TypeScript support and configuration types

Contributors:

alexandrebodin