serve local file in pxt serve again #8099
Merged
Conversation
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.
When I gave #8097 a quick check locally, my local markdown updates weren't going through and I noticed it was fetching everything from the server.
Turns out this weird behavior https://github.com/microsoft/pxt/pull/7989/files#r598994321 of updating as a side effect was the thing preventing it from serving docs from the server instead of the local versions when doing a
pxt serve, as setting that to true makes us skip the local request path here:pxt/pxtlib/emitter/cloud.ts
Lines 184 to 195 in 108e378
Fix that so we don't go to makecode.com/api/* for markdown on pxt serve. (the changes are just guarding with
pxt.BrowserUtils.isLocalHostDev()in a few places where we don't want to default to fetching from server -- e.g. we still want to get updates when if we're doing incontext translations or if we passlivelang=de)