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.
StudioCMS, Astro, and Effect
'Read the “', StudioCMS, Astro, and Effect, '” section'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!
What got the Effect Treatment?
'Read the “', What got the Effect Treatment?, '” section'The refactor to Effect wasn’t just a small change - it was comprehensive. Here’s what we migrated:
Core Systems
'Read the “', Core Systems, '” section'- Authentication System - Complete refactor of
lib/auth
to utilize Effect-TS - Mailer System -
lib/mailer
now runs on Effect with improved error handling - Notification System -
lib/notifier
converted to Effect-based architecture - SDK - Our entire SDK has been refactored to use Effect-TS, merging normal and cached functionalities
API Routes and Middleware
'Read the “', API Routes and Middleware, '” section'- All API Routes - From authentication endpoints to REST API routes, everything is Effect-based
- Middleware - All middleware files are now Effects with proper error propagation
- Dashboard API - Complete migration of dashboard API routes to Effect
Enhanced Developer Experience
'Read the “', Enhanced Developer Experience, '” section'We’ve created a comprehensive suite of Effect utilities in lib/effects/
including:
- SMTP Effect - Wrapping
nodemailer
for type-safe email operations - Logger utilities - Built specifically for Effect-based logging
- Error handling utilities - Consistent error management across the entire codebase
Performance and Developer Benefits
'Read the “', Performance and Developer Benefits, '” section'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.
Breaking Changes and Modernization
'Read the “', Breaking Changes and Modernization, '” section'This update wasn’t just about Effect - we also made some important modernization decisions:
Node.js Support
'Read the “', Node.js Support, '” section'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.
Configuration System Overhaul
'Read the “', Configuration System Overhaul, '” section'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!
Plugin System Enhancement
'Read the “', Plugin System Enhancement, '” section'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.
Font System Improvements
'Read the “', Font System Improvements, '” section'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.
What’s Next?
'Read the “', What’s Next?, '” section'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!
Upgrading
'Read the “', Upgrading, '” section'When upgrading to Beta 19, please pay special attention to:
- Configuration changes - Review and update your
studiocms.config.mjs
or migrate tostudiocms.config.mts
- Node.js version - Ensure you’re running Node 20 or higher
- Image Service plugins - If you’re using image services, update your plugin configuration
- 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!
Adam Matthiesen
Published 7/20/2025Back to Blog