Skip to content

feat: finish the McuMtb rename in the context value - #173

Merged
abernier merged 1 commit into
mainfrom
feat/mtb-context-keys
Aug 5, 2026
Merged

feat: finish the McuMtb rename in the context value#173
abernier merged 1 commit into
mainfrom
feat/mtb-context-keys

Conversation

@abernier

@abernier abernier commented Aug 5, 2026

Copy link
Copy Markdown
Owner

The McuMtb 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 — so the documented useMtb example in the README read const { setMcuConfig, getMcuColor } = useMtb().

Changes

  • src/Mtb.context.tsxmcuConfig / setMcuConfig / getMcuColor are now mtbConfig / setMtbConfig / 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 Unknown MCU token error message drops the acronym.
  • src/Flowfield.stories.helpers.tsx — the ~30 call sites follow.
  • README.md — the useMtb example uses the new names.
  • src/Mtb.tsx — the local mcuStyleId binding becomes styleId.

What deliberately keeps the old name

Tests

New test asserting each mcu* context key is the same reference as its mtb* counterpart. Full pnpm run lgtm green (111 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dap13K3ck1Xjt5m5i7VNAu

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
abernier force-pushed the feat/mtb-context-keys branch from 4147635 to 3f254b6 Compare August 5, 2026 18:13
@abernier
abernier merged commit 7307139 into main Aug 5, 2026
4 of 6 checks passed
@abernier
abernier deleted the feat/mtb-context-keys branch August 5, 2026 18:15
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