Skip to main content

Crate pocopine_core

Crate pocopine_core 

Source
Expand description

pocopine-core — client-side reactive runtime.

Pure compiled-views runtime (RFC-058 Phase 6.5). Every .poco template lifts via #[component] into a static template plan; mounting walks that plan instead of scanning the DOM for pp-* directives. Reactivity is implemented against a real js_sys::Proxy so get/set traps match Alpine-style semantics for dependency tracking; signals, computed values, and watchers compose with the same engine via a synthetic reactive::SIGNAL_SCOPE.

Re-exports§

pub use app::encode_route_fragment;
pub use app::encode_route_path_segment;
pub use app::encode_route_query_part;
pub use app::App;
pub use app::AppPlugin;
pub use app::Component;
pub use app::IntoRouteTarget;
pub use app::Loader;
pub use app::LoaderContext;
pub use app::LoaderError;
pub use app::PageMeta;
pub use app::PageMetaContext;
pub use app::PageMetaTag;
pub use app::Prefetch;
pub use app::PrefetchTrigger;
pub use app::RouteComponent;
pub use app::RouteConfig;
pub use app::RouteContext;
pub use app::RouteErrorSurface;
pub use app::RouteGuard;
pub use app::RouteGuardDecision;
pub use app::RouteLoader;
pub use app::RouteLoaderFuture;
pub use app::RouteMeta;
pub use app::RouteMetaKey;
pub use app::RouteName;
pub use app::RouteQuery;
pub use app::RouteRejection;
pub use app::RouteRejectionAction;
pub use app::RouteRejectionContext;
pub use app::RouteRejectionHandler;
pub use app::RouteTarget;
pub use app::RouteTargetBuilder;
pub use app::RouteTargetError;
pub use app::RouteUrl;
pub use app::SubtreeHandle;
pub use client_module::ClientModule;
pub use client_module::ClientModuleError;
pub use computed::computed;
pub use computed::Computed;
pub use context::InjectKey;Deprecated
pub use context::inject;
pub use context::provide;
pub use context::ContextKey;
pub use context::ContextMarker;
pub use directives::for_plan::register_row_plans;
pub use directives::for_plan::BindingKind;
pub use emit::emit;
pub use emit::emit_cancelable;
pub use emit::emit_cancelable_from;
pub use emit::emit_event;
pub use emit::emit_event_from;
pub use emit::emit_from;
pub use emit::emit_from_host;
pub use emit::emit_model;
pub use emit::emit_model_field;
pub use emit::emit_raw;
pub use emit::emit_raw_from;
pub use emit::Emit;
pub use events::on_scope_unmount;
pub use events::on_scope_unmount_for;
pub use events::DomEventName;
pub use events::ListenerHandle;
pub use extractors::Inject;
pub use extractors::NearestParent;
pub use extractors::Parent;
pub use handle::this;
pub use handle::Handle;
pub use handler::FromHandlerArg;
pub use handler::HandlerDispatch;
pub use lifecycle::Body;
pub use lifecycle::Doc;
pub use lifecycle::El;
pub use lifecycle::Elapsed;
pub use lifecycle::HostEl;
pub use lifecycle::IsTeleported;
pub use lifecycle::LifecycleContext;
pub use lifecycle::LifecyclePhase;
pub use lifecycle::MountEpoch;
pub use lifecycle::ParentId;
pub use lifecycle::Refs;
pub use lifecycle::ScopePath;
pub use lifecycle::TagName;
pub use lifecycle::TeleportHost;
pub use lifecycle::TypedEl;
pub use lifecycle::Win;
pub use magics::dispatch_event;
pub use model_runtime::with_write_origin;
pub use model_runtime::WriteOrigin;
pub use plugin::AppBootCompleted;
pub use plugin::AppBootFailed;
pub use plugin::AppBootStarted;
pub use plugin::ComponentEvent;
pub use plugin::ComponentMounted;
pub use plugin::ComponentPluginExt;
pub use plugin::ComponentReady;
pub use plugin::ComponentSetup;
pub use plugin::ComponentUnmounted;
pub use plugin::ForComponent;
pub use plugin::Hook;
pub use plugin::Plugin;
pub use plugin::PluginValidationError;
pub use plugin::Plugins;
pub use plugin::RouteNavigationCompleted;
pub use plugin::RouteNavigationFailed;
pub use plugin::RouteNavigationStarted;
pub use plugin::ServerFunctionClientCompleted;
pub use plugin::ServerFunctionClientFailed;
pub use plugin::ServerFunctionClientStarted;
pub use profiler::mount::enabled as mount_profile_enabled;
pub use profiler::mount::report as report_mount_profile;
pub use profiler::mount::reset as reset_mount_profile;
pub use props::PropValue;
pub use props::Props;
pub use reactive::batch;
pub use reactive::current_effect;
pub use reactive::effect;
pub use reactive::effect_scoped;
pub use reactive::effect_with;
pub use reactive::flush_sync;
pub use reactive::on_cleanup;
pub use reactive::release;
pub use reactive::run_now;
pub use reactive::set_auto_flush;
pub use reactive::track;
pub use reactive::trigger_scope;
pub use reactive::EffectId;
pub use reactive::EffectOptions;
pub use reactive::ScopeId;
pub use reactive::SignalId;
pub use reactive::SIGNAL_SCOPE;
pub use registry::assert_registry_clean;
pub use registry::canonical_component_name;
pub use registry::mark_registered;
pub use registry::register_component;
pub use registry::register_component_as;
pub use registry::register_component_prefixed;
pub use registry::register_component_with_mount;
pub use registry::registered_component_names;
pub use registry::registry_errors;
pub use registry::render_boot_error;
pub use registry::verify_registry;
pub use registry::ComponentCtor;
pub use registry::ComponentEntry;
pub use registry::ComponentMountFn;
pub use registry::ComponentVTable;
pub use registry::RegisteredComponent;
pub use registry::RegistryError;
pub use registry::RegistryErrorKind;
pub use registry::COMPONENT_ENTRIES;
pub use router::go;
pub use router::navigate;
pub use router::prefetch;
pub use router::push;
pub use router::reevaluate_current;
pub use router::register_route;
pub use router::replace;
pub use router::NavigationFailure;
pub use router::NavigationResult;
pub use router::PrefetchResult;
pub use router::PrefetchSkip;
pub use router::ReturnTo;
pub use router::RouteLocation;
pub use router::RouteToken;
pub use scope::append_list_inline;
pub use scope::current_scope_id;
pub use scope::invalidate_field;
pub use scope::invalidate_field_cache;
pub use scope::patch_list_at_inline;
pub use scope::patch_list_indices_inline;
pub use scope::prepend_list_inline;
pub use scope::remove_list_at_inline;
pub use scope::replace_field_inline;
pub use scope::swap_list_indices_inline;
pub use scope::ComponentState;
pub use scope::Scope;
pub use scope::StaticPropKind;
pub use server::Result as ServerResult;
pub use server::ServerError;
pub use signal::rw_signal;
pub use signal::signal;
pub use signal::RwSignal;
pub use signal::Setter;
pub use signal::Signal;
pub use storage::LocalStorage;
pub use storage::StorageError;
pub use store::register_store_scope;
pub use store::store;
pub use store::store_scope;
pub use store::stores_object;
pub use store::Store;
pub use store::StoreHandle;
pub use styles::inject_style;
pub use task::spawn;
pub use task::spawn_for_scope;
pub use task::spawn_latest;
pub use task::spawn_latest_for_scope;
pub use task::spawn_scoped;
pub use task::TaskHandle;
pub use templates::compile_template;
pub use templates::inject_pp_data;
pub use templates::is_registered;
pub use templates::register_template;
pub use templates::template_for;
pub use watch::watch;
pub use watch::watch_field;
pub use watch::watch_field_scoped;
pub use watch::watch_scope_field;
pub use watch::watch_scope_field_scoped;
pub use watch::watch_scoped;

Modules§

animate
First-class motion for pocopine.
app
App — the builder that wires registered components / stores and starts the runtime.
client_module
Low-level access to CLI-bundled .client.ts modules.
component_computed
Runtime storage for component-level #[computed] fields.
computed
Computed — lazy, memoized derivations over signals and proxy fields.
context
Parent-scope context — RFC-027, typed-key revision per RFC-030.
directives
Directive install entries.
dom
Tiny DOM accessors — dom::window() / dom::document() / dom::body(). Exists purely to dedupe the web_sys::window().and_then(|w| w.document()) chain that showed up ~30 times across pine.
emit
emit / emit_from — RFC-028.
events
Typed DOM event listener helpers — hides Closure::wrap + addEventListener + forget behind a small, type-safe API.
expr
Template expression evaluator + thread-local parse cache.
extractors
Typed structural and context extractors — RFC 056 §6.5–§6.6.
fetch
Client-side fetch helper for #[server] functions.
focus
Focus utilities — RFC-014.
handle
Typed handles onto component / store scopes.
handler
HandlerDispatch — the indirection the #[component] and #[handlers] macros use to coordinate. #[component] emits a ComponentState::invoke that delegates here; #[handlers] emits the actual match-by-name body.
id
$id — monotonic, per-component-instance unique identifiers for a11y wiring. Per RFC-018.
lifecycle
RFC-032 — LifecycleContext carrier + built-in extractors.
loop_scope
LoopScope — the per-item scope bound to each pp-for clone.
magics
Magics — $el, $refs, $dispatch, $event. Resolved by the proxy’s get trap whenever a key starting with $ is read.
model_runtime
mount
Compiled-view mount runtime hooks.
path
Dotted-path resolution for directive values.
plugin
App plugin runtime services and lifecycle hook dispatch.
profiler
Optional runtime profiling probes.
props
RFC-044 §5.10 — Props and PropValue traits backing #[derive(Props)].
reactive
Reactivity primitives.
refs
Template refs — pp-ref="name" pins the decorated element under its enclosing scope so Rust handlers can reach it imperatively.
registry
Component registry — RFC 056.
router
Client-side SPA router.
scope
Component scopes and the JS-Proxy bridge they expose to directives.
scroll_lock
Page scroll lock — RFC-021.
server
Server-function error types.
signal
Signals — typed reactive cells.
slot_fragment
Parent-owned slot fragment ABI (RFC-058 §5.5).
slot_scope
SlotScope — the per-materialization scope bound to scoped-slot content. Per RFC-011.
storage
Typed browser storage helpers.
store
Store registry — singleton components.
styles
Per-component stylesheet injection.
task
Scoped async task helpers.
templates
Component template registry.
templates_plan
RFC-058 Phase 2 — compiled template plans.
text
Text layout engine — a Rust port of pretext’s prepare/layout model.
tick
Scheduling utilities — RFC-014 §3.2.
timers
Scope-bound setTimeout / setInterval helpers — hides the set_timeout_with_callback… + clear_timeout + Closure::once dance behind a small RAII surface and ties timer lifetimes to scope unmount.
watch
watch — imperative change listener.
web
Curated browser-API surface for Pine compounds.

Macros§

create_context
Define a module-scope ContextKey<T> plus the matching ContextMarker type. The key’s debug name is derived from module_path!() plus the identifier so collisions across crates stay impossible even if two crates pick the same local identifier (RFC 056 §6.3 — the successor to inject_key!).
inject_key
Deprecated alias for [create_context!]. Kept so existing call sites keep building during the RFC 056 migration window. New code should reach for [create_context!].