StudioCMS has reached version 0.1.0-beta.19 and with this new version we have done a ton of work refactoring the internals to not only run faster, but to be cleaner and better optimized across the board. This is the Effect Update.

To really get this started, in this update we introduced the Effect library, as per their website “Effect is a powerful TypeScript library designed to help developers easily create complex, synchronous, and asynchronous programs.”

What started as a test with just a few bits and pieces of our codebase turned into an all-out refactor. As we started implementing Effect into our code, we noticed improved speeds and better performance of our code in general. This was something that no one on our team was really sure what would happen, because yes, Astro and StudioCMS use TypeScript under the hood, but how exactly would Effect play into this type of already complex environment? The answer, shockingly well!

Our entire StudioCMS core codebase, including our SDK, helpers, auth, Astro API routes, and even middleware, is now Effect based. Using custom helper utilities to even add full logging and error handling for every aspect of the code. No more non-specific errors!

The best part about Effect is you get a response type similar to the following Effect.Effect<Success, Error, Requirement> where the Success is the final type of your response (shown as a generic in this example). If there is an error you get the actual defined error, these can be unions of multiple errors once you start combining multiple Effects together! So you can create complex programs, while still maintaining FULL type safety!

The refactor to Effect wasn’t just a small change - it was comprehensive. Here’s what we migrated:

We’ve created a comprehensive suite of Effect utilities in lib/effects/ including:

The move to Effect has brought several key improvements:

Type Safety: With Effect’s strongly typed error handling, we now know exactly what can go wrong and when. No more mysterious runtime errors!

Better Error Messages: Every error is now specific and actionable, making debugging significantly easier.

Improved Performance: Effect’s optimized execution model has led to noticeable speed improvements across the board.

Composability: Effects can be easily combined and composed, making our codebase more modular and maintainable.

This update wasn’t just about Effect - we also made some important modernization decisions:

We’ve updated our Node.js support to Node 20 and higher only. This allows us to take advantage of the latest Node.js features and performance improvements.

The configuration system has been completely refactored. The new config structure is more intuitive and fully typed when using TypeScript. You can now use studiocms.config.ts instead of studiocms.config.js for full type safety!

We’ve migrated the Image Service system into our plugin architecture. Setting an imageService now requires adding an ImageService plugin to your plugin array and configuring the preferredImageService in your features settings.

Thanks to our core maintainer @dreyfus92, we’ve completely removed the Google Fonts dependency and implemented a local font system. This resolves network blocking issues and improves performance for sites that don’t need external font loading.

With this massive refactor complete, we’ve laid the groundwork for even more improvements in future releases. The Effect-based architecture will make it easier to add new features, improve performance, and maintain code quality.

The entire StudioCMS team is excited about these changes and we can’t wait to see what you build with this more robust, type-safe, and performing version of StudioCMS!

When upgrading to Beta 19, please pay special attention to:

  1. Configuration changes - Review and update your studiocms.config.mjs or migrate to studiocms.config.mts
  2. Node.js version - Ensure you’re running Node 20 or higher
  3. Image Service plugins - If you’re using image services, update your plugin configuration
  4. SDK usage - The old SDK functionality is now deprecated in favor of the new unified Effect-based SDK

As always, check our documentation for the latest migration guides and examples.


Want to contribute to StudioCMS? Check out our GitHub repository and check out our Discord to join our growing community of developers building the future of content management!



Back to Blog