Skip to content

feat: finish the McuMtb rename (useMtb, MtbConfig, Mtb.context) - #169

Merged
abernier merged 1 commit into
mainfrom
claude/mcu-context-rename-cleanup-9033a8
Aug 3, 2026
Merged

feat: finish the McuMtb rename (useMtb, MtbConfig, Mtb.context)#169
abernier merged 1 commit into
mainfrom
claude/mcu-context-rename-cleanup-9033a8

Conversation

@abernier

@abernier abernier commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to #166, which renamed the component but stopped there: the context module was still Mcu.context.tsx, the hook was still useMcu, the config type was still McuConfig — and the README still documented <Mcu>, the deprecated alias, as the way to use the package.

Same pattern as #166: new name, old name kept as a @deprecated alias. No breaking change.

Renamed

Before After Note
src/Mcu.context.tsx src/Mtb.context.tsx git mv, history preserved
McuProvider MtbProvider internal — not exported from the barrel, so renamed outright
McuContext MtbContext idem
useMcu useMtb public — useMcu kept as a deprecated alias
McuConfig MtbConfig public — McuConfig kept as a deprecated alias

Other leftovers found and fixed

  • README still showed import { Mcu } / <Mcu> and a ## useMcu section — missed by feat: rename the Mcu component to Mtb, deprecate Mcu #166
  • tsup.config.ts comment listing the react bundle's exports
  • "MCU Context" in the recolorizeSvg doc comment
  • MtbConfig's jsdoc said "Material Color Utilities builder" → "Material Theme Builder"
  • the unreleased mcu-renamed-mtb changeset was widened to cover the hook and the type (edited in place rather than adding a second changeset, since it hasn't shipped)
  • new test asserting useMcu === useMtb

Deliberately left alone

The hook's returned fields (mcuConfig, setMcuConfig, getMcuColor) and the mcu-styles DOM id. Renaming those changes a shape consumers destructure and an id they may target in CSS — a bigger call than a file rename, worth its own PR if wanted.

Verification

pnpm lgtm green (build, build-figma, lint, check-format, check-exports, typecheck, 55 tests).

Emitted types confirm both surfaces:

dist/index.d.ts: export { type McuConfig, type MtbConfig, ... }
dist/react.d.ts: export { ExportButton, Mcu, Mtb, useMcu, useMtb }

🤖 Generated with Claude Code

…ntext`)

The previous commit renamed the component but stopped there: the context
module was still `Mcu.context.tsx`, the hook was still `useMcu`, the config
type was still `McuConfig`, and the README still documented `<Mcu>` — the
deprecated alias — as the way to use the package.

Same pattern as before: new name, old name kept as a deprecated alias, so
nothing breaks.

- `src/Mcu.context.tsx` → `src/Mtb.context.tsx`
- `McuProvider`/`McuContext` → `MtbProvider`/`MtbContext` (internal, not
  exported from the barrel, so renamed outright)
- `useMcu` → `useMtb`, `McuConfig` → `MtbConfig`, both old names re-exported
  as `@deprecated` aliases

Left alone on purpose: the hook's returned fields (`mcuConfig`,
`setMcuConfig`, `getMcuColor`) and the `mcu-styles` DOM id — renaming those
changes a shape consumers destructure and an id they may target in CSS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abernier
abernier merged commit 1848a64 into main Aug 3, 2026
6 checks passed
abernier added a commit that referenced this pull request Aug 5, 2026
The `Mcu` → `Mtb` rename (#166, #169) covered the component, the hook and the
config type, but left the shape of the value `useMtb()` returns untouched: it
still handed back `mcuConfig`, `setMcuConfig` and `getMcuColor`.

They are now `mtbConfig`, `setMtbConfig` and `getMtbColor`. The `mcu*` keys stay
on the context value as `@deprecated` aliases holding the very same references,
so existing destructuring keeps working until the next major.

The `id` of the injected `<style>` tag stays `mcu-styles` — it is observable
from user CSS and scripts, so renaming it would break selectors silently. Only
the local binding follows the rename.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dap13K3ck1Xjt5m5i7VNAu
abernier added a commit that referenced this pull request Aug 5, 2026
The `Mcu` → `Mtb` rename (#166, #169) covered the component, the hook and the
config type, but left the shape of the value `useMtb()` returns untouched: it
still handed back `mcuConfig`, `setMcuConfig` and `getMcuColor`.

They are now `mtbConfig`, `setMtbConfig` and `getMtbColor`. The `mcu*` keys stay
on the context value as `@deprecated` aliases holding the very same references,
so existing destructuring keeps working until the next major.

The `id` of the injected `<style>` tag stays `mcu-styles` — it is observable
from user CSS and scripts, so renaming it would break selectors silently. Only
the local binding follows the rename.


Claude-Session: https://claude.ai/code/session_01Dap13K3ck1Xjt5m5i7VNAu

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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