tr
TryGhost
GitHub
Ghost
Workspace
GitHub
CI Pipeline Executions
Current execution
Succeeded
claude/add-tryghost-memoize-package-a56x0w
Runs and Agents
Timeline
Beta
Configuration
Self-Healing CI
Project Graph
Circular Dependencies
Enterprise
Resource Usage
Analysis
Conformance
Enterprise
Runs
Current run
Succeeded
Tasks
Resource Usage
Insights
Compare tasks
Analytics
Sign in
Toggle sidebar
Added @tryghost/memoize internal package no ref Several profile follow-ups memoize a pure derivation of an immutable input: compiled ICU messages by locale and text, parsed NQL filter trees, an Intl formatter per timezone. Each of those would otherwise grow its own Map, with its own (usually absent) bound. One small helper gives them the same bound and the same semantics: - memoize(compute, key, {max}) is a keyed memo backed by lru-cache, bounded at 500 entries by default. No TTL: entries are pure derivations of immutable inputs, so an entry is never stale, only evicted. - once(compute) computes on first call and returns the same value afterwards. Both carry reset(), and neither memoizes a throwing compute. Promises are stored like any other value; the helpers are meant for synchronous work. This is a memo helper, not a cache. Nothing derived from mutable state goes through it, because that needs real invalidation, which this deliberately does not have. The package holds no global state: no kill switch, no config key and no process-wide registry. A switch would double the code paths every consumer has to test, and a test that needs a clean memo can call its reset(). Nothing in core uses the package yet; consumers adopt it in follow-ups. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nx run ghost-monorepo:lint:boundaries
⌘K
Succeeded
nx run ghost-monorepo:lint:boundaries
Click to copy
Linux
4 CPU cores
read-write
access token used
d39b3123
30886
GitHub
Ghost
Workspace