Roots Discourse

Sage 9 In Production?

So I’m about to embark on rebuilding an old Sage theme (Sage 6.5.2) and much prefer the asset pipeline & build process that Sage 9 uses, along with some of the other improvements Sage 9 introduces (Bootstrap 4, etc.) over Sage 8.

While Sage 9 isn’t ready as a stable release, I was curious if anyone is using it in production and whether they’ve been able to do so without significant issues. I’m aware there’s always bugs and especially since there’s a large shift not just with Sage itself but with also moving to Bootstrap 4, which is currently in Alpha.

If you have used Sage 9 in a production environment, what have the biggest challenges been, outside of using webpack?

i’ve been using 9 for a new theme and it was going pretty well.

However i’ve hit a bit of a wall. There’s no documentation on how you change options for installed packages like browsersync as there is no longer a gulp or grunt file and they’re not ready to answer questions about it yet.

Someone with more expertise can correct me if I’m wrong, but try adding your BrowserSync options in this file: https://github.com/roots/sage/blob/master/assets/build/webpack.plugin.browsersync.js

Specifically:

module.exports = class {
  constructor(options) {
    this.watcher = null;
    this.compiler = null;
    this.options = mergeWithConcat({
      proxyUrl: 'https://localhost:3000',
      // add your options here
      callback() {},
    }, options);
  }

https://github.com/roots/sage/tree/master/assets/build also contains other settings relevant to the way your theme will build, ala gulpfile.js.

@dpc There’s no documentation (regarding your issue with browsersync) because config.json uses a standard format for configuring your packages - this has already been explained. In this case, the issue you’ve referenced was actually a bug, and has already been fixed, though @drawcardau 's solution would also work.

Bear in mind Sage 9 is undergoing very rapid development, so any issues are likely to not going to be current even days after posting them.

2 Likes

Sorry to bump this but I did forget to add - I’m using Sage 9 rather successfully on a couple of websites (though they’re not visible to the public just yet.) I’ve even managed to swap out Bootstrap for Bourbon + Neat without any issues, since I didn’t want to use alpha BS4.

Overall I’m finding Sage 9 quite stable and I haven’t had any major hangups. I am loving Webpack too, it is really quick in comparison to Gulp - it takes a couple of seconds to compile SCSS vs. 15+ seconds I was getting with Gulp.

The PHP template side of things is fairly much the same as Sage 8, as others have said here before, the biggest changes are in the compile process and folder structure, and once you get your head around that, it’s pretty straightforward. There is also some emerging documentation to get you going.

As we all know, alpha software is alpha and stuff changes. But if you’re comfortable with that, and have a plan in process to upgrade any themes you build to stable (eg using git) then it’s time to dip the toe in the water :slight_smile:

2 Likes

Sorry to bump this again @drawcardau! I was searching around and found a Github link to your Thyme project, but it seems to have gone missing. Can you point me in the direction to info on working Bourbon+Neat+Bitters into Sage 9? I’m fairly new to Webpack.

Thanks for any input man!

To answer my own question, I added Bourbon & Neat with Yarn and then:

  @import "~bourbon/app/assets/stylesheets/bourbon";
  @import "~bourbon-neat/app/assets/stylesheets/neat";

Yep that’s basically it :slight_smile: Bitters is something you copy and paste from their website, so I didn’t really see a need to integrate it into Thyme.

Thyme is currently on hiatus until I’ve gotten to know Sage 9 Beta a bit better - a lot has changed since the Alpha stage, and Thyme would need a bit of re-tooling to bring it up to speed. The Bootstrap project is advancing a bit as well (which is encouraging) so I may end up keeping BS in there as is, and adding Bourbon / Neat on top. We’ll see what emerges in the coming weeks!

Anyone know if there’s a schedule for a stable Roots 9 release? I’m starting on a new project the following weeks and I’m decided whether to wait for a stable release or go with the current beta release.

My personal opinion is that Beta is a lot closer to final than Alpha. At least that felt like the case with previous releases of Sage / Roots. You should probably be OK with using it now, but bear in mind some components (eg Bootstrap 4) are still in flux, and to be 100% safe you should consider using it in a parent / child theme setup, or be comfortable with merging new releases via GIT.

If you have any doubts at all though it’s best to stick to Sage 8.5.0 which is still quite nice, and I still use that for projects that cannot tolerate any fluctuations in the ecosystem.

Bootstrap 4 is still in flux, but it’s easy enough to import a new version of the assets. It’s bringing down a new version of Sage into a project that has me considering waiting until the final release before starting a new theme with it.

1 Like

I am too sleep deprived to remember how I did it, but I built this site in Sage 9 + MaterializeCSS a couple of weeks ago: http://www.unitymakes.us/

I didn’t have too many problems and it was good enough to deploy. There are still some issues I need to work out when I have the time, but nothing show stopping.

That turned out alright! How tricky was it to integrate Material? Did you pull it in with Yarn / Webpack?