Title: [Feature]: Promote `plugin` to Stable — freeze the hook-bus / DI / directive APIs · Issue #145 · bQuery/bQuery · GitHub
Open Graph Title: [Feature]: Promote `plugin` to Stable — freeze the hook-bus / DI / directive APIs · Issue #145 · bQuery/bQuery
X Title: [Feature]: Promote `plugin` to Stable — freeze the hook-bus / DI / directive APIs · Issue #145 · bQuery/bQuery
Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case plugin is Beta and is the extensibility contract the whole ecosystem...
Open Graph Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case plugin is Beta and is the ex...
X Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case plugin is Beta and is the ex...
Opengraph URL: https://github.com/bQuery/bQuery/issues/145
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature]: Promote `plugin` to Stable — freeze the hook-bus / DI / directive APIs","articleBody":"**Pre-flight checklist**\n- [x] I searched existing issues and did not find a duplicate request.\n- [x] I explained the problem or use case, not just the desired API.\n\n**Problem or use case**\n`plugin` is **Beta** and is the extensibility contract the whole ecosystem would build on — yet its surface is one minor old: the hook bus, DI container, async install, namespaced directives, and `unuse`/`uninstall` all arrived in 1.14.0. Third-party plugin authors cannot target a moving extension API; the contract must be frozen before an ecosystem can form.\n\n**Proposed solution**\nFreeze the plugin API (hook bus, DI container, install/uninstall lifecycle, namespaced directive registration) for at least one minor cycle and publish a plugin-author guide documenting the lifecycle, hook timing, DI resolution rules, and directive-namespacing conventions. Add coverage for install/uninstall symmetry (no leaked hooks/directives after `uninstall`). Exit criteria: frozen surface, author guide, tested lifecycle symmetry.\n\n**Possible API or UX shape**\n```ts\nimport { definePlugin } from \"@bquery/bquery/plugin\";\n\nexport default definePlugin({\n name: \"my-plugin\",\n async install(ctx) {\n ctx.provide(\"token\", service);\n ctx.directive(\"my:thing\", handler);\n ctx.hook(\"view:updated\", fn);\n },\n uninstall(ctx) { /* must cleanly remove all of the above */ }\n});\n```\n\n**Alternatives considered**\nPromoting before freezing — would strand early plugin authors on a changing contract. Expanding the hook surface further first — fine while Beta, but it must stop for a cycle to earn Stable.\n\n**Relevant area**\n`plugin`\n\n**Additional context**\nA stable `plugin` API is a prerequisite for any community ecosystem, which is itself one of bQuery's adoption gaps versus the established frameworks. Lifecycle symmetry (clean `uninstall`) is the highest-risk area to test.\n","author":{"url":"https://github.com/JosunLP","@type":"Person","name":"JosunLP"},"datePublished":"2026-06-26T21:25:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/145/bQuery/issues/145"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:34e195c4-ca23-f876-dcee-cbcf54976b35 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AE48:2CD26:D19C80:133A01B:6A4E2B36 |
| html-safe-nonce | da09b3e6556040a32598c7ae8920fcb064173819d08d27de59b6a60c57b1c2b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRTQ4OjJDRDI2OkQxOUM4MDoxMzNBMDFCOjZBNEUyQjM2IiwidmlzaXRvcl9pZCI6IjkxODkxNTcyMjEwNTY3ODUyMDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d6cac5c279ccae1029f10de7ae6bed43dfad9fdfee59a8b210bee72279617794 |
| hovercard-subject-tag | issue:4755239768 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bQuery/bQuery/145/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2b505ad2742e8de64e1dcf2ee65de4cdfbe7da4ac9dfe469ab558a47c5d1da45/bQuery/bQuery/issues/145 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2b505ad2742e8de64e1dcf2ee65de4cdfbe7da4ac9dfe469ab558a47c5d1da45/bQuery/bQuery/issues/145 |
| og:image:alt | Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case plugin is Beta and is the ex... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JosunLP |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width