February 1st, 2018

Statamic 3 Progress

We're hard at work on the next big version of Statamic.

It’s no secret that we’re hard at work on the next major version of Statamic. We’ve chatted in Slack about it, we’ve mentioned things on Twitter, but have yet to blog about it. We feel we’re far enough along that it’s time to share some of the things you have to look forward to.

Spoiler alert: There’s a lot more Laravel

Keep in mind that this is all still in development. The following information may change.

The “Big Idea” behind v3

The guiding force of this next major version is to make Statamic more customizable and open. We don’t have too many game-changing user features planned, but rather are focusing hard on the framework and architecture in such a way to make future game-changing, mind-blowing, productivity-enhancing, retro-t-shirt-wearing features more possible.

For this reason, we will not be charging for the v3 upgrade. We all will benefit from v3, so we want to lower the barrier as far as possible in hopes that we can get everyone upgraded. We are doing our best to make the upgrade as automatic as possible, but there will inevitably be a few things you’ll need to do by hand.

It will be much more “Laravelly”!

Statamic v2 was built on top of Laravel 5.1 and packaged up into a bundle. Statamic v3 will be a self-contained Laravel package, designed for Laravel 5.6+. There are a quite a few benefits to this approach, especially if you’re a PHP developer.

Your website will be a “real” Laravel application

Your Statamic will be an instance of the laravel/laravel application itself. If and when you want to pop the hood and customize system behavior or add functionality, the framework itself is now the limit, not Statamic. You can make your own routes, controllers, classes, composer dependencies, and whatever else you can think of, just like a vanilla Laravel app. You’ll no longer need to create a Statamic addon just to add one little thing.

For those who don’t need this flexibility (which might still be the majority of you), we will also be providing a ready-to-go Statamic package, just like v2. You’ll hardly notice a difference.

You will be able to install Statamic into an existing Laravel app

If you ask us “How can I use Statamic with my Laravel app?” today, the answer is kind of awkward. You need to run it separately - in a subdomain, subdirectory, or with a set of complex server rewrite rules. Then you can make the two apps talk to each other. Kinda.

With v3, if you have a Laravel app and you want Statamic to handle the marketing pages and blog? No problem. composer require statamic/cms and you’re nearly done.

You can stay on the cutting edge

Statamic 2 consumed Laravel as a dependency, which means you’re “stuck” on the version we provide and support. No longer so in v3! You control the laravel/framework dependency in your composer.json, so you can update whenever you like. Hello Laravel 5.6.x!

It will be contributor friendly (open repo on Github)

The Statamic source code will be in a public Github repo. Everyone will be able to contribute; whether a pull request, bug report, or comment about a ridiculous commit message. Like when Jack “fixes tpyos”.

Are we asking you to contribute? Certainly not! But if you enjoy popping the hood and tinkering, want to help translate the control panel, or have some other cool idea, it’s now possible. Statamic won’t be “Open Source”, but neither will it be private. With an open repo, Composer now becomes a tool instead of a barrier.

It will also let you stay on the very cutting edge without having to wait for patch releases. If we fix a little bug that’s holding up your progress, you won’t need to ask for a custom build, a cherrypicked fix, or a 1 commit patch release.

Antlers templates will have a new naming convention

Our beloved templating language – Antlers – will have its file-type upgraded from a plain .html extension to .antlers.html. This will allow IDEs to better detect when you’re working in a Statamic template vs a regular HTML file.

Not only that, but the filename convention can better allow for additional template parsers in the future.

The organization of a “theme” will be much simpler

99% of the time the site/themes directory has just one theme in it. Statamic is so good at bespoke sites, and data models are so unique, that inter-compatibility between themes isn’t a very common occurrence.

In v3, your “theme” will be located in /resources. Just like a like a regular Laravel app. On that same note, there’s no longer separate templates, partials, and layouts directories. Just put all your files inside views and arrange things however you like.

This lets your gulp, grunt, or webpack files stay in the root of your project, and those who use the command line often won’t miss the regular trips to cd site/themes/theme_name to get things done.

That doesn’t mean you won’t be able to design and build “Themes” from a design standpoint. We fully expect the theme area of the perpetually-coming-soon Marketplace to be a thriving place. It’ll just be more clear that these theme packages are for new sites, rather than existing sites (which was always the case anyway).

We’re embracing configuration files

We decided to take a step back and think about the way we manage the various settings and types of settings in v2. If you’ve spent any significant time building sites in v2 you may feel that the configuration area of the Control Panel (or settings YAML file area) feels a bit…disorganized. Like a big grab bag full of random stuff. While it was a big improvement over v1, we’ve learned a lot in the last few years, and it’s time to change a few things.

Configuration vs Content Modeling vs Preferences

There are several distinct types of settings. Some affect the whole system and are usually set once and left alone, like cache modes. Some only affect the Control Panel fieldtypes, like Redactor configs. Some are merely preferences that affect only certain areas of the Control Panel, like Dashboard Widgets. They’re all mixed together like a bad Hawaiian t-shirt.

In v3 we’re going to be moving all those “developery” things, like system and caching settings, to Laravel-style PHP config files. There’s no real need for everyone to tinker with them in the Control Panel. The consequences of turning on Static file Caching without understanding its nuances may be unwelcome, like a slap bracelet to the face.

The Control Panel’s settings area will be trimmed down to things that affect the Control Panel, and things that are more preference-driven. Like Fieldset and Form builders, Widgets, Permissions, and the like.

Goodbye (to our over-engineered implementation of) Flysystem!

Statamic v1 was a rough and simple tool, but it had one big advantage over v2. You could use symlinks. You could put addons or content folders in one place and toss symlinks around like Johnny Appleseed.

But as the story goes, in v2 we used the Flysystem package to abstract the way we interacted with the filesystem. We thought it would give us more flexibility because you could connect to all different file systems, like s3, Dropbox, and FTP. But it turns out, it wasn’t all that useful most of the time, and Flysystem didn’t support for “arbitrary” symlinks. We kind of made a mess of the implementation.

In v3 we return to our bare metal file-touching roots. Things that belong in the local filesystem (content, form submissions, etc) will remain there, and we’ll interact with them directly. You probably won’t even notice a difference, except now you can use symlinks again.

However, Asset Containers will still use Flysystem under the hood. You’ll be able to hook into Laravel’s native file storage disks for any container. This means that you can put your assets in Amazon S3, Rackspace, or FTP server. And that covers a real-world use case, and leverages Flysystem the way it was intended. And everyone is happy. And there was much rejoicing.

And that’s not all!

But that’s all we have to share today. We’d love to hear your feedback! You know where to find us. We want everyone involved as much as you wish to be. Stay tuned for more updates as we get closer to something that resembles a beta!

Waiting

One More Thing™

If you’re wondering if you should wait until v3 to jump into Statamic, the answer is no way! Don’t wait. Everything you’ll love about v2 will be in v3, and there’s no upgrade fee. So get going! Build!