Version 8
Learn how to upgrade from v7 to v8.
pnpm i basehub@latestNew Features
basehub/events: a new package used to interact with the Event Block.basehuband<Pump />now automatically inferdraftModefrom Next.js.<Toolbar />now includes a Branch Switcher!Support for internal links in <RichText />
SDK Breaking Changes
basehub/analyticshas been deprecated in favour ofbasehub/events. They are slightly different things, but Events should be able to cover analytics use cases, and more.<CodeBlock />:
langwas renamed tolanguageto better match the props of theprehandler in <RichText /><RichText />: The
codehandler before received a prop namedisInline, but now, it won’t receive that and it will just be used for inline code. Theprehandler will be used for full code blocks.
API Breaking Changes
Now, if a Reference Block has just one “allowed type”, we won't type it as a GraphQL Union, but rather, just return the end-type directly. this might break queries that did the
... on SomeTypething.
# before
{
someReference {
... on AuthorComponent {
name
}
}
}# after
{
someReference {
name
}
}In our Mutation API, we renamed the following:
transactionis nowtransactionAsynctransactionAwaitableis nowtransaction
A bit confusing, yes, but we found that transactionAwaitable (which executed the transaction and responded with the result) was much more useful than the old transaction, which fired off a job and then it was up to the developer to poll for the transactionStatus. The name "transactionAwaitable" was a poorly thought out name, and we've taken the opportunity of a breaking version to fix this.
Analytics → Events
We’ve renamed the /analytics entrypoint to /events
import { sendEvent, getEventCount } from 'basehub/analytics'
import { sendEvent, getEvents } from 'basehub/events'That should be all!