The Sailscasts Blog

← Back to blog

Boring Stack 0.3.0

Kelvin Omereshone

In this Boring Stack release, the starter templates have all been upgraded to Shipwright 0.2.0, which brings some performance gains and better DX to TBJS in terms of asset handling.

Asset versioning

Before version 0.3.0, you had to manually update the version configuration in config/inertia.js every time you updated your app to burst the browser cache when you deployed.

This was because there was no way to dynamically inject the script and style tags to leverage the Rsbuild asset filename hash in production builds.

That means, you no longer have the concern of versioning your asset manually as this will be done automatically for you going forward.

Chunk splitting for better performance

Since we weren’t relying on Rsbuild to generate the asset filenames, we also could not rely on the amazing chunk splitting strategies Rsbuild provides out of the box.

With this release, we now rely on the 'split-by-experience' chunk splitting strategy provided by Rsbuild.

See the full changelog on GitHub.

✅ Upgrading

To upgrade to 0.3.0, do the following:

Install the latest version of Shipwright

npm i sails-hook-shipwright@latest -D

Update app.ejs

Replace the script and link tags for your app.js and app.css respectively with the new shipwright.scripts() and shipwright.styles() methods, which will inject the scripts and style tags respectively so the file looks like this:

<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <%- shipwright.styles() %>
    <div id="app" data-page="<%= JSON.stringify(page) %>"></div>
    <%- shipwright.scripts() %>

P.S: If you haven’t starred the project yet, please give it a star ⭐️ on GitHub.