DEV Community

Loftie Ellis
Loftie Ellis

Posted on • Originally published at loftie.com

Gridsome 0.7 Released!

Gridsome is a new static site generator based on the JAMstack, and it is the underlying software powering my blog at https://loftie.com/. If you have ever heard of Gatsby, well Gridsome is the vue.js equivalent, and they just released a new version with some cool improvements.

New Schema API

This is be biggest improvement for me. Gridsome used to simply infer the GraphQL schema from the data passed on startup, which works well if all the data is present, but I started to run into issues where some nested entries (eg tags) were not correctly discovered.

With the Schema API you can now define your fields yourself:

api.loadSource(({ addSchemaTypes }) => {
  addSchemaTypes(`
    type Post implements Node {
      title: String
    }
  `)
})

You dont have to specify all the fields either, Gridsome can still automatically infer the fields that you know will be present and only specify the deeper ones. To do that simply pass the @infer extension.

type Post implements Node @infer {
    title: String
}

Other Changes

  • Vue Remark plugin - Lets you add vue components to markdown files-
  • New template configuration - More consistent way to specify template routes
  • Custom App.vue - Useful if you want for example a <transition> component around the <router-view>- And some more, see the full list here

Check out Gridsome for yourself at https://gridsome.org/

Top comments (0)