<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Posts tagged #gatsby</title><description>All posts tagged with gatsby on queen.raae.codes</description><link>https://queen.raae.codes/tag/gatsby/</link><item><title>📝 ✨ ~ End of summer, end of Gatsby?</title><link>https://queen.raae.codes/2023-08-28-end-of/</link><guid isPermaLink="true">https://queen.raae.codes/2023-08-28-end-of/</guid><description>School has started here in Norway, the #SummerOffice is closed until next year, and Labour Day Weekend is coming up in the US. All pointing toward the end of…</description><pubDate>Mon, 28 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;School has started here in Norway, the &lt;a href=&quot;https://twitter.com/search?q=(from%3Aolaholstvea)%20until%3A2023-08-15%20since%3A2023-07-15&amp;amp;src=typed_query&amp;amp;f=top&quot;&gt;#SummerOffice&lt;/a&gt; is closed until next year, and Labour Day Weekend is coming up in the US.&lt;/p&gt;
&lt;p&gt;All pointing toward the end of summer in the northern hemisphere, and maybe even the end of Gatsby?&lt;/p&gt;
&lt;p&gt;Last week &lt;a href=&quot;https://twitter.com/FredKSchott/status/1693007599803752638?s=20&quot;&gt;FredKSchott&lt;/a&gt; (co-creator of Astro - kinda biased fella come to think of it) stated:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/FredKSchott/status/1693007599803752638?s=20&quot;&gt;&lt;img src=&quot;twitter.com_FredKSchott.png&quot; alt=&quot;There have been zero commits to the Gatsby repo in the last 24 days.&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And &lt;a href=&quot;https://twitter.com/wardpeet/status/1693014604694061194&quot;&gt;wardpeet&lt;/a&gt;, former tech lead at Gatsby, answered:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/wardpeet/status/1693014604694061194&quot;&gt;&lt;img src=&quot;./twitter.com_wardpeet.png&quot; alt=&quot;It’s dead. The whole staff is gone except one. It still works well but don’t expect major React 18 features to land&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &amp;quot;Gatsby is dead&amp;quot; sentiment spread like wildflowers in the community.&lt;/p&gt;
&lt;p&gt;However, Netlify followed up with:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/Netlify/status/1694035000734216263&quot;&gt;&lt;img src=&quot;./twitter.com_Netlify.png&quot; alt=&quot;Fear not! Gatsby is vital to a great many of our customers. Updates to React 18 and Gatsby Adapters are the most imminent updates, but we’re also busy investing in platform primitives for a stronger Gatsby.js (and other frameworks too).&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What we do know is that Gatsby Cloud will be shutting down.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For all Gatsby Cloud Free plan customers, your Gatsby Cloud instance will be discontinued on September 29, 2023.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We also know that Gatsby powers &lt;a href=&quot;https://www.netlify.com/blog/framework-popularity-on-netlify/&quot;&gt;19% of Netlify&apos;s enterprise customers&lt;/a&gt; - enterprise is where the money&apos;s at! Twitter-devs making blogs and portfolios, not so much.&lt;/p&gt;
&lt;p&gt;This summer, Netlify &lt;a href=&quot;https://www.netlify.com/blog/gatsby-adapters-realize-the-full-potential-of-gatsby-on-your-platform/&quot;&gt;shipped adaptors&lt;/a&gt;, making it possible for any hosting provider to run full-featured Gatsby sites. Before acquiring Gatsby, Netlify had to reverse engineer SSR, DSR, etc.&lt;/p&gt;
&lt;p&gt;I am still hopeful that we&apos;ll see Gatsby evolve, but I&apos;ll be looking into Astro while also spending some more time tinkering with good old Node.&lt;/p&gt;
&lt;p&gt;Totally feel the vibe of &lt;a href=&quot;https://twitter.com/flaviocopes/status/1695421873117438152&quot;&gt;this post doing its rounds on Twitter&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/flaviocopes/status/1695421873117438152&quot;&gt;&lt;img src=&quot;twitter.com_flaviocopes.png&quot; alt=&quot;“I want to build things for people” 💯&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What are you up to this fall? Any projects got you extra excited? Let me know!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Gatsby is back — v5.9 and a new Source Plugin tutorial</title><link>https://queen.raae.codes/2023-04-27-gatsby-update/</link><guid isPermaLink="true">https://queen.raae.codes/2023-04-27-gatsby-update/</guid><description>It seems the dust has settled on the Netlify acquisition of Gatsby. Last week Gatsby released the first version since February Gatsby v5.9, and Lennart…</description><pubDate>Thu, 27 Apr 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;It seems the dust has settled on the Netlify acquisition of Gatsby. Last week Gatsby released the first version since February Gatsby v5.9, and &lt;a href=&quot;https://twitter.com/lekoarts_de/status/1647975637427036160&quot;&gt;Lennart&lt;/a&gt; published a new and comprehensive tutorial on &lt;a href=&quot;https://www.gatsbyjs.com/docs/tutorial/creating-a-source-plugin/&quot;&gt;how to create a Source Plugin&lt;/a&gt; 📝&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/lekoarts_de/status/1647975637427036160&quot;&gt;&lt;img src=&quot;./lekoarts_de-tweet.png&quot; alt=&quot;I&apos;ve spent a couple of months writing a new official @GatsbyJS tutorial named &amp;quot;Creating a Source Plugin&amp;quot;.&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ When to use GATSBY_</title><link>https://queen.raae.codes/2023-03-17-env-variables/</link><guid isPermaLink="true">https://queen.raae.codes/2023-03-17-env-variables/</guid><description>Use GATSBY for environmental variables (env vars) you use in your client-side code. In practice, that would be almost all of your code. The exceptions are code…</description><pubDate>Fri, 17 Mar 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Use &lt;code&gt;GATSBY_&lt;/code&gt; for environmental variables (env vars) you use in your client-side code. In practice, that would be almost all of your code. The exceptions are code inside &lt;code&gt;gatsby-node.js&lt;/code&gt;, &lt;code&gt;gatsby-config.js&lt;/code&gt;, and a page&apos;s &lt;code&gt;getServerData&lt;/code&gt; or &lt;code&gt;config&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Exposing all env vars on the client would be a major security hazard. We use env vars for things such as API secrets, etc.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;XATA_API_KEY=xau_werIJslsdf8wekfsflr06ZxzyYYVpsMF6
GATSBY_RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Source Usage Data for Social Proof on Your Gatsby Site</title><link>https://queen.raae.codes/2023-03-14-source-xata/</link><guid isPermaLink="true">https://queen.raae.codes/2023-03-14-source-xata/</guid><description>Learn how to create a social proof section like the one we added to pruneyourfollows.com, a tool to help you clean up your Twitter timeline: Read the rest on…</description><pubDate>Tue, 14 Mar 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Learn how to create a social proof section like the one we added to &lt;a href=&quot;https://pruneyourfollows.com/&quot;&gt;pruneyourfollows.com&lt;/a&gt;, a tool to help you clean up your Twitter timeline:&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./social-proof.png&quot; alt=&quot;Screengrab showing that Prune your Follows has 907 users and has facilitaded over 20.000 unfollows&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.gatsbyjs.com/blog/source-xata&quot;&gt;Read the rest on the Gatsby Blog ➡️&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;li&gt;Queen Raae and family worked on several projects for Xata.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Netlify + Gatsby sitting in a tree...</title><link>https://queen.raae.codes/2023-02-01-netlify+gatsby/</link><guid isPermaLink="true">https://queen.raae.codes/2023-02-01-netlify+gatsby/</guid><description>Breaking news: Netlify Acquires Gatsby 🤯 The funny thing is I talked about JavaScript framework business models with pirate @tujoworker when meeting him in…</description><pubDate>Wed, 01 Feb 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;Breaking news:&lt;/strong&gt; Netlify Acquires Gatsby 🤯&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/Netlify/status/1620821991627309056&quot;&gt;&lt;img src=&quot;./twitter.com_Netlify.jpg&quot; alt=&quot;We&apos;re thrilled to announce that we have acquired Gatsby Inc.! Together we will build the future of composable, and empower developers with flexibility and choice in building composable web experiences.&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The funny thing is I talked about JavaScript framework business models with pirate @tujoworker when meeting him in real life earlier in the day.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://twitter.com/tujoworker/status/1620827519757979651&quot;&gt;&lt;img src=&quot;./twitter.com_raae.jpg&quot; alt=&quot;Wow, and I just talked today with @raae about JavaScript framework business models ✨&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It seems to me they are betting on Valhalla. Still, they also promise to be &amp;quot;good stewards of the Gatsby open-source project and the maintainers will join the open source group together with the creators of frameworks like Solid JS and Eleventy.&amp;quot;&lt;/p&gt;
&lt;p&gt;Time will tell!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Moar logs with gatsby build/develop --verbose</title><link>https://queen.raae.codes/2023-01-12-moar-logs/</link><guid isPermaLink="true">https://queen.raae.codes/2023-01-12-moar-logs/</guid><description>Gatsby has its own reporter helper giving us 5 log levels: verbose, info, warn, error and panic. By default when using gatsby develop and gatsby build you&apos;ll…</description><pubDate>Thu, 12 Jan 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Gatsby has its own reporter helper giving us 5 log levels: verbose, info, warn, error and panic.&lt;/p&gt;
&lt;p&gt;By default when using &lt;code&gt;gatsby develop&lt;/code&gt; and &lt;code&gt;gatsby build&lt;/code&gt; you&apos;ll see all but the verbose messages.&lt;/p&gt;
&lt;p&gt;But sometimes it can be beneficial to see moar logs, and you can turn on the verbose messages by using the flag &lt;code&gt;verbose&lt;/code&gt;: &lt;code&gt;gatsby develop --verbose&lt;/code&gt; or &lt;code&gt;gatsby build --verbose&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Enabling verbose logging will for instance give you an overview of your nodes:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;verbose Number of node types: 13. Nodes per type: Directory: 230,
  File: 384, ImageSharp: 159, Landing: 12, MarkdownRemark: 215,
  OlaVeaEmail: 18, QueenEmail: 162, Site: 1, SiteBuildMetadata: 1,
  SitePage: 381, SitePlugin: 67, Talk: 6, TestimonialsYaml: 12
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ React Query pagination with Gatsby (File System Route API)</title><link>https://queen.raae.codes/2023-01-04-react-query-pagination/</link><guid isPermaLink="true">https://queen.raae.codes/2023-01-04-react-query-pagination/</guid><description>For Prune your follows, we already had an URL structure for filters like this: - /app/filter/unpopular - /app/filter/unfollowed - /app/filter/unpopular But for…</description><pubDate>Wed, 04 Jan 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;For &lt;a href=&quot;https://pruneyourfollows.com&quot;&gt;Prune your follows&lt;/a&gt;, we already had an URL structure for filters like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unpopular&quot;&gt;/app/filter/unpopular&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unfollowed&quot;&gt;/app/filter/unfollowed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unpopular&quot;&gt;/app/filter/unpopular&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But for most filters, there are more than 60 accounts, so we added pagination by:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Capturing the page number using the Gatsby File System Route API 1️⃣&lt;/li&gt;
&lt;li&gt;Extending the React Query cache key with the page number 2️⃣&lt;/li&gt;
&lt;li&gt;Calculating an offset using the page number 3️⃣&lt;/li&gt;
&lt;li&gt;Passing along the offset with our query for filtered accounts 4️⃣&lt;/li&gt;
&lt;/ul&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// ./src/pages/app/filter/[filter]/[...page].js 👈👈👈 1️⃣

import React from &amp;quot;react&amp;quot;;
import axios from &amp;quot;axios&amp;quot;;
import { useQuery } from &amp;quot;@tanstack/react-query&amp;quot;;

export default function SearchPage(props) {
  const pageIndex = parseInt(props.page) || 0;
  const size = 60;
  const offset = pageIndex * size; //👈👈👈 3️⃣
  const { data } = useQuery({
    queryKey: [&amp;quot;accounts&amp;quot;, props.filter, props.page], // 👈👈👈 2️⃣
    queryFn: ({ signal }) =&amp;gt;
      axios.get(&amp;quot;/api/accounts&amp;quot;, {
        params: {
          size: size,
          filter: props.filter,
          offset: offset, //👈👈👈 4️⃣
        },
        signal: signal,
      }),
    select: (result) =&amp;gt; result.data,
  });

  return (
    &amp;lt;ul&amp;gt;
      {(data?.records || []).map((record) =&amp;gt; (
        &amp;lt;li key={record.accountId}&amp;gt;
          {record.name} @{record.username}
        &amp;lt;/li&amp;gt;
      ))}
    &amp;lt;/ul&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If &amp;quot;capturing the page number using the Gatsby File System Route API&amp;quot; made no sense, then &lt;a href=&quot;/2022-12-01-url-based-pagination/&quot;&gt;Url-based (client-side) pagination with Gatsby&lt;/a&gt; is for you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Source app usage for social proof on a Gatsby website</title><link>https://queen.raae.codes/2022-12-18-social-proof/</link><guid isPermaLink="true">https://queen.raae.codes/2022-12-18-social-proof/</guid><description>On this week&apos;s unauthorized and rum-fueled treasure hunt in the sharky waters around the Gatsby we added we added usage stats to Prune your Follows. The Why…</description><pubDate>Sun, 18 Dec 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On this week&apos;s &lt;a href=&quot;https://youtu.be/qAyaQaPIQCA&quot;&gt;unauthorized and rum-fueled treasure hunt&lt;/a&gt; in the sharky waters around the Gatsby we added we added usage stats to &lt;a href=&quot;https://pruneyourfollows.com/&quot;&gt;Prune your Follows&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./social-proof-section.png&quot; alt=&quot;Social proof section&quot;&gt;&lt;/p&gt;
&lt;h2&gt;The Why&lt;/h2&gt;
&lt;p&gt;It&apos;s one way to show &amp;quot;social proof&amp;quot;. Other ways are testimonials, reviews, the little avatars that are also present in the screenshot above, and more. Its purpose: Show potential users that it will be okay. Loads of people have already trusted us!&lt;/p&gt;
&lt;h2&gt;The How&lt;/h2&gt;
&lt;p&gt;1️⃣ We queried Xata, our serverless database, for aggregated data,&lt;br&gt;
2️⃣ created a Gatsby data node to hold the information,&lt;br&gt;
3️⃣ and used a static Gatsby query to get hold of the information in our component.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// File: /.gatsby-node.js

exports.sourceNodes = async (gatsbyUtils) =&amp;gt; {
  const { reporter, actions, createNodeId, createContentDigest } = gatsbyUtils;
  const { createNode } = actions;

  // 1️⃣ Query Xata
  const result = await xata.db.accounts.aggregate({
    unfollowsTotal: {
      count: {
        filter: {
          //There is some older test data in there
          unfollowed: { $ge: new Date(&amp;quot;2022-11-03&amp;quot;) },
        },
      },
    },
    usersTotal: {
      uniqueCount: {
        column: &amp;quot;followed_by&amp;quot;,
      },
    },
  });

  const statsData = {
    unfollowedCount: result.aggs.unfollowsTotal,
    userCount: result.aggs.usersTotal,
  };

  // 2️⃣ Create Node
  createNode({
    id: createNodeId(&amp;quot;statistics&amp;quot;),
    ...statsData,
    internal: {
      type: &amp;quot;Statistics&amp;quot;,
      contentDigest: createContentDigest(statsData),
    },
  });
};
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// File: ./src/domain/marketing/Stat.js

import React from &amp;quot;react&amp;quot;;
import { useStaticQuery, graphql } from &amp;quot;gatsby&amp;quot;;

export function Stats() {
  // 3️⃣ Use in component
  const data = useStaticQuery(graphql`
    query {
      statistics {
        unfollowedCount
        userCount
      }
    }
  `);

  return (
    &amp;lt;section&amp;gt;
      Users: {data.statistics.userCount}
      Unfollows: {data.statistics.unfollowedCount}
    &amp;lt;/section&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Check out the pull request for the complete example, including the tailwind design for the component.&lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Queen Raae and family worked on several projects for Xata.&lt;/li&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>📝 ✨ ~ Url-based (client-side) pagination with Gatsby</title><link>https://queen.raae.codes/2022-12-01-url-based-pagination/</link><guid isPermaLink="true">https://queen.raae.codes/2022-12-01-url-based-pagination/</guid><description>I like to be able to refresh my browser, use the back button or bookmark a page without losing context. So for Prune your follows, we already had an URL…</description><pubDate>Thu, 01 Dec 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I like to be able to refresh my browser, use the back button or bookmark a page without losing context. So for &lt;a href=&quot;https://pruneyourfollows.com&quot;&gt;Prune your follows&lt;/a&gt;, we already had an URL structure for filters like this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unpopular&quot;&gt;/app/filter/unpopular&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unfollowed&quot;&gt;/app/filter/unfollowed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pruneyourfollows.com/app/filter/unpopular&quot;&gt;/app/filter/unpopular&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Keeping the selected filter in the URL makes all the use cases mentioned above possible.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.gatsbyjs.com/docs/reference/routing/file-system-route-api/#creating-client-only-routes&quot;&gt;Gatsby File System Route API&lt;/a&gt; does the heavy lifting for us, automagically surfacing the selected filter as a page prop:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// File: ./src/pages/app/filter/[...filter].js 👈👈👈

import React from &amp;quot;react&amp;quot;;

export default function FilterPage(props) {
  return (
    &amp;lt;main&amp;gt;
      &amp;lt;p&amp;gt;Your selected filter is {props.params.filter}&amp;lt;/p&amp;gt;
      {/* OR */}
      &amp;lt;p&amp;gt;Your selected filter is {props.filter}&amp;lt;/p&amp;gt;
    &amp;lt;/main&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The path &lt;code&gt;/app/filter/unfollowed&lt;/code&gt; in the above example prints out &amp;quot;Your selected filter is unfollowed&amp;quot; twice as I wanted to show that the selected filter is available both in &lt;code&gt;props.filter&lt;/code&gt; and &lt;code&gt;props.params.filter&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;For pagination, we need to add another level in our file system:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// ./src/pages/app/filter/[filter]/[...page].js 👈👈👈

import React from &amp;quot;react&amp;quot;;

export default function FilterPage(props) {
  return (
    &amp;lt;main&amp;gt;
      &amp;lt;p&amp;gt;
        Your selected filter is {props.filter}, &amp;lt;br /&amp;gt;
        and your selected page is {props.page}
      &amp;lt;/p&amp;gt;
    &amp;lt;/main&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/app/filter/unpopular&lt;/code&gt; =&amp;gt; &amp;quot;Your selected filter is unpopular, and your selected page is&amp;quot;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;/app/filter/overactive/3&lt;/code&gt; =&amp;gt; &amp;quot;Your selected filter is overactive, and your selected page is 3&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;BTW: These values are strings (or undefined), so it might be a good idea to convert the &lt;code&gt;page&lt;/code&gt; into a &lt;code&gt;pageIndex&lt;/code&gt; right away and add a sensible default:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// ./src/pages/app/filter/[filter]/[...page].js

import React from &amp;quot;react&amp;quot;;

export default function FilterPage(props) {
  const pageIndex = props.page ? parseInt(props.page) : 0; 👈👈👈
  return (
    &amp;lt;main&amp;gt;
      &amp;lt;p&amp;gt;
        Your selected filter is {props.filter} &amp;lt;br /&amp;gt;
        and your selected page is {pageIndex}
      &amp;lt;/p&amp;gt;
    &amp;lt;/main&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With the above changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;/app/filter/unpopular&lt;/code&gt; =&amp;gt; &amp;quot;Your selected filter is unpopular, and your selected page is 0&amp;quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;p&gt;PS: There is a follow up showing &lt;a href=&quot;/2023-01-04-react-query-pagination/&quot;&gt;pagination in tandem with React Query&lt;/a&gt;&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>⛔️ 🏗 ~ Stop the build with `reporter.panic`</title><link>https://queen.raae.codes/2022-08-31-panic/</link><guid isPermaLink="true">https://queen.raae.codes/2022-08-31-panic/</guid><description>On last week&apos;s show, we sourced data from Supabase in the form of little avatars. If the sourcing fails though, we&apos;ll get problems down the road with the…</description><pubDate>Wed, 31 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On last week&apos;s show, we &lt;a href=&quot;/2022-08-26-source-supabase/&quot;&gt;sourced data from Supabase&lt;/a&gt; in the form of little avatars.&lt;/p&gt;
&lt;p&gt;If the sourcing fails though, we&apos;ll get problems down the road with the &lt;code&gt;Avatars&lt;/code&gt; component:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Cannot query field &amp;quot;allUserAvatar&amp;quot; on type &amp;quot;Query&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It would be better to fail as fast as possible, and you may do so with &lt;code&gt;reporter.panic&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// File: gatsby-node.js

const { createClient } = require(&amp;quot;@supabase/supabase-js&amp;quot;);

const supabaseUrl = process.env.GATSBY_PUBLIC_SUPABASE_URL;
const supabaseServiceKey = process.env.SUPABASE_SERVICE_KEY;

const serviceSupabase = createClient(supabaseUrl, supabaseServiceKey);

exports.sourceNodes = async (gatsbyUtils) =&amp;gt; {
  const { actions, createNodeId, createContentDigest, reporter } = gatsbyUtils;
  const { createNode } = actions;

  const { data, error } = await serviceSupabase
    .from(&amp;quot;avatars&amp;quot;)
    .select(&amp;quot;username, avatar_url&amp;quot;)
    .limit(20);

  if (error) {
    // 👇👇👇 Stops the build
    reporter.panic(&amp;quot;No avatars sourced&amp;quot;, error);
  }

  data.forEach((item) =&amp;gt; {
    createNode({
      id: createNodeId(item.username),
      avatarUrl: item.avatar_url,
      username: item.username,
      internal: {
        type: &amp;quot;UserAvatar&amp;quot;,
        contentDigest: createContentDigest(item),
      },
    });
  });
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Read more about the &lt;code&gt;reporter&lt;/code&gt; helper &lt;a href=&quot;https://www.gatsbyjs.com/docs/reference/config-files/node-api-helpers/#reporter&quot;&gt;in the Gatsby Docs&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;br&gt;
All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>🏝 🗓 ~ This week around the Gatsby islands</title><link>https://queen.raae.codes/2022-08-29-this-week/</link><guid isPermaLink="true">https://queen.raae.codes/2022-08-29-this-week/</guid><description>Yesterday I got to meet long-term internet friend Monica Lent, of Blogging for devs fame. If you haven&apos;t signed up for her free email course yet, you are in…</description><pubDate>Mon, 29 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Yesterday I got to meet long-term internet friend Monica Lent, of Blogging for devs fame. If you haven&apos;t &lt;a href=&quot;https://bloggingfordevs.com/&quot;&gt;signed up for her free email course&lt;/a&gt; yet, you are in for a treat.&lt;/p&gt;
&lt;p&gt;Hopefully, I get to meet many more internet friends IRL before the year ends as I&apos;llI&apos;ll be speaking at the &lt;a href=&quot;https://jamstack.org/conf/&quot;&gt;Jamstack Conf&lt;/a&gt; in San Fransisco and then at &lt;a href=&quot;https://www.modernfrontends.live/&quot;&gt;Modern Frontends&lt;/a&gt; in London 🎉&lt;/p&gt;
&lt;p&gt;Gatsby is hyping the Data Layer these days. Coincidently my favorite part of Gatsby, so I am all for that. I am eager to get my hands on &lt;em&gt;Runtime GraphQL&lt;/em&gt; for instance.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Runtime GraphQL. By far the most requested feature for the data layer! Soon you&apos;ll be able to query GraphQL — not just at build time — but from functions and during SSR.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Read Kyle Mathews &lt;a href=&quot;https://www.gatsbyjs.com/blog/scaling-rsg-builds-with-gatsbys-data-layer/&quot;&gt;blog post for more Data Layer goodies&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There have been five minor Gatsby releases while I&apos;ve enjoyed the summer 🤯 Check out the &lt;a href=&quot;https://github.com/gatsbyjs/gatsby/releases&quot;&gt;release log&lt;/a&gt; to get up to speed. But here are some of my favs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gatsbyjs.com/docs/reference/release-notes/v4.21/#gatsby-plugin-mdx-v4&quot;&gt;&lt;code&gt;gatsby-plugin-mdx&lt;/code&gt; v4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gatsbyjs.com/docs/reference/release-notes/v4.19/#gatsby-head-api&quot;&gt;Gatsby Head API&lt;/a&gt; - Better performance &amp;amp; more future-proof than &lt;code&gt;react-helmet&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.gatsbyjs.com/docs/reference/release-notes/v4.18/#server-side-rendering-ssr-in-development&quot;&gt;Server Side Rendering (SSR) in development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Our streaming schedule this week&lt;/h2&gt;
&lt;p&gt;🔴 🏴‍☠️ &lt;a href=&quot;https://youtu.be/Zyeuj7I7A50&quot;&gt;Refactor from React Helmet to the new Gatsby Head API · #GatsbyJS Deep Dive&lt;/a&gt;&lt;br&gt;
— Thursday, September 1st @ 19:00 CEST&lt;/p&gt;
&lt;h2&gt;Other events&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.learnwithjason.dev/make-static-pages-dynamic-with-netlify-edge-functions&quot;&gt;Make Static Pages Dynamic With Netlify Edge Functions (Learn with Jason)&lt;/a&gt;&lt;br&gt;
— Tuesday, August 30th @ 19:30 CEST&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>🗂 🏴‍☠️ ~ Source data (avatars) into the Gatsby Data Layer from a Supabase table</title><link>https://queen.raae.codes/2022-08-26-source-supabase/</link><guid isPermaLink="true">https://queen.raae.codes/2022-08-26-source-supabase/</guid><description>On yesterday&apos;s unauthorized and rum-fueled treasure hunt in the sharky waters around the Gatsby islands, we refactored the little avatar section on Prune your…</description><pubDate>Fri, 26 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;On yesterday&apos;s &lt;a href=&quot;https://youtu.be/EK74ACNxM7M&quot;&gt;unauthorized and rum-fueled treasure hunt&lt;/a&gt; in the sharky waters around the Gatsby islands, we refactored the little avatar section on &lt;a href=&quot;https://prune.raae.tech&quot;&gt;Prune your follows&lt;/a&gt; from client-side to server-side rendering!&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://youtu.be/EK74ACNxM7M&quot;&gt;&lt;img src=&quot;./stream-screendump.jpg&quot; alt=&quot;Stream Screendump&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;PR: If you did (or do) watch the show, you&apos;ll see that I have sneakily done some cleaning up and solved our little environment variable problem by making sure I load them in the gatsby-config 🤦‍♀️ 🤪&lt;/p&gt;
&lt;h2&gt;The What?&lt;/h2&gt;
&lt;p&gt;Source data from the avatars table on build, so that the little avatars are present as part of the statically generated version of the marketing page.&lt;/p&gt;
&lt;h2&gt;The Why?&lt;/h2&gt;
&lt;p&gt;It gets rid of the tiny flicker of no content, and why call Supabase every time someone lands on the marketing page for &lt;a href=&quot;https://prune.raae.tech&quot;&gt;Prune your follows&lt;/a&gt; when there is no need? You can also use your service key when sourcing, allowing you to even information from otherwise locked down table rows.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://prune.raae.tech&quot;&gt;&lt;img src=&quot;./prune-avatars.jpg&quot; alt=&quot;Screendump of avatars on Prune your follows&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;The How&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fetch data on avatars using the Supabase SKD this time&lt;/li&gt;
&lt;li&gt;Create a Gatsby node for each avatar using &lt;code&gt;createNode&lt;/code&gt;, &lt;code&gt;createNodeId&lt;/code&gt; and &lt;code&gt;createContentDigest&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The Code&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-js&quot;&gt;// File: gatsby-node.js
// Note: Error handling omitted

const { createClient } = require(&amp;quot;@supabase/supabase-js&amp;quot;);

const supabaseUrl = process.env.GATSBY_PUBLIC_SUPABASE_URL;
const supabaseServiceKey = process.env.SUPABASE_SERVICE_KEY;

const serviceSupabase = createClient(supabaseUrl, supabaseServiceKey);

exports.sourceNodes = async (gatsbyUtils) =&amp;gt; {
  const { actions, createNodeId, createContentDigest, reporter } = gatsbyUtils;
  const { createNode } = actions;

  const { data } = await serviceSupabase
    .from(&amp;quot;avatars&amp;quot;)
    .select(&amp;quot;username, avatar_url&amp;quot;)
    .limit(20);

  data.forEach((item) =&amp;gt; {
    createNode({
      id: createNodeId(item.username),
      avatarUrl: item.avatar_url,
      username: item.username,
      internal: {
        type: &amp;quot;UserAvatar&amp;quot;,
        contentDigest: createContentDigest(item),
      },
    });
  });
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And voila, we have avatar nodes in the data layer we may use in the &lt;code&gt;Avatars&lt;/code&gt; component:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;// File: Avatars.js
// Note: Styling omitted

import React from &amp;quot;react&amp;quot;;
import { useStaticQuery, graphql } from &amp;quot;gatsby&amp;quot;;

export function Avatars() {
  const data = useStaticQuery(graphql`
    query {
      allUserAvatar {
        nodes {
          username
          avatarUrl
        }
      }
    }
  `);

  return (
    &amp;lt;div&amp;gt;
      {data.allUserAvatar.nodes.map((user) =&amp;gt; {
        return (
          &amp;lt;img key={user.username} src={user.avatarUrl} alt={user.username} /&amp;gt;
        );
      })}
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To see the entire app code, check out its &lt;a href=&quot;https://github.com/queen-raae/prune-your-follows&quot;&gt;GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt; &lt;br&gt;
All the best,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item><item><title>🏴‍☠️ 📺 ~ Join us for the first show of the season</title><link>https://queen.raae.codes/2022-08-25-first-show/</link><guid isPermaLink="true">https://queen.raae.codes/2022-08-25-first-show/</guid><description>Friendly reminder that we are back today with our unauthorized and rum-fueled treasure hunts in the sharky waters around the Gatsby island. Onboarding the ship…</description><pubDate>Thu, 25 Aug 2022 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Friendly reminder that we are back today with our &lt;a href=&quot;https://www.youtube.com/QueenRaae/live&quot;&gt;unauthorized and rum-fueled treasure hunts&lt;/a&gt; in the sharky waters around the Gatsby island.&lt;/p&gt;
&lt;p&gt;Onboarding the ship this season are great folks like Colby Fayock (Astrocoder &amp;amp; Developer Advocate), Josh Johnson (Engineer at Gatsby), and more.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Make sure to sign up for &lt;a href=&quot;https://queen.raae.codes/emails/reminders/&quot;&gt;reminder emails&lt;/a&gt; sent 30 minutes before we go live so you don&apos;t miss out 📬&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will source these little avatars on today&apos;s show from a Supabase table into the Gatsby Data Layer to make them statically generated! At the moment, these are fetched client side.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://prune.raae.tech&quot;&gt;&lt;img src=&quot;./prune-avatars.jpg&quot; alt=&quot;Screendump of avatars on Prune your follows&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Hope to see you there,&lt;br&gt;
Queen Raae&lt;/p&gt;
&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Contrary to popular belief, Queen Raae and family have never worked for Gatsby.&lt;/li&gt;&lt;/ul&gt;</content:encoded></item></channel></rss>