Yes, I agree that it all looks a lot easier with vNext.
Timeframe is in the next few months but a purely static is simple without Aurelia. Eventually we’re going to want some search and filter features.
I see customers with websites where they are adding more and more data to their CMS and creating huge monolithic websites. Not only does this become a nightmare to maintain, it becomes very slow especially when queries can’t hit the CDN cache. If your data doesn’t update in realtime, a database is usually a hindrance. Once you demonstrate the speed of a static site with client side search they’ll be impressed.
Gatsbyjs is particularly interesting because it doesn’t just limit your input data to markdown files. It can pull data from other files and sources or a headless CMS and presents it as a GraphQL API.
In development you get a GraphQL server which you can use to design your queries:
And then in your component you export the query and it gets passed to the component as data
:
import React from "react"
import { graphql } from "gatsby"
import Layout from "../components/layout"
export default ({ data }) => {
return (
<Layout>
<div>
<h1>My Site's Files</h1>
<table>
<tbody>
{data.allFile.edges.map(({ node }, index) => (
<tr key={index}>
<td>{node.relativePath}</td>
<td>{node.prettySize}</td>
<td>{node.extension}</td>
<td>{node.birthTime}</td>
</tr>
))}
</tbody>
</table>
</div>
</Layout>
)
}
export const query = graphql`
query {
allFile {
edges {
node {
relativePath
prettySize
extension
birthTime(fromNow: true)
}
}
}
}
`
There are also hooks to do extra things at build time, like build your search index, etc.
Because there are already dozens of non-react plugins, it would be a shame not to piggyback off their ecosystem but the core does seem pretty well tied to react.
I tried to clone the Gatsby repository to take a look at how easy it would be to swap out react but I was working on 3G yesterday so it never completed.
It looks like I could use @aurelia/jit-html-jsdom
to render an Aurelia app at build time.
@EisenbergEffect, what work is left on vNext to be able to “enhance” a pre-rendered Aurelia app?