Module: lib/core/runtime/builtins

The registry of components an application gets without declaring them.

Why this is a registry rather than an import

AvenxApp used to import { VirtualList } and register it in its constructor. That is one line, and it put VirtualList, the template renderer and the DOM patcher into every bundle ever built -- including the overwhelming majority of applications that never write <VirtualList>. Roughly 60 KB of source, reachable because of a registration nobody asked for.

A built-in is now registered by importing a module whose only job is to register it, and the compiler adds that module to the graph when it sees the tag in a template. An application that uses the component pays for it; one that does not, does not.

Deliberately tiny

This module imports nothing, for the same reason module:lib/core/renderer/stringRenderer imports nothing: a default would make the thing it defaults to reachable, and the arrangement would achieve nothing.

Source:

Members

(inner, constant) builtins :Map:.<string:, function()>

Built-in component classes by tag name.

Type:
  • Map:.<string:, function()>
Source:

Methods

(static) getBuiltins() → {Map:.<string:, function()>}

Every registered built-in, for an application to adopt at construction.

Source:
Returns:

The registry.

Type
Map:.<string:, function()>

(static) registerBuiltin(name, componentClass)

Registers a built-in component.

Parameters:
Name Type Description
name string

The PascalCase tag name.

componentClass function

The component class.

Source: