Skip to content

docs(extension-development): resource transformer registry - #109

Merged
roncodes merged 1 commit into
mainfrom
docs/resource-transformers
Oct 5, 2026
Merged

roncodes merged 1 commit into
mainfrom
docs/resource-transformers

Conversation

@roncodes

@roncodes roncodes commented Oct 3, 2026

Copy link
Copy Markdown
Member

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:

  • when to use a transformer versus expansions, observers and custom fields
  • how output flows through FleetbaseResource::resolve() and every surface covered (JSON responses, nested resources, collection items, webhook payloads, socket broadcasts)
  • defining a transformer with the Transformer base class or the ResourceTransformer contract
  • targets (resource class, model class, interface, '*', arrays) and subclass matching, with guidance on choosing one
  • priority, contexts and only options and their semantics
  • registration through the $transformers property, registerTransformersFrom() discovery, closures and the registry API, plus registration rules under Octane
  • the ResourceTransformerContext API
  • batch loading with prepare() to avoid N+1 queries
  • webhook and broadcast channels
  • return-value semantics (MissingValue, MergeValue, without() exclusions)
  • a Pest testing example, pitfalls, a full reference of the registry, resource and contract APIs
  • migrating from the legacy duck-typed registry

Also wires the page into meta.json and 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-mdx compiles the content.
  • Rendered the page on next dev and confirmed it returns 200 with all sections and tables intact.

Notes

Source links point at fleetbase/core-api main; they resolve once the v1.6.68 release PR is merged, so this is best merged after fleetbase/core-api#286.

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.
@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fleetbase-io Ready Ready Preview Oct 3, 2026 6:58am UTC

Request Review

@roncodes
roncodes merged commit 6864e0e into main Oct 5, 2026
2 checks passed
@roncodes
roncodes deleted the docs/resource-transformers branch October 5, 2026 08:02

This branch was successfully deployed

1 active deployment
Preview — 2dab3eb8 Deployed Oct 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant