Align plugin-starter with Tyk v5.14+ (docs + ES2020 build)#2
Merged
Conversation
The starter described the engine as otto-era ES5.1 and forbade features goja actually supports. Correct the runtime model and bump the build target now that goja is v5.14+-only: - AGENTS.md: goja is ES2020-capable; allow ?./??/BigInt/sync Promises; keep the real constraints (no module loader, no event loop, no Node APIs); add TykBatchRequest; add an otto migration-route note. - README/e2e: fix the custom_middleware_bundle field name, drop the unsubstantiated tyk-sync claim, document the inline code path, and remove the stale otto driver-swap narrative (e2e gateway is built from the goja branch). - Bump webpack/tsconfig target ES5 -> ES2020 (root + all examples). - Harness: register the missing TykBatchRequest global. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Summary
AGENTS.md/README.md/e2e/to match the goja v5.14+ runtime — drop the stale otto-era "ES5.1" constraints, fix thecustom_middleware_bundlefield-name bug (was plural), document the inlinecodedeploy path, and remove the obsolete e2e otto driver-swap narrative (the e2e gateway is built from the goja branch).?./??/BigInt/ synchronously-resolving Promises) hold end-to-end.TykBatchRequestglobal to the docs and register it in the test harness.Why
An audit against the goja gateway source (
TT-16948) and the pinned goja library showedAGENTS.mdforbade several features goja actually supports (?.,??,BigInt, async), and described the engine as ES5.1 (otto-era). Since goja is v5.14+-only, the build target is bumped to make the corrected guidance true at runtime.Test plan
npm test(root) — 3/3 pass.npm run build(root + an example) — compiles cleanly on the ES2020 target (webpack 5.106).🤖 Generated with Claude Code
Preview Page:
https://tyk-docs-goja-inline-mintlify.mintlify.app/api-management/plugins/javascript