feat(extensibility): FUNC-577 - Gates provide composable handlers#65
Draft
johnstonmatt wants to merge 25 commits into
Draft
feat(extensibility): FUNC-577 - Gates provide composable handlers#65johnstonmatt wants to merge 25 commits into
johnstonmatt wants to merge 25 commits into
Conversation
commit: |
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.
This pull request introduces a new extensibility system called gates to the
@supabase/serverpackage, enabling users and third-party authors to add reusable middleware-like wrappers (such as feature flags, rate limiting, etc.) to fetch handlers. The PR also adds documentation and updates package exports to support this new system, including a built-in feature flag gate as an example. Below are the most important changes:Gates System Introduction & Documentation
README.mdexplaining gates: what they are, how to use them, and where to find documentation and examples. This includes usage patterns, TypeScript inference details, and links to authoring guides.src/core/gates/README.mdwith detailed documentation for gate authors and consumers, including type safety guarantees, composition rules, and authoring patterns using the newdefineGateprimitive.Exports and Packaging
package.jsonandjsr.jsonto export the new@supabase/server/core/gates(gate authoring primitives) and@supabase/server/gates/feature-flag(the worked example gate), making them available for import in user projects. [1] [2] [3]Documentation and Discoverability
README.mdto list the new gate-related exports and provide direct links to documentation for extending handlers, writing custom gates, and using the feature flag gate. [1] [2]Changelog
CHANGELOG.mdfor consistency.Notes