Load remote Liquid docs in browser extension#1016
Draft
charlespwd wants to merge 1 commit into
Draft
Conversation
94aee9b to
a39bb36
Compare
9 tasks
a39bb36 to
79d91b9
Compare
79d91b9 to
12981a1
Compare
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.
What are you adding in this PR?
Related issue: Shopify/developer-tools-team#783
Stacked on #1240.
Updates the browser Shopify Liquid extension to load Liquid docs from a remote JSON bundle at runtime, while keeping the webpack-bundled docs as the emergency fallback.
Default behavior:
latest.jsoncan either be the full bundle or point at a revisioned bundle:{ "schemaVersion": 1, "revision": "40f966fc7793462726d9f8573c8d522f8ab44c54", "url": "/liquid-docs/v1/revisions/40f966fc7793462726d9f8573c8d522f8ab44c54.json" }For hosts that cannot serve same-origin docs, the browser extension now supports an optional setting:
{ "shopifyLiquid.remoteLiquidDocsUrl": "https://code-editor.shopifycdn.com/liquid-docs/v1/latest.json" }The remote bundle is used only when it passes basic validation:
schemaVersionis supportedrevisionis presenttags,filters,objects, andschemasare arrayssystemTranslationsis an objectIf fetch or validation fails, the extension falls back to bundled docs. This keeps github.dev and other unsupported hosts functional even when remote docs are unavailable or blocked by CSP/CORS.
What's next? Any followup issues?
The host/CDN side needs to publish compatible JSON artifacts after #1240 is released and
@shopify/theme-check-docs-updaterincludestheme-docs bundle.No additional theme-tools follow-up is planned after that publisher exists.
Tophatting
pnpm --dir packages/vscode-extension type-checkpnpm --dir packages/vscode-extension build:extensionpnpm type-checkpnpm format:checkgit diff --checkBefore you deploy
changeset