Home

>

Tools

>

Strapi

>

Releases

>

4.0.0-beta.18

Strapi Release: 4.0.0-beta.18

Pre Release

Tag Name: v4.0.0-beta.18

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-beta.18 introduces unique field validation, fixes several critical bugs in the Content Manager and Admin UI, and improves the overall stability of the CMS. This release focuses on enhancing data integrity with the new unique validator while addressing issues with localization, content type management, and UI components.

Highlight of the Release

    • Added unique field validation support in the Content Manager
    • Fixed critical localization bug with single type deletion
    • Improved UI components with updated design system
    • Enhanced security with admin helmet fixes
    • Optimized build process to reduce package size

Migration Guide

No major migration steps are required for this beta release. However, if you're using custom plugins that interact with content types, you should test them thoroughly after upgrading to ensure compatibility with the fixed content type deletion handling.

If you've implemented custom validation logic for unique fields, you may want to review and potentially replace it with the new built-in unique validator.

Upgrade Recommendations

This beta release contains important bug fixes and new features that improve the stability and functionality of Strapi v4. We recommend all developers currently using v4.0.0-beta.17 to upgrade to this version.

The upgrade process should be straightforward:

npm install [email protected]
# or
yarn upgrade [email protected]

After upgrading, restart your Strapi application and verify that all functionality works as expected, particularly if you're using localization features or have custom plugins.

Bug Fixes

Content Manager Fixes

  • Fixed label overflow issues on the edit settings view in the Content Manager
  • Fixed permissions handling with locales, ensuring proper access control
  • Fixed single type locale deletion that was causing data inconsistency
  • Fixed content type list display in relations within the Content Type Builder
  • Fixed plugin crashes when content types are deleted

Admin UI Fixes

  • Fixed admin helmet configuration for improved security
  • Fixed accordion styling in Users & Permissions roles section
  • Fixed hidden attributes in Users & Permissions plugin
  • Improved handling of content type extension by using assign to preserve keys

CLI and Build Process Fixes

  • Added project name validation check in the CLI to prevent errors
  • Fixed URL joining issues
  • Optimized the build process by deleting the admin build before rebuilding to prevent file accumulation and reduce package size

New Features

Unique Field Validation

The most significant addition in this release is the new unique validator, which allows developers to enforce uniqueness constraints on their content types. This feature:

  • Validates that field values are unique across entries of the same content type
  • Optimizes database queries by only selecting the id field when checking uniqueness
  • Intelligently skips validation when the attribute value remains unchanged
  • Provides proper validation feedback in the Content Manager UI

Design System Updates

The design system has been updated with several UI improvements:

  • Added radius to link user wrapper for better visual consistency
  • Improved accordion styling in the Users & Permissions plugin

Security Updates

Admin Security Improvements

  • Fixed admin helmet configuration to ensure proper security headers are set
  • Improved validation functions to better handle edge cases

Performance Improvements

Build Process Optimization

  • The admin build is now deleted before rebuilding, preventing file accumulation and reducing the final package size
  • Added yarn cache to GitHub workflow steps using actions/setup-node for faster CI builds

Database Query Optimization

  • Optimized unique validation by only selecting the id field in the findOne query
  • Improved validation performance by skipping unique validation when attributes remain unchanged

Impact Summary

This beta release significantly improves Strapi v4's stability and feature set by introducing unique field validation and fixing several critical bugs. The unique validator enhances data integrity capabilities, allowing developers to enforce uniqueness constraints on their content types without custom code.

The fixes for localization, content type management, and UI components address pain points reported by users and improve the overall experience. The optimization of the build process will result in smaller package sizes and faster deployments.

For developers, the improved CLI functionality and fixed content type extension mechanism provide a more reliable development experience. Content editors will benefit from the UI improvements and better localization support, while administrators will appreciate the enhanced security and more consistent UI in the Users & Permissions plugin.

As Strapi v4 moves closer to a stable release, these improvements demonstrate the team's commitment to addressing feedback and enhancing the platform's core functionality.

Full Release Notes

Changes

  • Fix documentation plugin on CT deletion
  • Fix hidden attributes in U&P
  • Support unique fields in the CM
  • Fix localization bug
  • Fix admin helmet
  • Bump design system version

Statistics:

File Changed72
Line Additions2,480
Line Deletions568
Line Changes3,048
Total Commits40

User Affected:

  • Can now implement unique field validation for their content types
  • Will experience more reliable content type management with fixes for deletion and extension
  • Will benefit from improved CLI functionality with project name validation

Contributors:

HichamELBSIvincentbproalexandrebodinoscard0mronronscelestessoupette