fix(get_component_api): surface deprecated and experimental API flags - #22
Open
dobrinyonkov wants to merge 1 commit into
Open
fix(get_component_api): surface deprecated and experimental API flags#22dobrinyonkov wants to merge 1 commit into
dobrinyonkov wants to merge 1 commit into
Conversation
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')) { |
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.
Problem
The server was dropping
deprecatedand_ui5experimentalfields from the CEM before returning the API reference. LLMs then confidently recommended retired APIs. Concrete case:ui5-avatar'sinteractiveproperty (retired in 2.20) already ships with a@deprecatedreason in the published CEM, but the reason never made it into the tool response.Changes
types.ts: adddeprecated?: string | booleanand_ui5experimental?: string | booleanto the manifest and component types.manifest_processor.ts: pass flags through infindComponentInManifest, and render⚠ DEPRECATED: <reason>and🧪 EXPERIMENTAL: <note>markers next to attributes, slots, events, methods. Component-level flags surface as a## Stabilitysection.hideDeprecated: booleanargument on the tool (defaultfalse) — when true, deprecated members are filtered out entirely.Tests
Unit tests cover string and boolean values for both flags, the
hideDeprecatedfilter, component-level stability, and flag pass-through. Two end-to-end handler tests with a mocked CEM confirm the wiring. Existing tests usingglobal.fetchwere converted totest.serialbecause they mutate a shared global.Manual verification
Smoke-tested against
@ui5/webcomponents@latest(2.25.0). Callingget_component_apiforui5-avatarnow returns:With
hideDeprecated: true, theinteractiveheading is gone.