ilokesto

Extensibility

createProxy, PluginManager, and the exported helper types.

Extensibility

This page is the overview of Utilinent's extension story. It exists to answer one question: if the built-in primitives are not enough, what are the moving parts behind custom variants and proxy-backed APIs?

createProxy

createProxy(base, renderForTag, category) is the function that turns a base primitive into a proxy-backed export such as Show or For.

If you want the full runtime flow, type model, and a custom component tutorial, read createProxy.

At a high level it combines:

  • the base component,
  • generated HTML-tag variants,
  • plugin-backed variants resolved by category and then base.

PluginManager

PluginManager is the singleton registry behind plugin-backed variants.

import { PluginManager } from '@ilokesto/utilinent';

PluginManager.register({
  show: {
    FancyCard,
  },
  base: {
    MotionButton,
  },
});

Public static methods include:

  • register()
  • get()
  • getAll()
  • has()
  • unregister()

Because it is singleton global state, registrations affect later proxy lookups across the app.

Exported types

The root package also exports type helpers for extension work:

  • UtilinentRegister
  • BaseTypeHelperFn
  • ProxyType

These are relevant when you want typed module augmentation or your own proxy-aware APIs. The detailed type walkthrough lives on createProxy.

Where useIntersectionObserver fits

The hook is user-facing, but it also belongs to the extension story because Observer and Slacker build on top of it rather than duplicating observer logic.

When to read this page

Read this page if you want the architecture at a glance. If you want the step-by-step “how do I actually build one?” version, continue to createProxy.

On this page