docs(extension-development): resource transformer registry - #109
Merged
Merged
Conversation
Adds a Backend Development page covering resource transformers from core-api v1.6.68: when to use them versus expansions, observers and custom fields; how output flows through FleetbaseResource::resolve() and which surfaces are covered (responses, nested resources, collections, webhooks, broadcasts); defining a transformer; targets (resource class, model class, interface, '*') and subclass matching; priority, contexts and only options; registration via the $transformers property, directory discovery, closures and the registry API; the transformer context; batch loading with prepare(); webhook and broadcast channels; return value semantics; testing; pitfalls; a full API reference; and migration from the legacy duck-typed registry. Wires the page into the section navigation and cross-links it from the service provider page, the expansions & observers page and the section index.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
Documents the agnostic resource transformer registry shipped in core-api v1.6.68 (fleetbase/core-api#285, released via #286) for extension developers.
New page: Backend Development → Resource Transformers (
/docs/extension-development/backend/resource-transformers), covering:FleetbaseResource::resolve()and every surface covered (JSON responses, nested resources, collection items, webhook payloads, socket broadcasts)Transformerbase class or theResourceTransformercontract'*', arrays) and subclass matching, with guidance on choosing onepriority,contextsandonlyoptions and their semantics$transformersproperty,registerTransformersFrom()discovery, closures and the registry API, plus registration rules under OctaneResourceTransformerContextAPIprepare()to avoid N+1 queriesMissingValue,MergeValue,without()exclusions)Also wires the page into
meta.jsonand cross-links it from the Service Provider page (property and helper tables, fan-out section), the Expansions & Observers page and the section index card.Verification
pnpm exec fumadocs-mdxcompiles the content.next devand confirmed it returns 200 with all sections and tables intact.Notes
Source links point at
fleetbase/core-apimain; they resolve once the v1.6.68 release PR is merged, so this is best merged after fleetbase/core-api#286.