Repository navigation
Publish runtime plugins as TypeScript source - #56
Merged
Merged
Conversation
Deployments upload plugins/<name>.ts instead of a prebuilt bundle. A node compiles each version on first use with the existing worker bundler and compile queue, asks the plugin to describe itself in an isolate with no secrets, and validates operation input and output with an interpreted JSON Schema draft 7 validator, since Workers cannot compile Ajv validators at runtime. Removes scripts/bundle-plugin.ts and the record format.
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.
Follow-up to #53 and #54. A deployment repo had to commit a minified JSON bundle per plugin and verify it in CI. Now it uploads the plugin's TypeScript source to
plugins/<name>.tsand Artifacts compiles it.@cloudflare/worker-bundlerpath and compile queue that scripts use. The plugin is one file: it may import@sidequery/artifacts/plugins, supplied as a virtual module, and Workers builtins. The isolate wrapper (src/plugins/runtime-entry.ts) is prebuilt intodist/cloudflare/plugin-runtime.json.PLUGIN_*.@cfworker/json-schema(draft 7, interpreted), because Workers cannot compile Ajv validators at runtime. Authorization, secrets, the 30s timeout and error messages still go through the shared dispatcher in the plugin's isolate.plugins_list, and calls to it returnPlugin configuration unavailable, with the reason in the log.scripts/bundle-plugin.tsand the.jsonrecord format, which only shipped in Load server plugins from the deployment bucket at runtime #53/Make published plugin bundles reproducible #54.Tests:
test:cloudflareandtestpass. An auth-flow socket hang-up and a celld startup timeout during the full runs were from load on the test machine and passed on rerun.