Releases: basehub-ai/basehub
[email protected]
Patch Changes
- 8cee68d: React RichText component now implements GithubSlugger to generate the headings IDs
[email protected]
[email protected]
Patch Changes
- fix some lil bugs
[email protected]
Patch Changes
- update genql
[email protected]
Patch Changes
- Fix exports issue
[email protected]
Major Changes
-
7a85095: # New
fragmentOn
helper to extract fragmentsIn this new major version, we're introducing
fragmentOn
, a simpler way to create fragments in thebasehub
SDK.Previously, in order to reuse a fragment, you'd do something like this:
// old way 👎 import { LinkComponentGenqlSelection, LinkComponent, FieldsSelection, } from "basehub"; const LinkFragment = { href: true, label: true, } satisfies LinkComponentGenqlSelection; // extract the type type LinkFragment = FieldsSelection<LinkComponent, typeof LinkFragment>;
Looks simple, but it's a bit hard to understand. You need to know that we're exposing a
LinkComponentGenqlSelection
, and that you should use thesatisfies
so the object's type is constrained but also can be more specific. Then, to extract the type, you'd getFieldsSelection
, and finally,LinkComponent
. A lot of types!Moreover, if you needed to create another fragment, it'd be this same process, over and over again.
This is how it's done in the new version:
// new way 👍 import { fragmentOn } from "basehub"; const LinkFragment = fragmentOn("LinkComponent", { href: true, label: true, }); // extract the type type LinkFragment = fragmentOn.infer<typeof LinkFragment>;
Much simpler!
Why is this a breaking change
Before this version, we exposed a lot of the internal types from
'basehub'
. We now don't. Some applications might depend on this, and that's why this is a breaking change. If you need those types for some reason that wasn't discussed in this document, feel free to raise an issue and we can see to bring them back.
[email protected]
Minor Changes
- 8491d89: Introduce --watch mode, plus a new
basehub dev
command to help you get up and running faster in your local environment.
[email protected]
Patch Changes
- update @basehub/mutation-api-helpers
[email protected]
Patch Changes
- Add support custom rel to anchor in target _blank
[email protected]
Patch Changes
- Accept "_target" in rich text links and add it to default handler