Skip to content

refactor(website): Enhance API shortlinks to support staged renames - #28151

Merged
Joshua Smithrud (Josmithr) merged 12 commits into
microsoft:mainfrom
Josmithr:website/staged-api-links
Sep 8, 2026
Merged

refactor(website): Enhance API shortlinks to support staged renames#28151
Joshua Smithrud (Josmithr) merged 12 commits into
microsoft:mainfrom
Josmithr:website/staged-api-links

Conversation

@Josmithr

Copy link
Copy Markdown
Contributor

The website publishes from main, but it consumes API documentation artifacts from release branches. As a result, documentation cannot normally link to a new or renamed API until the related API changes are released.

ApiLink and PackageLink now support temporary transitions for these cases.

New APIs

Add newApi when the published API documentation does not contain the target. The component renders inline code until the target exists. It then renders a link and writes a cleanup warning.

<ApiLink package="fluid-framework" api="NewApi" newApi />

<PackageLink package="new-package" newApi />

Renamed APIs and packages

Use { previous, new } to support both sides of a rename. The component links to new when it exists and otherwise links to previous.

<ApiLink
	package="fluid-framework"
	api={{ previous: "OldApi", new: "(NewApi:class)" }}
/>

<PackageLink package={{ previous: "old-package", new: "new-package" }} />

When the new target becomes available, the build writes a warning. Replace the transition object with the new value:

<ApiLink package="fluid-framework" api="(NewApi:class)" />

<PackageLink package="new-package" />

Invalid and ambiguous API references remain build errors. Explicit child content is preserved in all transition states.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Hi! Thank you for opening this PR. Want me to review it?

Based on the diff (633 lines, 5 files), I've queued these reviewers:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

With the feature flag rolled back, new documents and any documents that haven't been upgraded yet will not have the upgrade enabled.
{/* TODO: link directly to `isStagedUpgradeEnabled` property once it has been released. */}
You can use <ApiLink package="fluid-framework" api="(TreeViewAlpha:interface)"/>'s `isStagedUpgradeEnabled` property to check whether a document has already been upgraded and conditionally include that upgrade token for those documents.
You can use <ApiLink package="fluid-framework" api="(TreeViewAlpha:interface).isStagedUpgradeEnabled" newApi/> to check whether a document has already been upgraded and conditionally include that upgrade token for those documents.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: this is an example of one of the classes of problems this PR is aimed at addressing. We added docs for a new property that hadn't yet been released and initially tried to link to it, which caused the website build to fail. We can now "stage" the link, which will go live as soon as the API has been released.

Comment thread website/README.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The core refactor is clean and the tests looks good. Just take a look at the missing md link

Comment thread website/README.md Outdated
Comment thread website/README.md Outdated
Comment thread website/README.md Outdated
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Comment thread website/README.md Outdated
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bundle size comparison

Base commit: could not be determined; will be reported when the comparison runs
Head commit: d72511653542681d546b39d561a6f06d793c99c7

Pending — Build - client packages is running. Results will appear here when the build completes.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output

$ start-server-and-test "npm run serve -- --host 127.0.0.1 --no-open" http://127.0.0.1:3000 check-links
1: starting server using command "npm run serve -- --host 127.0.0.1 --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-website@0.0.0 serve
> docusaurus serve --host 127.0.0.1 --no-open

[SUCCESS] Serving "build" directory at: http://127.0.0.1:3000/

> fluid-framework-website@0.0.0 check-links
> linkcheck http://127.0.0.1:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  340614 links
    2042 destination URLs
    2297 URLs ignored
       0 warnings
       0 errors


@Josmithr
Joshua Smithrud (Josmithr) merged commit 1f0cc67 into microsoft:main Sep 8, 2026
29 checks passed
@Josmithr
Joshua Smithrud (Josmithr) deleted the website/staged-api-links branch September 8, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: repo Repo related work area: tools area: website base: main PRs targeted against main branch documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants