Skip to content

feat!: prepare 0.7.0 release with peer-dep migration and consumer polish#70

Merged
zhawtof merged 1 commit into
mainfrom
claude/frosty-haslett-fc4045
May 19, 2026
Merged

feat!: prepare 0.7.0 release with peer-dep migration and consumer polish#70
zhawtof merged 1 commit into
mainfrom
claude/frosty-haslett-fc4045

Conversation

@zhawtof
Copy link
Copy Markdown
Contributor

@zhawtof zhawtof commented May 19, 2026

Summary

Exits the 0.6.x-alpha line and tightens the consumer-facing surface ahead
of the first stable 0.x release. The big change is the dependency model:
a narrow set of runtime deps move to peer so shadcn/Radix and lucide
consumers dedupe instead of getting duplicate copies.

Why

block-kitchen is built to be embedded into someone else's app, and a
quick audit of how it handles that today surfaced a few rough edges:

  1. Duplicate Radix / lucide trees in consumers' node_modules
    (Radix in particular risks TooltipProvider/PopoverContext mismatch
    when two copies are present).
  2. Subpath imports missing — a backend that only needs toSlackBlocks
    was forced through the root entry and its full React component tree.
  3. No quick palette filtering — the only way to remove an image or
    table block from the default palette was to rebuild the whole array.
  4. Tailwind cascade collisions — package utilities and consumer
    utilities both compiled into @layer utilities, leaving conflict
    resolution to source-import order.
  5. No SSR / framework guidance — README didn't mention 'use client',
    portal placement, or where to import the stylesheet.
  6. Alpha versioning with no documented stability signal.

This PR addresses all six.

Breaking change

A narrow set of dependencies moved from dependencies to
peerDependencies — just the ones a typical consumer is likely to
already have, where dedupe gives them a real win:

  • react, react-dom
  • @radix-ui/react-{dialog,label,popover,radio-group,slot,tooltip}
    shadcn/ui audience already has these, and peer avoids the React-
    context split bug from two Radix copies.
  • lucide-react — universal in modern React UI stacks.

Everything else stays as a regular dependency. @dnd-kit/*,
@tiptap/*, slack-blocks-to-jsx, and
@tightknitai/slack-block-kit-validator are specialty — most consumers
don't already have them, so peer would only add version-skew surface
with no dedupe upside.

Modern package managers (pnpm 8+, npm 7+, yarn berry) auto-install
peers — most consumers won't need to change anything. Older tooling
can use the explicit command added to the README:

pnpm add @tightknitai/block-kitchen \
  react react-dom \
  @radix-ui/react-dialog @radix-ui/react-label \
  @radix-ui/react-popover @radix-ui/react-radio-group \
  @radix-ui/react-slot @radix-ui/react-tooltip \
  lucide-react

slack-web-api-client is now a devDependency (type-only consumer; stays
in tsup's external list).

What's in the PR

  • feat(exports) — subpath entries:
    • @tightknitai/block-kitchen/helpers (4.5 KB) for headless backend
      usage of toSlackBlocks, encodeBlocksToString, decodeBlocksFromString.
    • @tightknitai/block-kitchen/palette for tools that need
      defaultPalette / legacyInputVariants / extraAlertVariant /
      buildVariantById without the builder.
    • Root entry still re-exports everything — no breaking change for
      existing imports.
  • feat(palette) — new disabledBlockTypes?: SupportedBlockType[]
    prop on <BlockKitchen>. Filters at the variant level (sections that
    mix types keep variants whose types aren't disabled; sections that
    empty out drop entirely).
  • refactor(styles) — package's compiled Tailwind utilities now
    live in named cascade layers (bk-theme, bk-utilities) so consumer
    utilities win on collisions without source-order luck. Layer order
    documented in the README for consumers who want explicit control.
  • docs(readme) — bundlephobia badge; framework recipes for Next
    (App + Pages Router), Remix, Vite, Astro; portal-stylesheet pitfall
    callout; subpath-export examples; cascade-layer ordering snippet;
    disabledBlockTypes row in the props table; explanation of the
    narrow peer-dep set and the deliberate cut-off.
  • chore(release)package.json and .release-please-manifest.json
    bumped from 0.6.2-alpha.0 to 0.7.0. Pre-1.0 minor bump per
    release-please config (bump-minor-pre-major: true) signals the
    breaking peer-dep migration.

Test plan

  • pnpm typecheck
  • pnpm test — 217/217 passing
  • pnpm build — clean, ESM + CJS + types for all three entries
  • pnpm --dir demo install && pnpm --dir demo build — demo links to
    source and still builds against the new dep layout
  • Demo dev server (pnpm demo:dev) renders palette + surface +
    templates panel with no console errors after the cascade-layer
    rename
  • Reviewer to spot-check pnpm storybook
  • Reviewer to spot-check dark mode (Mode: dark toggle in demo
    header)

Notes for reviewer

  • The 0.7.0 bump in .release-please-manifest.json is intentional —
    it's the mechanism that gets the package out of the -alpha.X suffix
    on the next release-please run.
  • Bundle isn't smaller (already-externalized deps stay externalized) but
    consumers' node_modules size drops meaningfully when they share
    Radix / lucide with the rest of their app. The biggest remaining
    bundle win — React.lazy per-block-editor code splitting — is
    deliberately deferred; it's a real refactor, not a release-prep fix.
  • The bundlephobia badge will start populating once 0.7.0 lands on
    npm. Until then it'll render as "no data" on bundlephobia.
  • Peer-dep set was narrowed mid-review from the initial broader cut
    (which also included @dnd-kit/*, @tiptap/*, slack-blocks-to-jsx)
    after deciding those don't carry the dedupe / context-mismatch
    justification that Radix and lucide do — they're specialty deps the
    typical consumer wouldn't already have, so peer would just add skew
    warnings.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages Bot commented May 19, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
block-kitchen cb6d2a2 Commit Preview URL

Branch Preview URL
May 19 2026, 02:54 PM

@zhawtof zhawtof force-pushed the claude/frosty-haslett-fc4045 branch from 8a05802 to a8fa601 Compare May 19, 2026 05:38
Exits the 0.6.x-alpha line. Tightens up the consumer-facing surface ahead of
the first stable 0.x release.

BREAKING CHANGE: A narrow set of dependencies moved from `dependencies` to
`peerDependencies` — specifically the ones a typical consumer is likely
to already have, where deduplication gives them a real win (single copy of
Radix → consistent React context across `<TooltipProvider>` etc.; single
copy of `lucide-react`):

  - react, react-dom
  - @radix-ui/react-{dialog,label,popover,radio-group,slot,tooltip}
  - lucide-react

Modern package managers (pnpm 8+, npm 7+, yarn berry) auto-install peers,
so most consumers will not need to change anything. Older tooling can
follow the explicit install command in the README.

`@dnd-kit/*`, `@tiptap/*`, `slack-blocks-to-jsx`, and
`@tightknitai/slack-block-kit-validator` stay as direct dependencies —
most consumers don't already have these, so peer would only add
version-skew surface with no dedupe upside.

`slack-web-api-client` is now a devDependency (type-only consumer; stays
in tsup's `external` list).

What's new:

  - feat(exports): subpath entries for headless usage
      - `@tightknitai/block-kitchen/helpers` (~4.5 KB) — `toSlackBlocks`,
        `encode/decodeBlocksFromString` and supporting types, with no
        React dependency cone. Safe for backends (Workers, Lambdas).
      - `@tightknitai/block-kitchen/palette` — `defaultPalette`,
        `legacyInputVariants`, `extraAlertVariant`, and `buildVariantById`
        without pulling in the builder.
      The root entry still re-exports everything, so existing imports are
      unaffected.
  - feat(palette): `disabledBlockTypes` prop on `<BlockKitchen>`. Filters
      at the variant level — mixed-type sections (e.g. "Structure") keep
      the variants whose types aren't disabled and sections that go empty
      drop out. Convenient when you want the default palette minus a few
      block types without rebuilding it.
  - refactor(styles): scope the package's Tailwind theme and utility
      imports in named cascade layers (`bk-theme`, `bk-utilities`) so
      consumer utilities win against the package's on class-name
      collisions without source-order luck. Consumers can override layer
      order explicitly if they want — documented in the README.
  - docs(readme): bundlephobia minzip badge; framework recipes for
      Next.js (App + Pages Router), Remix, Vite, and Astro; portal-
      stylesheet pitfall callout (import at app root, not in a route);
      subpath-export examples; cascade-layer ordering snippet;
      `disabledBlockTypes` row in the props table; explanation of the
      narrow peer-dep set and the deliberate cut-off.
  - chore(release): version bumped to 0.7.0 in package.json and
      .release-please-manifest.json.

Verification: typecheck ✓, 217/217 tests ✓, library build ✓, demo install +
build ✓, demo dev server renders with no console errors and themed surface
intact.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zhawtof zhawtof force-pushed the claude/frosty-haslett-fc4045 branch from a8fa601 to cb6d2a2 Compare May 19, 2026 14:53
@zhawtof zhawtof merged commit f6c9d7a into main May 19, 2026
13 checks passed
@zhawtof zhawtof deleted the claude/frosty-haslett-fc4045 branch May 19, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant