Skip to content

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Aug 27, 2025

  • Remove Fetch from CrossLinkResolver, enforce eager fetching of crosslinks.
  • Found more cases of unhandled navigation types

By removing Fetch from ICrossLinkResolver and enforcing it takes a FetchedCrossLinks directly and not a ICrossLinkFetcher instance, we enforce instances of ICrossLinkResolver have immediate access to resolve.

This removes a hidden requirement that Fetch() needed to be called before TryResolve() was usable. It also removes a hidden requirement that DocumentationSet was unusable before DocumentationGenerator called Fetch() on its public ICrossLinkResolver property.

This PR untangles that making DocumentationSet immediately useable after construction.

This allows us to build a clean resolved navigation and emit errors/warnings as we build it.

Removing the need to do an asynchronous touchups after construction.

This also allows us to trust the crosslinks are valid as defined on CrossLinkReference and that the urls are valid on CrossLinkNavigationItem.

Uncovered two more places where CrossLinkNavigationItem was not handled, updating navigation index and parent as part of GlobalNavigation as part of the assembler build.

…slinks.

This removes a hidden requirement on `DocumentationSet` that its resolver is not usable until `DocumentationGenerator.GenerateAll()` has been called.

We now enforce `DocumentationSet` receives a `ICrossLinkResolver` that is ready to resolve crosslinks.
@Mpdreamz Mpdreamz requested a review from a team as a code owner August 27, 2025 09:54
@Mpdreamz Mpdreamz added the fix label Aug 27, 2025
@Mpdreamz Mpdreamz self-assigned this Aug 27, 2025
@Mpdreamz Mpdreamz added the fix label Aug 27, 2025
@Mpdreamz Mpdreamz changed the title feature/eager cross link resolving Remove Fetch from CrossLinkResolver, enforce eager fetching of crosslinks Aug 27, 2025
@Mpdreamz Mpdreamz merged commit 2a3a20a into crosslinks-in-toc-take-three Aug 27, 2025
19 checks passed
@Mpdreamz Mpdreamz deleted the feature/eager-cross-link-resolving branch August 27, 2025 11:27
Copy link
Contributor

@cotti cotti left a comment

Choose a reason for hiding this comment

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

Neat!

Mpdreamz added a commit that referenced this pull request Sep 9, 2025
* Add crosslinks to toc

* Fix errors

* Update docs

* Add title validation

* Add ctx for Cancel

* FileNavigationItem can be ignored

* Remove redundant code

* Move routine

* Fix resolution

* Fix hx-select-oob for nav crosslinks

* Add validation and title as mandatory

* Add utility class for crosslink validation

* Remove redundant file

* Refactor NavCrossLinkValidator

* Ensure we inject docs-builder on CI for integration tests as well

* allow docs-builder to have local checkout folder on CI

* Ensure we hadnle CrossLinkNavigationItem when building the sitemap by ignoring them

* Remove `Fetch` from CrossLinkResolver, enforce eager fetching of crosslinks (#1784)

* Remove `Fetch` from CrossLinkResolver, enforce eager fetching of crosslinks.

This removes a hidden requirement on `DocumentationSet` that its resolver is not usable until `DocumentationGenerator.GenerateAll()` has been called.

We now enforce `DocumentationSet` receives a `ICrossLinkResolver` that is ready to resolve crosslinks.

* Found more cases of unhandled navigation types

* Remove new caching behavior in DocSetConfigurationCrossLinkFetcher

---------

Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants