KirillOsenkov / SourceBrowser

Source browser website generator that powers http://referencesource.microsoft.com and http://sourceroslyn.io
Apache License 2.0
1.08k stars 197 forks source link

Allow browsing a specific version/tag on source.dot.net #207

Open cremor opened 2 years ago

cremor commented 2 years ago

I just found a method on source.dot.net that was commited just 5 days ago and therefore is not yet available in .NET 6. Now, this case is quite obvious, because the API simply doesn't exist when you try to use it. But then I thought about implementation details. What if I use source.dot.net to learn how something is actually implemented in .NET? I might find code on source.dot.net that is different from what my application will actually execute.

I think a good solution would be to allow the user to select a .NET version on source.dot.net. Or, to be better in sync with GitHub, maybe a Git tag. It could then default to the latest released version/tag, but allow the user to change it. Additionally, the user could select the main branch to retain the current behaviour of showing the latest code (that might not be released yet).

KirillOsenkov commented 2 years ago

Unfortunately this is out of scope and is unlikely to be ever implemented. While a good idea, the way SourceBrowser is implemented it pregenerates static HTML for the entire repo, so having these per commit would be prohibitively expensive.

Other system that are designed differently may support it, but we won't. Sorry!

cremor commented 2 years ago

That's sad to hear, but then how about a simpler solution: Would it be possible that source.dot.net only shows the latest released version (e.g. latest Git tag)? If someone really wants to see unreleased code he can always switch to GitHub.

The tag name could then be shown in the header banner, just like https://referencesource.microsoft.com shows ".NET Framework 4.8" in its banner.

Btw, that brings me to a question: Is the source on https://referencesource.microsoft.com static? I don't expect many (any?) changes for .NET Framework, but just as a general question.

KirillOsenkov commented 2 years ago

Yes, https://referencesource.microsoft.com is frozen in time forever

It is more practical to index the latest on https://source.dot.net because indexing happens as part of builds, and builds build the latest.

Sorry about the inconvenience.