Skip to content

v0.28.2 - JunkPocket Refactoring (2026-03-21)

What Changed?

This release refactors JunkPocket in the gears module to improve correctness and consistency. The clearIf method now uses a safe two-phase deletion pattern, and redundant code such as the size accessor override and duplicate globalThis registration have been removed. Documentation has also been updated to reflect these changes.


What's New

Main Feature: JunkPocket Refactoring

What it does: Cleans up the JunkPocket class to remove unnecessary overrides, fix a potentially unsafe iteration pattern, and align globalThis registration with the rest of the gears module.

How to use it: No API changes. Existing code using JunkPocket continues to work as before.

Code example:

TypeScript
const cache = new JunkPocket<string>("MyCache");

// clearIf now uses two-phase deletion internally (safe against live-iterator mutation)
cache.clearIf((key, value) => key.startsWith("temp"));

// size is inherited from Map — no behavior change
Logger.log(cache.size);

Added

  • None

Changed

  • clearIf: replaced live-iterator deletion with two-phase collection-then-delete pattern
  • @group tag in all member docstrings corrected from Torch to Gears
  • docs/modules/junkpocket.md: rewritten in English, updated to reflect current implementation
  • docs/modules/gears/caching-junkpocket.md: corrected cache.size()cache.size in all code examples

Fixed

  • fix(taskfile): add ignore_error to deps:check:npm task
  • fix(pre-commit): exclude generated bundle map and bundle-analysis.html from end-of-file-fixer
  • fix(taskfile): correct precommit task name to pre-commit
  • fix(jest): exclude specs/ directory from coverage collection

Removed

  • JunkPocket.size accessor override (redundant — Map.size is already public readonly)
  • Duplicate globalThis.JunkPocket registration in junkpocket.ts (already handled by index.ts)

Is It Safe to Upgrade?

  • Breaking Changes: No
  • Backward Compatible: Yes

All public APIs remain unchanged. The refactoring is internal only.


Release Details

  • Date: 2026-03-21
  • Version: v0.28.2
  • gaslamp: (unchanged)
  • pilotlamp: (unchanged)
  • Files Changed: 109
  • Commits:
    • 1ee7157 bump: version 0.28.1 → 0.28.2
    • ec26920 docs(gears): fix remaining cache.size() calls to cache.size
    • f860c2e docs(gears): rewrite junkpocket.md in English
    • 9aa86df docs(gears): fix cache.size() to cache.size in caching-junkpocket.md
    • 61a834a refactor(gears): remove redundant size accessor override in JunkPocket
    • 21e5579 refactor(gears): use two-phase deletion in clearIf
    • adaba9c docs(gears): fix @group tag from Torch to Gears in junkpocket.ts
    • 1e07e4e refactor(gears): remove duplicate globalThis registration from junkpocket.ts
    • 156c8f5 docs(taskfile): add inline comments to all tasks for clarity
    • f89c7f5 refactor(taskfile): remove pre-commit side effect from docs:api
    • 4ec1564 fix(taskfile): add ignore_error to deps:check:npm task
    • fa68934 fix(pre-commit): exclude generated bundle map and bundle-analysis.html
    • b38d5d4 fix(taskfile): correct precommit task name to pre-commit
    • 17bb0fa fix(jest): exclude specs/ directory from coverage collection

Known Issues

  • None

Next Steps

  • Add dedicated unit tests for JunkPocket (__tests__/gears/junkpocket.test.ts)