Home

>

Tools

>

Strapi

>

Releases

>

3.0.0-alpha.20

Strapi Release: 3.0.0-alpha.20

Tag Name: v3.0.0-alpha.20

Release Date: 1/22/2019

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 v3.0.0-alpha.20 Release

This alpha release brings significant improvements to GraphQL data loading with the introduction of DataLoader for more efficient relationship handling. It also includes several bug fixes for user management, file handling in production mode, and GraphQL mutations. Key enhancements include event listeners and better linting for generated service files.

This release is particularly important for developers working with relational data in GraphQL, as it optimizes data fetching and resolves several issues with user management.

Highlight of the Release

    • Introduction of DataLoader for efficient GraphQL relationship handling
    • Fixed user CRUD mutations in GraphQL
    • Added event listeners for custom functionality
    • Improved production mode by avoiding unnecessary file writes
    • Better handling of uploads folder with proper gitignore configuration

Migration Guide

Migrating to v3.0.0-alpha.20

  1. Update your Strapi installation:

    npm install [email protected] [email protected] [email protected] --save
    

    Also update any other Strapi packages you're using to the same version.

  2. GraphQL Changes: If you're using custom GraphQL resolvers that interact with relationships, review them as the DataLoader implementation might affect their behavior.

  3. User Management: If you've implemented workarounds for user CRUD operations, you can now remove them as these issues have been fixed.

  4. File Structure: The release now properly handles the uploads folder. Make sure your .gitignore includes the public/uploads folder but keeps the .gitkeep file.

Upgrade Recommendations

This alpha release brings significant improvements to GraphQL performance and fixes several important bugs. If you're actively developing with Strapi v3 alpha and using GraphQL, upgrading is highly recommended to benefit from the DataLoader implementation and fixed user mutations.

For production environments, proceed with caution as this is still an alpha release. Test thoroughly in a staging environment before deploying to production.

Priority: Medium-High for GraphQL users, Medium for others

Effort: Low - Standard update process with minimal breaking changes

Risk: Low-Medium - As an alpha release, some instability may still be present

Bug Fixes

User Management Fixes

  • Fixed update user email functionality
  • Resolved issues with user CRUD mutations in GraphQL
  • Fixed deleteUser mutation for both Mongoose and Bookshelf

File Handling Improvements

  • Added uploads folder to generated gitignore
  • Added .gitkeep to public/uploads folder to ensure directory is tracked
  • Avoided writing files in production mode for better performance and security

GraphQL Query Fixes

  • Fixed where constraint in GraphQL queries
  • Fixed handling of relational fields in where clauses
  • Improved handling of limit, skip, start, and sort parameters

New Features

DataLoader Implementation

The major feature in this release is the implementation of DataLoader for GraphQL queries, which significantly improves performance when fetching related data:

  • Generic DataLoader for many-to-many relationships
  • Support for one-to-one and one-to-many relationships
  • Optimized data fetching by avoiding unnecessary populations
  • Cache reset on every request to ensure data consistency
  • Better handling of relational field queries

Event System Enhancement

  • Added listeners to events, allowing for more flexible custom functionality
  • Improved event handling architecture

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

GraphQL Performance Optimization

  • Implemented DataLoader to batch and cache database requests
  • Reduced redundant database queries when fetching related data
  • Reset loaders on every request to avoid incorrect cached results
  • Optimized population strategy to avoid unnecessary data fetching
  • Improved handling of relational data queries

Production Mode Optimization

  • Avoided unnecessary file writes in production mode
  • Better resource utilization in production environments

Impact Summary

The v3.0.0-alpha.20 release of Strapi represents a significant step forward in GraphQL performance optimization through the implementation of DataLoader. This change particularly impacts applications with complex relational data models, as it efficiently batches and caches database queries, reducing the N+1 query problem common in GraphQL implementations.

The fixes to user management resolve several pain points in the authentication system, making user operations more reliable. The production mode improvements enhance performance by avoiding unnecessary file operations.

For developers, the addition of event listeners provides more flexibility for extending Strapi's functionality with custom code. The improved linting for generated service files makes the codebase more maintainable.

Overall, this alpha release continues to refine Strapi's architecture and fix critical issues as it moves toward a stable v3 release, with particular emphasis on GraphQL performance and reliability.

Full Release Notes

Statistics:

File Changed66
Line Additions572
Line Deletions140
Line Changes712
Total Commits59

User Affected:

  • Benefit from optimized data loading with DataLoader implementation
  • Fixed issues with relational data queries and mutations
  • Better handling of one-to-many, many-to-many, and one-to-one relationships

Contributors:

AurelsicokopragonelauriejimabdonrdmaksugrSayegh7