feat: finish the Mcu → Mtb rename (useMtb, MtbConfig, Mtb.context) - #169
Merged
Conversation
…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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #166, which renamed the component but stopped there: the context module was still
Mcu.context.tsx, the hook was stilluseMcu, the config type was stillMcuConfig— 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
@deprecatedalias. No breaking change.Renamed
src/Mcu.context.tsxsrc/Mtb.context.tsxgit mv, history preservedMcuProviderMtbProviderMcuContextMtbContextuseMcuuseMtbuseMcukept as a deprecated aliasMcuConfigMtbConfigMcuConfigkept as a deprecated aliasOther leftovers found and fixed
import { Mcu }/<Mcu>and a## useMcusection — missed by feat: rename theMcucomponent toMtb, deprecateMcu#166tsup.config.tscomment listing the react bundle's exportsrecolorizeSvgdoc commentMtbConfig's jsdoc said "Material Color Utilities builder" → "Material Theme Builder"mcu-renamed-mtbchangeset was widened to cover the hook and the type (edited in place rather than adding a second changeset, since it hasn't shipped)useMcu === useMtbDeliberately left alone
The hook's returned fields (
mcuConfig,setMcuConfig,getMcuColor) and themcu-stylesDOM 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 lgtmgreen (build, build-figma, lint, check-format, check-exports, typecheck, 55 tests).Emitted types confirm both surfaces:
🤖 Generated with Claude Code