Home

>

Tools

>

Strapi

>

Releases

>

4.0.0

Strapi Release: 4.0.0

Tag Name: v4.0.0

Release Date: 11/29/2021

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.0.0 is a major release that completely overhauls the CMS with a new UI based on a fresh design system, revamped plugin architecture, rebuilt database layer and query engine, modernized REST and GraphQL APIs, and introduces API tokens for better security. This version represents a significant step forward in Strapi's evolution, focusing on developer experience, performance, and extensibility.

Highlight of the Release

    • Complete UI redesign with a new design system
    • New Plugin API for better extensibility
    • Rebuilt database layer and query engine for improved performance
    • Revamped REST and GraphQL APIs
    • Introduction of API Tokens for enhanced security
    • Standardized error format for better debugging
    • Restructured documentation

Migration Guide

Preparing for Migration

Before migrating from Strapi v3 to v4, make sure to:

  1. Back up your entire Strapi project, including the database
  2. Review the complete migration documentation
  3. Check plugin compatibility with v4

Database Changes

  • The database structure has changed significantly in v4
  • You'll need to adapt custom database queries to the new query engine
  • Relations are handled differently in v4

Plugin Updates

  • All plugins need to be updated to v4-compatible versions
  • Custom plugins will need to be rewritten using the new Plugin API
  • Check the plugin marketplace for v4 compatibility

API Changes

  • REST API endpoints and response formats have changed
  • GraphQL schema generation works differently
  • Update your frontend applications to work with the new API formats

Content Type Changes

  • Review your content types for compatibility issues
  • Adjust relations to match the new data structure
  • Update any custom components

Admin Customization

  • Admin customizations need to be rewritten using the new extension system
  • Use the new design system components for UI elements
  • Update custom admin pages to use the new Plugin API

Step-by-Step Migration

  1. Create a new Strapi v4 project
  2. Migrate your content types structure
  3. Transfer your data (consider using database tools or export/import)
  4. Reinstall and configure plugins
  5. Migrate custom code and extensions
  6. Test thoroughly before deploying to production

Upgrade Recommendations

For production applications: This is a major version release with breaking changes. We recommend thorough testing in a staging environment before upgrading production systems. Plan for a complete migration rather than an in-place upgrade.

For development projects: Consider starting new projects with v4 directly. For existing projects, evaluate whether to complete them on v3 or migrate to v4 based on your timeline and requirements.

Upgrade path:

  1. Do not attempt to upgrade a v3 project in-place to v4
  2. Create a new v4 project and migrate your content types, data, and customizations
  3. Follow the detailed migration guide in the documentation
  4. Test thoroughly before deploying to production

Plugin considerations: Ensure all required plugins have v4-compatible versions available before upgrading.

Timeline suggestion: Allocate sufficient time for the migration process, especially for complex projects with custom code and plugins. This is not a simple update but a migration to a new architecture.

Bug Fixes

General Bug Fixes

  • Fixed 500 error on create/update operations with empty body
  • Fixed issues with question order in CLI during project setup
  • Resolved problems with asset types and image handling
  • Fixed password icon color in authentication forms
  • Corrected pagination padding in list views
  • Addressed issues with empty component permissions
  • Fixed WYSIWYG editor hint display
  • Resolved issues with nested component resolvers in GraphQL
  • Fixed timestamps field display and handling
  • Corrected CSP configuration for Safari compatibility
  • Fixed relation target field in Content Type Builder
  • Resolved single type locale deletion issues

New Features

New Design System and UI

  • Complete overhaul of the admin panel UI with a modern, clean design
  • New design system providing consistent components and styling across the application
  • Improved navigation and content organization
  • Enhanced accessibility and responsiveness

Plugin Architecture

  • Completely redesigned Plugin API for better extensibility
  • More consistent extension points for developers
  • Improved plugin lifecycle management
  • Better separation of concerns between core and plugins

Database and Query Engine

  • Rebuilt database layer for improved performance and reliability
  • New query engine with optimized database operations
  • Better handling of complex queries and relationships
  • Improved data validation and integrity checks

API Improvements

  • Revamped REST API with more consistent endpoints and responses
  • Rebuilt GraphQL API with improved schema generation and query capabilities
  • Introduction of API Tokens for secure API access
  • Standardized error format across all APIs for better debugging

Security Enhancements

  • API Token system for fine-grained access control
  • Improved authentication and authorization mechanisms
  • Better security defaults out of the box

Developer Experience

  • Restructured documentation with improved guides and references
  • Better error messages and debugging information
  • More consistent internal APIs and patterns
  • Improved TypeScript support

Security Updates

Authentication and Authorization

  • Introduction of API Tokens for secure API access without sharing admin credentials
  • Improved validation of user inputs throughout the application
  • Better handling of sensitive data in responses

Data Protection

  • Enhanced permission system for more granular access control
  • Improved handling of user roles and capabilities
  • Better protection against common web vulnerabilities

Infrastructure Security

  • Updated Content Security Policy (CSP) configuration
  • Fixed CSP issues for Safari compatibility
  • Improved error handling to prevent information leakage

Performance Improvements

Database Performance

  • New database layer optimized for better query performance
  • Improved handling of complex relationships and nested data
  • More efficient data retrieval patterns

Admin Panel Performance

  • Optimized admin panel build process to reduce package size
  • Improved component rendering performance with the new design system
  • Better state management for reduced memory usage
  • Optimized media library for handling large numbers of assets

API Performance

  • More efficient REST API implementation with optimized controllers
  • Improved GraphQL query resolution for complex data structures
  • Better caching strategies for frequently accessed data

Build Process

  • Prebuild admin panel for faster startup times
  • Optimized package dependencies to reduce installation time
  • Improved watch mode for development

Impact Summary

Strapi v4.0.0 represents a complete reimagining of the Strapi CMS platform, with significant architectural changes that affect nearly every aspect of the system. This is not just an update but a full rebuild of the core framework.

The most immediate impact is on developers who will need to migrate existing projects from v3 to v4, which requires significant effort due to the architectural changes. The new Plugin API, database layer, and API formats mean that custom code will need to be rewritten to work with v4.

For content editors and administrators, the impact is generally positive, with a completely redesigned UI that improves usability and workflow efficiency. The new design system provides a more consistent and intuitive interface.

From a security perspective, the introduction of API Tokens offers better control over API access without sharing admin credentials, which is a significant improvement for production deployments.

Performance improvements in the database layer and query engine should result in better handling of large datasets and complex content structures, benefiting projects as they scale.

Overall, while the migration requires significant effort, the improvements in architecture, extensibility, security, and user experience make v4 a substantial step forward for the Strapi ecosystem.

Full Release Notes

🎉 v4.0.0 is here 🎉

💅 Features

  • New v4 UI
  • New Design system. Read more.
  • New Plugin API.
  • New Database layer and Query engine.
  • New REST API.
  • New GraphQL API.
  • API Tokens.
  • New Error standard format
  • Documentation restructuring. Read more.

Read more

Statistics:

File Changed300
Line Additions6,170
Line Deletions1,907
Line Changes8,077
Total Commits250

User Affected:

  • Need to migrate existing Strapi v3 projects to the new v4 architecture
  • Will benefit from the new Plugin API for easier extension development
  • Must adapt to the new database layer and query engine
  • Need to update REST and GraphQL API integrations to match new formats

Contributors:

ConvlyronronscelestesalexandrebodinsoupettevincentbproHichamELBSIremidejElhebertmarkkayloroscard0mpetersg83derrickmehaffy