Repository navigation
Deprecate style set entries that are no longer used for rendering - #5881
Conversation
Components moved to CSS modules (#5506, #5553, #5575, #5666, #5668, #5669, #5670) but the old style set files still look live. Add a two-line comment to each one saying since which PR it is unused and where the live styles are, so readers do not edit the wrong file. Nothing is removed: `createStyleSet()` still returns these entries.
There was a problem hiding this comment.
🟢 Approval recommended
The changes only add documentation comments, with no unresolved issues or runtime behavior changes.
No open issues 🎉
What changed in this PR
Documents legacy style sets so contributors can find the CSS modules that now control rendering. Runtime code and public APIs remain unchanged.
Changes:
- Adds migration notes to 17 unused style set entries and 3 unimported files.
- Points each file to its live styles and the relevant migration PR.
| File | Description |
|---|---|
| packages/component/src/Styles/StyleSet/ViewCodeDialog.ts | Notes removal and live dialog styles. |
| packages/component/src/Styles/StyleSet/ThumbButton.ts | Points to feedback button styles. |
| packages/component/src/Styles/StyleSet/TextContent.ts | Points to text content styles. |
| packages/component/src/Styles/StyleSet/StackedLayout.ts | Points to stacked layout styles. |
| packages/component/src/Styles/StyleSet/SendStatus.ts | Points to activity status styles. |
| packages/component/src/Styles/StyleSet/RenderMarkdown.ts | Points to Markdown styles. |
| packages/component/src/Styles/StyleSet/LinkDefinitions.ts | Points to link definition styles. |
| packages/component/src/Styles/StyleSet/CodeBlockCopyButton.ts | Notes removal and live copy button styles. |
| packages/component/src/Styles/StyleSet/CodeBlock.ts | Notes removal and live code block styles. |
| packages/component/src/Styles/StyleSet/CitationModalDialog.ts | Points to citation modal styles. |
| packages/component/src/Styles/StyleSet/CarouselFlipper.ts | Locates flipper styles in carousel layout. |
| packages/component/src/Styles/StyleSet/CarouselFilmStripAttachment.ts | Points to carousel attachment styles. |
| packages/component/src/Styles/StyleSet/CarouselFilmStrip.ts | Points to carousel filmstrip styles. |
| packages/component/src/Styles/StyleSet/Bubble.ts | Points to bubble styles. |
| packages/component/src/Styles/StyleSet/BasicTranscript.ts | Points to transcript focus styles. |
| packages/component/src/Styles/StyleSet/ActivityCopyButton.ts | Points to activity copy button styles. |
| packages/component/src/Styles/StyleSet/ActivityButton.ts | Points to activity button styles. |
| packages/bundle/src/adaptiveCards/Styles/StyleSet/AudioCardAttachment.js | Points to audio and video content styles. |
| packages/bundle/src/adaptiveCards/Styles/StyleSet/AnimationCardAttachment.js | Points to animation and sign-in styles. |
| packages/bundle/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts | Points to Adaptive Card renderer styles. |
Review effort: Balanced
|
This can be made even better
|
Per review, turn the notes into proper deprecations, following the existing `@deprecated ... will be removed on or after YYYY-MM-DD` convention with the usual 2-year window. - Mark the 14 unused `createStyleSet()` entries and the 3 unused full-bundle entries (`AdaptiveCardsStyleSet`) `@deprecated`: not used for rendering since 4.19.0, where the live styles are, removed on or after 2028-10-16 - Move the per-file note into a `@deprecated` JSDoc on each style factory - Type `useStyleSet()` with a mapped type instead of `Record<>` so the deprecation also shows on the hook result (same keys, same mutability) - Delete `CodeBlock.ts`, `CodeBlockCopyButton.ts`, and `ViewCodeDialog.ts`, which nothing imports since #5575 and are not public - Add a `### Deprecated` changelog entry
|
Co-authored-by: William Wong <compulim@users.noreply.github.com>
Changelog Entry
Deprecated
activityButton,activityCopyButton,basicTranscript,bubble,carouselFilmStrip,carouselFilmStripAttachment,carouselFlipper,citationModalDialog,linkDefinitions,renderMarkdown,sendStatus,stackedLayout,textContent, andthumbButtonadaptiveCardRenderer,animationCardAttachment, andaudioCardAttachmentDescription
Since components moved to CSS modules in 4.19.0, 17 style set entries no longer style anything, but they are still part of
createStyleSet()and look live. Developers who customize them see no change, and contributors were sent to files likeCarouselFlipper.tswhile the live styles were inCarouselLayout.module.css.This PR deprecates these entries. Each one is marked
@deprecatedwith since when it is not used for rendering, where the live styles are, and the removal date. Nothing is removed from the public API, so code that reads or sets these entries does not break.Design
A style set entry counts as unused when no component reads it from
useStyleSet().useStyleSet()is the only way components read the style set, and every call destructures named entries. All PRs below shipped in 4.19.0 (paths relative to each package'ssrc/):stackedLayoutActivity/StackedLayout.module.cssbasicTranscriptTranscript/TranscriptFocus/TranscriptFocus.module.cssadaptiveCardRenderer,animationCardAttachment,audioCardAttachmentadaptiveCards/Attachment/*.module.cssbubble,carouselFilmStrip,carouselFilmStripAttachment,carouselFlipperActivity/*.module.css(flippers:CarouselLayout.module.css)sendStatus,thumbButtonActivityStatus/ActivityStatus.module.css,ActivityFeedback/private/ThumbButton.module.cssactivityButton,activityCopyButton,citationModalDialog,linkDefinitions,renderMarkdown,textContentAttachment/Text/**/*.module.css,LinkDefinition/LinkDefinitions.module.css,hooks/RenderMarkdown.module.cssThe deprecation follows the existing convention:
@deprecated ... will be removed on or after YYYY-MM-DD, about 2 years after the deprecation, as foruseSuggestedActions()(packages/api/src/hooks/useSuggestedActions.ts) andavatarMiddleware(packages/api/src/hooks/Composer.tsx).@deprecatedis on the entries ofcreateStyleSet()and on theAdaptiveCardsStyleSettype, so TypeScript and VS Code (also for JavaScript) strike them through for developers.useStyleSet()now returns a mapped type overcreateStyleSet()instead ofRecord<>, so the deprecation also shows on the hook result. Keys and mutability are unchanged.@deprecatedJSDoc on its factory function, so contributors do not edit the wrong file.CodeBlock.ts,CodeBlockCopyButton.ts, andViewCodeDialog.tsare deleted. They are not public and nothing imports them since fix: allow focusing code block contents #5575 removed them fromcreateStyleSet().warnOnce()innormalizeStyleOptions(), but astyleSetprop always contains every entry (developers start fromcreateStyleSet()), so detecting a customized entry would need a deep comparison with the defaults. This can be added later if needed.Follow-up: sample
02.branding-styling-and-customization/b.idiosyncratic-manual-stylescustomizesstyleSet.textContent, which has no effect since 4.19.0. It should move to a style option (e.g.primaryFont) or another entry in a separate PR.Specific Changes
Added
@deprecatedwith the removal date (2028-10-16) to 14 entries inpackages/component/src/Styles/createStyleSet.tsand 3 properties ofpackages/bundle/src/adaptiveCards/AdaptiveCardsStyleSet.tsReplaced the note in each of the 17 style set files with a
@deprecatedJSDoc on the factory functionChanged the return type of
useStyleSet()fromRecord<>to a mapped type, so@deprecatedcarries overDeleted
CodeBlock.ts,CodeBlockCopyButton.ts, andViewCodeDialog.tsunderpackages/component/src/Styles/StyleSet/Added a
### Deprecatedentry toCHANGELOG.mdI have added tests and executed them locally
I have updated
CHANGELOG.mdI have updated documentation
Review Checklist
z-index)package.jsonandpackage-lock.jsonreviewed