Faust.js New Features and More
We’re back to bi-weekly updates for Faust.js. I like to think that’s a great start on talking about what is going on with the product. As we move into late-Summer and Fall, expect to see a lot more in this space, particularly on our work around Gutenberg and Next.js’ App Router implementation. We can’t wait to get both into your IDE!
What’s new in Faust.js
Over the past two weeks we’ve updated our plugin as well as our core and blocks packages with 2 changes we’re happy to show you.
First, in our plugin image URLs (and any URLs with file extensions) are now excluded from the replacement that Faust does in the GraphQL query results. This should ensure that such URLs are always found on the front-end and prevent issues that over-zealous rewriting had been causing for some of y’all.
The second big change is a new feature. We now allow passing in extra parameters in Page.variables(). This is allowed in getNextStaticProps, getServerSideProps and getWordPressProps. Here’s how that looks:
export function getStaticProps(ctx) {
return getWordPressProps({ ctx, extra: {hello: 'world'} }); // extra parameter will be forwarded to the Template `variables` callback
}
Component.variables = ({ databaseId }, ctx, extra) => {
console.log(extra) // {hello: 'world'}
...
}
Code language: TypeScript (typescript)
While this is a minor change to our code it does allow for some really nice possibilities during implementation including ways to pass parameters for personalization and more. We’re looking forward to seeing what you do with it in your own projects!
What we’re working on next
Next up for the Faust.js team is initial work on App Router and our new feature which will allow you to take existing React components and use them as Gutenberg blocks in WordPress with minimal effort on your part.
In addition to work in Faust.js itself, we’re also spending some time on this site in the coming weeks and we’re looking forward to releasing a showcase to share what y’all are building with Faust.js as well as more ways to get feedback to the team directly from this site. All of which we hope can really make it easier yet for y’all to get started and go further with Faust.js.