[Repo Assist] fix: add --root to fsdocs watch; fix WebSocket hot-reload URL#1164
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
[Repo Assist] fix: add --root to fsdocs watch; fix WebSocket hot-reload URL#1164github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
…et hot-reload Closes #924 Previously fsdocs watch always forced root = http://localhost:<port>/, ignoring any user-supplied root parameter. This makes the generated pages unusable when served via GitHub Codespaces port-forwarding, a reverse proxy, or any other non-localhost environment. Changes: - Add --root option to WatchCommand to override the root URL - Add abstract root_override_option to CoreBuildOptions (default None) - Watch-mode root logic: uses --root value when provided, else falls back to http://localhost:<port>/ as before - Fix WebSocket hot-reload URL to use window.location.host instead of hardcoded localhost, enabling hot reload across reverse proxies and Codespaces Usage: fsdocs watch --root / # root-relative URLs fsdocs watch --root https://example.com/docs/ # absolute remote URL Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
This is an automated pull request from Repo Assist.
Supersedes #1089, which had accumulated many merge commits and could not be cleanly rebased.
Summary
Fixes two issues with
fsdocs watch:WebSocket hot-reload URL was hardcoded to
ws://localhost:<port>/websocket, breaking hot reload in GitHub Codespaces, behind reverse proxies, and over HTTPS. Now usesws://" + window.location.host + "/websocketinstead.Root URL override (
--root):fsdocs watchpreviously forced root =(localhost/redacted) ignoring any user-specified root. Adds a--rootoption toWatchCommand` so users can specify the root URL when serving behind a proxy or from a non-localhost environment.Usage:
Changes
src/fsdocs-tool/BuildCommand.fs:generateWatchScript: remove port param; usewindow.location.hostfor WebSocket URIroot_override_optiontoCoreBuildOptions(defaultNone)root_override_optionwhen set, else fall back to localhostWatchCommand: add--rootoption, overrideroot_override_optionRELEASE_NOTES.md: add entries for both fixesTest Status
Closes #924