Home

>

Tools

>

Ghost

>

Releases

>

4.0.0-alpha.0

Ghost Release: 4.0.0-alpha.0

Pre Release

Tag Name: 4.0.0-alpha.0

Release Date: 2/2/2021

Ghost LogoGhost

Open-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.

TL;DR

Ghost 4.0.0-alpha.0 introduces significant architectural changes and feature enhancements focused on improving the members system. This alpha release removes deprecated features, refactors the server boot process, and makes members functionality a core part of Ghost rather than an optional labs feature. Key changes include a new member status property, flattened subscription data structure, and improved server maintenance handling. This is an early prerelease intended for testing migrations and tooling.

Highlight of the Release

    • Members is now a core feature enabled for all sites by default
    • New status property added to members for easier filtering
    • Refactored server boot process using async/await for better readability
    • Improved maintenance mode with dedicated app serving 503 pages
    • Flattened members subscriptions data structure in the API

Migration Guide

Updating from Ghost 3.x to 4.0

Theme Developers

  • Portal-specific behavior must now be handled directly in themes rather than relying on backend special handling
  • The portal-action and requestSrc parameters have been removed
  • Update any code that filters members by the deprecated 'paid' parameter to use the new status property

API Users

  • The 'type' filter has been removed from the GET settings API
  • The send_email_when_published field has been deprecated and removed from the API
  • Update API calls that used the 'paid' parameter to filter members to use the new status property instead
  • Member subscription data is now directly on the member object as subscriptions rather than nested under stripe.subscriptions (v3 API serializer still uses the old format for backward compatibility)

Database Changes

  • The plan_nickname column is now nullable to match Stripe API behavior
  • A new status column has been added to the members table

Note that this is an alpha release intended for testing migrations and tooling. Full migration documentation will be available with the final 4.0.0 release.

Upgrade Recommendations

As this is an alpha release (4.0.0-alpha.0), it is not recommended for production use. This early prerelease is specifically intended to aid with testing of tooling and migrations.

If you're a developer or theme creator interested in preparing for Ghost 4.0, this release provides an opportunity to test your integrations and themes against the upcoming changes. Pay particular attention to the members-related changes and the new server boot process.

Wait for the final 4.0.0 release before upgrading production sites.

Bug Fixes

Process Exit on Members-API Fatal Errors

Added handling to force the process to exit when receiving an error from the members-api during initialization, addressing an issue where the process would hang indefinitely.

Fixed Database Initialization

Fixed an issue with awaiting database initialization that was missed during the server boot process refactoring.

New Features

New Member Status Property

A new status property has been added to members, making it easier to determine if a member is free or paid without relying on joins with customers and subscriptions tables. This simplifies filtering members via the API.

Dedicated Maintenance App

Ghost now includes a dedicated maintenance application that serves 503 pages when the server is in maintenance mode (e.g., during migrations). This decouples the server maintenance mode from the frontend, allowing for a cleaner separation of concerns.

Members Core Integration

Members functionality is now enabled for all Ghost sites by default, removing the need to enable it through labs settings. This includes dynamic keypair generation when settings are missing.

Security Updates

Private Mode Cookie Renamed

The cookie used for private mode has been renamed to improve security. This change means users who have already entered the site password will need to do so again.

Performance Improvements

Refactored Server Boot Process

The server boot process has been refactored to use async/await instead of nested promises, significantly improving code readability and maintainability. This change also allows for a clearer separation of initialization stages.

Optimized Express App Startup

Express applications now start after migrations are complete, decoupling server maintenance mode from frontend loading requirements. This results in a more efficient startup sequence.

Impact Summary

Ghost 4.0.0-alpha.0 represents a significant architectural evolution with a focus on making the members system a core part of the platform. The removal of the members labs flag means all sites will now have members functionality enabled by default, simplifying the overall experience.

The refactored server boot process using async/await improves code maintainability and sets the foundation for future enhancements. The new dedicated maintenance app provides a cleaner separation between server maintenance mode and the frontend, resulting in a more robust update process.

For developers, there are several breaking changes to be aware of, including the removal of portal-action and requestSrc parameters, the deprecated send_email_when_published field, and changes to how member subscription data is structured. Theme developers will need to handle Portal-specific behavior directly in their themes.

The addition of the status property to members simplifies filtering and improves performance by reducing the need for complex database joins. This change, along with the flattened subscription data structure, makes working with members data more straightforward.

As an alpha release, this version is primarily intended for testing migrations and tooling before the final 4.0.0 release.

Full Release Notes

Statistics:

File Changed66
Line Additions746
Line Deletions1,115
Line Changes1,861
Total Commits29

User Affected:

  • Need to adapt to the refactored server boot process using async/await
  • Must update code that relied on the deprecated `send_email_when_published` field
  • Should update any code referencing the removed portal-action and requestSrc parameters
  • Need to modify any code that accessed members subscription data via the nested `stripe.subscriptions` path

Contributors:

rshbhgrgtpatelnazallouisdaniellockyer