Plugin align with real usage#3
Merged
Merged
Conversation
The base class advertised open(), close(), and processMessage(message) with no parameters, but sitespeed.io has long called them with positional arguments — open(context, options), close(options, errors), and processMessage(message, queue) — and every built-in plugin already relies on those args. The README likewise omitted the positional constructor contract that the plugin loader requires (new MyPlugin(options, context, queue)), the concurrency class field the queue handler reads, and the framework-level lifecycle messages a plugin typically needs to handle. The result was that every new plugin author had to read other plugins to figure out the real API. This change aligns the JSDoc and the README with how sitespeed.io actually drives plugins, without changing behaviour: defaults remain no-ops, the abstract guard stays, and existing subclasses keep working. Co-authored-by: Claude Opus 4.7 (1M context) noreply@anthropic.com
The base class advertised open(), close(), and processMessage(message) with no parameters, but sitespeed.io has long called them with positional arguments — open(context, options), close(options, errors), and processMessage(message, queue) — and every built-in plugin already relies on those args. The README likewise omitted the positional constructor contract that the plugin loader requires (new MyPlugin(options, context, queue)), the concurrency class field the queue handler reads, and the framework-level lifecycle messages a plugin typically needs to handle. The result was that every new plugin author had to read other plugins to figure out the real API. This change aligns the JSDoc and the README with how sitespeed.io actually drives plugins, without changing behaviour: defaults remain no-ops, the abstract guard stays, and existing subclasses keep working. Co-authored-by: Claude Opus 4.7 (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.
No description provided.