Skip to content

fix(get_component_api): surface deprecated and experimental API flags - #22

Open
dobrinyonkov wants to merge 1 commit into
mainfrom
fix/surface-deprecated-experimental-flags
Open

fix(get_component_api): surface deprecated and experimental API flags#22
dobrinyonkov wants to merge 1 commit into
mainfrom
fix/surface-deprecated-experimental-flags

Conversation

@dobrinyonkov

Copy link
Copy Markdown
Contributor

Problem

The server was dropping deprecated and _ui5experimental fields from the CEM before returning the API reference. LLMs then confidently recommended retired APIs. Concrete case: ui5-avatar's interactive property (retired in 2.20) already ships with a @deprecated reason in the published CEM, but the reason never made it into the tool response.

Changes

  • types.ts: add deprecated?: string | boolean and _ui5experimental?: string | boolean to the manifest and component types.
  • manifest_processor.ts: pass flags through in findComponentInManifest, and render ⚠ DEPRECATED: <reason> and 🧪 EXPERIMENTAL: <note> markers next to attributes, slots, events, methods. Component-level flags surface as a ## Stability section.
  • New optional hideDeprecated: boolean argument on the tool (default false) — when true, deprecated members are filtered out entirely.

Tests

Unit tests cover string and boolean values for both flags, the hideDeprecated filter, component-level stability, and flag pass-through. Two end-to-end handler tests with a mocked CEM confirm the wiring. Existing tests using global.fetch were converted to test.serial because they mutate a shared global.

Manual verification

Smoke-tested against @ui5/webcomponents@latest (2.25.0). Calling get_component_api for ui5-avatar now returns:

### interactive
- **⚠ DEPRECATED:** Set `mode="Interactive"` instead for the same functionality with proper accessibility.
- **Type:** boolean

With hideDeprecated: true, the interactive heading is gone.

The server was dropping deprecated and _ui5experimental fields from the CEM
before returning the API reference, so LLMs recommended retired APIs. Now
they render inline as warnings next to affected attributes, slots, events
and methods. Adds an opt-in hideDeprecated argument to filter them out.

Tested against @ui5/webcomponents@latest — ui5-avatar's deprecated
interactive property now surfaces its retirement reason.

global.fetch = async (url) => {
const u = String(url);
if (u.includes('registry.npmjs.org')) {
}),
} as Response;
}
if (u.includes('unpkg.com')) {

global.fetch = async (url) => {
const u = String(url);
if (u.includes('registry.npmjs.org')) {
}),
} as Response;
}
if (u.includes('unpkg.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.

2 participants