NAME

Developer::Dashboard::PageRuntime - older bookmark renderer and CODE executor

SYNOPSIS

my $runtime = Developer::Dashboard::PageRuntime->new(paths => $paths);
$runtime->prepare_page(page => $page, source => 'saved');

DESCRIPTION

This module applies Template Toolkit rendering to bookmark HTML and executes older CODE* blocks while capturing STDOUT and STDERR for in-page display.

METHODS

new, prepare_page, run_code_blocks, stream_code_block, stream_saved_ajax_file

Construct the runtime, render bookmark templates, execute in-process CODE blocks, and stream saved Ajax files as real child processes.

PURPOSE

This module executes and renders dashboard bookmark pages. It evaluates bookmark directives, runs code blocks, exposes browser-side helper functions such as fetch_value, stream_value, and stream_data, and returns the HTML fragments or runtime errors that the web layer displays.

WHY IT EXISTS

It exists because bookmark execution is the heart of the product. Rendering, code execution, helper injection, and runtime state all need one owner so saved pages, transient pages, and seeded workspaces behave consistently.

WHEN TO USE

Use this file when changing bookmark rendering, Template Toolkit exposure, code-block execution, Ajax helper generation, or the browser-side helper contracts used by pages such as api-dashboard and sql-dashboard.

HOW TO USE

Construct it with the file and path registries plus any path aliases, then feed it a normalized page document. Let it return render fragments or runtime errors rather than building bookmark execution logic in routes or helper scripts.

WHAT USES IT

It is used by the web app render/source/edit flows, by skill bookmark rendering, by seeded dashboard pages, and by a large body of page/web regression tests.

EXAMPLES

Example 1:

perl -Ilib -MDeveloper::Dashboard::PageRuntime -e 1

Do a direct compile-and-load check against the module from a source checkout.

Example 2:

prove -lv t/07-core-units.t t/21-refactor-coverage.t

Run the focused regression tests that most directly exercise this module's behavior.

Example 3:

HARNESS_PERL_SWITCHES=-MDevel::Cover prove -lr t

Recheck the module under the repository coverage gate rather than relying on a load-only probe.

Example 4:

prove -lr t

Put any module-level change back through the entire repository suite before release.