Back to Changelog

March 6, 2024

Pump, and a New Preview Workflow

Introducing <Pump />, and our newly revamped Preview Workflow.

Pump is a React Server Component that enables a Fast Refresh-like experience for your content. When draft === true, Pump will subscribe to changes in real time from your Repo, and so keep your UI up-to-date. This is ideal for previewing content before pushing it to production. When draft === false, Pump will hit the Query API directly, without any production impact whatsoever. You can use it like this:

import { Pump } from "basehub/react-pump"
import { draftMode } from "next/headers"

const Page = async () => {
  return (
      next={{ revalidate: 30 }}
      queries={[{ __typename: true }]}
      {async ([data]) => {
        "use server"
        return <pre>{JSON.stringify(data, null, 2)}</pre>

export default Page

Read more about Pump on our docs.

Additionally, we’ve revamped our Preview Workflow, adding a new “Preview” configuration and button. This will help developers configure Preview URLs for content editors to check out their content before publishing.

Read more about the new Preview Workflow in our docs.