Module: Phlex::Reactive::Component::DSL

Extended by:
ActiveSupport::Concern
Included in:
Phlex::Reactive::ClientBindings
Defined in:
lib/phlex/reactive/component/dsl.rb

Overview

The class-level declaration DSL (issue #115): the five registries a component declares itself through — reactive_record, reactive_state, action, reactive_collection, reactive_compute — their public readers, and from_identity (rebuilding an instance from a verified identity payload). Every registry resolves through Component::Registry, so all five share ONE inheritance semantic: resolve through the superclass at read time, memoized per class against the registry generation.

The readers are PUBLIC API — the action endpoint (reactive_action/ reactive_action?/reactive_actions), Response (reactive_collection_def), Streamable's default #id (reactive_record_key), doctor, and the test helpers all dispatch through them. They keep their exact signatures forever; new reader forms (reactive_compute_def) are added alongside, never instead.

Constant Summary collapse

MIRROR_ID_SELECTOR =

A cross-root mirror target must be a single ID selector (issue #159) — "#" + a CSS identifier, nothing else. Not a class, not an attribute selector, not *, not a compound/descendant/list selector: a compromised reducer must not be able to scribble text across the page. The client interpreter enforces the SAME shape (two-sided default-deny, mirroring the attr allowlist posture).

/\A#[A-Za-z_][\w-]*\z/