NAME
Developer::Dashboard::Codec - payload encoding helpers for Developer Dashboard
SYNOPSIS
use Developer::Dashboard::Codec qw(encode_payload decode_payload);
my $token = encode_payload($text);
my $text = decode_payload($token);
DESCRIPTION
This module provides the compact payload transport used by Developer Dashboard for transient page and action tokens.
FUNCTIONS
encode_payload
Compress and base64-encode a text payload.
decode_payload
Decode and inflate a token back to text.
PURPOSE
This module implements the compressed token format used by transient page URLs and action payloads. It gzips text payloads and base64-encodes them for transport, then reverses that process when a token comes back into the runtime.
WHY IT EXISTS
It exists because token encoding is a core transport contract shared by bookmarks, Ajax helpers, and page/action flows. Keeping that codec in one place prevents subtle mismatches between producers and consumers.
WHEN TO USE
Use this file when changing token size, encoding behavior, compression handling, or any flow that creates or reads the portable payload tokens used in URLs and form posts.
HOW TO USE
Import encode_payload and decode_payload where a runtime component needs to turn text into a transport token or recover the original text from one. The interface is intentionally small so the token contract stays easy to reason about.
WHAT USES IT
It is used by transient page and action flows, by compatibility helpers that still expose tokenised URLs, and by coverage tests that exercise encode/decode stability.
EXAMPLES
Example 1:
perl -Ilib -MDeveloper::Dashboard::Codec -e 1
Do a direct compile-and-load check against the module from a source checkout.
Example 2:
prove -lv t/21-refactor-coverage.t t/00-load.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.