Home

>

Tools

>

Strapi

>

Releases

>

4.0.0-beta.2

Strapi Release: 4.0.0-beta.2

Pre Release

Tag Name: v4.0.0-beta.2

Release Date: 10/4/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-beta.2 represents a significant milestone in the v4 migration, introducing major architectural changes, UI improvements, and new features like API Token authentication. This beta release focuses on stabilizing the new design system, enhancing developer experience, and improving cross-platform compatibility, particularly for Windows users.

Highlight of the Release

    • New API Token authentication system for secure API access
    • Refactored middleware system with programmatic loading
    • Improved Dynamic Zones UI with CSS grid layout
    • Enhanced GraphQL schema generation and query capabilities
    • Better Windows compatibility and cross-platform support
    • Improved relation management in the Content Manager
    • Enhanced localization interface with new locale picker

Migration Guide

Upgrading to v4.0.0-beta.2

This is a beta release of Strapi v4, which includes significant architectural changes from v3. If you're migrating from v3, please refer to the comprehensive migration guide in the official documentation.

For users already on v4 alpha or earlier beta releases, here are key changes to be aware of:

Middleware Changes

The middleware system has been refactored to use programmatic loading. If you've created custom middlewares, you'll need to update them to the new format.

API Authentication

If you're using API authentication, the new API Token system provides enhanced security and management capabilities. You may need to regenerate your tokens and update your authentication logic.

GraphQL Schema

The GraphQL schema generation has been completely refactored. If you're using GraphQL, test your queries thoroughly as there might be breaking changes in how filters and relations are handled.

Component Relations

Component relations in the Content-Type Builder have been fixed. If you were experiencing issues with component relations, they should now work correctly, but you may need to verify your existing relations.

Windows Users

This release includes significant fixes for Windows compatibility. If you were experiencing issues running Strapi on Windows, many of these should now be resolved.

Upgrade Recommendations

For development environments: We recommend upgrading to this beta release to test your applications against the latest changes in Strapi v4. This will help you prepare for the final release and provide valuable feedback to the Strapi team.

For production environments: As this is a beta release, it is not recommended for production use. There may still be breaking changes and stability issues before the final v4 release.

Upgrade Process:

  1. Back up your existing Strapi project
  2. Update your package.json to reference v4.0.0-beta.2 for all Strapi packages
  3. Delete your node_modules folder and package-lock.json (or yarn.lock)
  4. Run npm install or yarn install
  5. Test your application thoroughly, particularly areas affected by the changes in this release

If you encounter issues, please report them on the Strapi GitHub repository with detailed information about your environment and the steps to reproduce.

Bug Fixes

UI and UX Fixes

  • Fixed horizontal overflow in action layout
  • Fixed WYSIWYG editor issues
  • Corrected webhook empty list button size
  • Fixed link component styling in login page
  • Resolved RBAC icon alignment issues
  • Fixed delete button in Content Manager
  • Corrected badge tooltip in Content Manager table
  • Fixed overflow issues in various components
  • Resolved user navigation and popover positioning

Authentication and User Management

  • Fixed case sensitivity issues with email addresses (now stored in lowercase)
  • Resolved 401 error with axios instance
  • Fixed user sorting in admin interface
  • Corrected user counter in Users & Permissions role list view

Content Management

  • Fixed required date validation
  • Resolved issues with empty values handling
  • Fixed switch locale functionality
  • Corrected Content-Type Builder menu behavior
  • Fixed pagination select size

Cross-platform Compatibility

  • Fixed Windows support by using path.join for resolving admin/src
  • Resolved plugin loading issues on Windows
  • Fixed invalid action name on restart caused by lowercase conversion

New Features

API Token Authentication System

A complete API Token authentication system has been implemented, allowing for more secure and manageable API access. This includes:

  • POST endpoint to create API tokens
  • PUT endpoint to update tokens
  • Secure storage with hashed access keys in the database
  • Scope matching and verification for token permissions
  • Integration with the content API authentication strategy

Enhanced Relation Management

The Content Manager now features improved relation handling:

  • Support for select-one and select-many relations
  • Better UI for managing related content
  • Improved component relations in the Content-Type Builder
  • Fixed transform operations for repeatable components

Improved Localization Interface

  • New locale picker with Select component
  • Display of selected locale in the interface
  • Clickable content availability cells
  • Fixed locale switching issues

Dynamic Zones Improvements

  • Added CSS grid layout for better content organization
  • Removed double borders for cleaner UI
  • Added border to nested components for better visual hierarchy
  • Error handling and notifications for Dynamic Zones

Security Updates

Authentication Security

  • Implemented secure storage of API token access keys using hashing
  • Improved scope matching and verification for API tokens
  • Enhanced policy API with better permission comparison

User Authentication

  • Now storing emails in lowercase to prevent case-sensitivity exploits
  • Added /api prefix for better security isolation
  • Improved validation and required checks for sensitive operations

Performance Improvements

GraphQL Optimizations

  • Refactored GraphQL schema generation for better performance
  • Improved query capabilities with better filters
  • Fixed component filters input typename to avoid conflicts
  • Added RelationResponseCollection for better data handling
  • Optimized pagination for associations

System Architecture Improvements

  • Refactored middleware loading and configuration
  • Implemented programmatic middleware approach
  • Optimized plugin resolution from packages or paths
  • Improved lifecycle function calls with standardized parameters
  • Enhanced component transform operations

Impact Summary

Strapi v4.0.0-beta.2 represents a significant step forward in the v4 migration process, focusing on stabilizing the new architecture and improving developer experience. This release brings substantial improvements to the admin UI, particularly for Dynamic Zones and relation management, while also enhancing the backend with a new API Token authentication system and refactored middleware handling.

The most impactful changes include the new API Token system, which provides better security and management for API access, and the improved relation handling in the Content Manager. Windows users will benefit from numerous fixes that improve cross-platform compatibility.

For developers, the refactored GraphQL schema generation and middleware system offer more flexibility and better performance, though they may require adjustments to existing code. Content editors will appreciate the enhanced UI for Dynamic Zones and the improved localization interface.

This beta release continues to solidify the foundation of Strapi v4, bringing it closer to production readiness while addressing feedback from earlier alpha and beta releases. While not yet recommended for production use, it provides a good opportunity for developers to test their applications against the latest changes and prepare for the final v4 release.

Full Release Notes

Changes

  • Fixes windows support
  • Fixes UI bugs

Statistics:

File Changed300
Line Additions6,121
Line Deletions1,841
Line Changes7,962
Total Commits250

User Affected:

  • New API Token authentication system for better API security and management
  • Refactored middleware system with programmatic middleware loading
  • Improved GraphQL schema generation and query capabilities
  • Enhanced cross-platform compatibility, especially for Windows users
  • Updated package dependencies across the system

Contributors:

ElhebertsoupettealexandrebodinronronscelestesConvlypetersg83HichamELBSIMcastres