| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Add @method decorator for configuring custom service methods - Support different argument signatures (not just data, params) - Support different HTTP verbs (GET, POST, PUT, PATCH, DELETE) - Support clean URL paths (e.g., /messages/:id/status) - Support internal-only methods with external: false - Add buildMethodConfig() helper for client configuration - Add InferServiceTypes type helper for typed clients - Update REST client to support custom method paths and verbs - Update services and REST client documentation The @method decorator allows custom methods to be first-class citizens with flexible signatures, proper HTTP verb mapping, and clean URLs instead of relying on X-Service-Method headers. Closes #1976 Replaces #3638
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
feathers-v6 | d691de1 | Jan 30 2026, 03:17 PM |
Sorry, something went wrong.
- Add clientMethods() to filter and prepare method configs for client - Remove buildMethodConfig(), getClientMethodConfig(), InferServiceTypes - clientMethods() filters out external:false methods and strips server-only properties - Types come from service class definitions, not runtime config - Remove any types from method.ts, use proper typing - Add custom methods type test to declarations.test.ts - Update documentation for new pattern
|
Update: Improved client configuration API** Changed how method configuration is passed to the client to avoid bundling server-side code. Before (problematic): // This required importing service CLASSES, bundling server code into the client
import { buildMethodConfig, type InferServiceTypes } from '@feathersjs/feathers'
import { MessageService } from './services/messages.service'
const services = { messages: MessageService }
export const serviceMethods = buildMethodConfig(services) // instantiated classes internally
export type ServiceTypes = InferServiceTypes<typeof services>After (secure): // Only imports the static methods CONFIG object, not the class implementation
import { clientMethods } from '@feathersjs/feathers'
import { MessageService } from './services/messages.service'
export const serviceMethods = clientMethods({
messages: MessageService.methods // just the static property
})
export type ServiceTypes = {
messages: MessageService // types defined separately
}What clientMethods() does:
Key insight: Types come from the service class definition itself. The runtime config (clientMethods()) only tells the HTTP client which verb/path to use — it doesn't affect TypeScript types at all. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR adds enhanced custom method support for Feathers v6, allowing custom methods to be first-class citizens with flexible signatures, proper HTTP verb mapping, and clean URLs.
Features
Example
Documentation
Tests
All 405 tests pass.
Related