@glandjs/emitter@1.1.4
Changelog - @glandjs/emitter
Release history for @glandjs/emitter, mirrored verbatim from the package's own CHANGELOG.md.
All notable changes to @glandjs/emitter will be documented in this file. This
project follows Keep a Changelog and adheres
to Semantic Versioning.
[1.0.0-alpha] - 2025-04-25
Section titled “[1.0.0-alpha] - 2025-04-25”- Initial release of
@glandjs/emitter, a minimal and fast event emitter built with TypeScript. - Core API:
on,off, andemit, all strongly typed. - Wildcard support using radix tree pattern matching (
user:*,data:*:changed, etc.). - Listener caching and internal pooling for faster event dispatch.
- Supports multiple listeners per event and nested emit calls.
- Zero dependencies, small size, and performance-first design.
- Fully tested, with 100% test coverage.
- Built for internal use in Gland, but works standalone too.
[1.0.0] - 2025-04-26
Section titled “[1.0.0] - 2025-04-26”- Initial stable release of the
@glandjs/emitterpackage - Core API with fully typed methods:
on,off, andemit - Efficient event pattern matching with delimiter-based wildcards (e.g.,
user:*,data:*:changed) - Custom delimiter support via constructor parameter
- Performance optimizations:
- Fast listener lookup with Map-based storage
- Internal listener caching for reduced overhead during emit
- Method chaining support for fluent API usage
- Comprehensive TypeScript type definitions for enhanced developer experience
- Zero dependencies with minimal bundle size (0.77 KB minified)
- Designed for both Gland internal usage and standalone applications
- Fully tested
[1.1.0] - 2025-04-26
Section titled “[1.1.0] - 2025-04-26”- Tree-based internal storage
Events are now organized in a nested tree under the emitter’s
tproperty, reflecting hierarchical namespaces (e.g.user:login→t.user.login) and enabling faster lookup for deeply namespaced events. - Hot-path LRU cache
By default the emitter now keeps a small, fixed-size cache (
c) of the 6 most-frequently-used events, with a true LRU eviction policy. Each cache entry tracks:f: array of listener functionst: total times this event has been emitted
- Introspectable state dump
Logging the emitter instance now prints its full internal shape:
{t: { … }, // tree of all registered listenersc: { … }, // hot-path cache entriesi: 2, // next listener IDm: 6, // cache capacityd: ":", // delimiteron, off, emit}
Changed
Section titled “Changed”- Bundle size increased from ~0.77 KB (minified) to ~1.2 KB to accommodate the new tree structure and LRU cache.
- Internal fields renamed for clarity:
t(tree root)c(cache map)i(next ID counter)m(cache max size)
Performance
Section titled “Performance”- Fast path for hot events: emits for cached events bypass full tree traversal, reducing overhead for your most common events.
- Maintains O(1) amortized operations for
.on(),.off()and.emit()even with the tree and cache.
[1.1.1] - 2025-04-27
Section titled “[1.1.1] - 2025-04-27”Changed
Section titled “Changed”- No functional changes.
- Improved code readability with better variable names and added inline comments.
- Refactored for clearer structure without modifying core logic.
[1.1.2] - 2025-05-04
Section titled “[1.1.2] - 2025-05-04”Changed
Section titled “Changed”- Replaced Bun’s ESM-based build with a TypeScript-only CommonJS (
CJS) output to improve compatibility with Node.js and CommonJS environments. - Removed
bun buildfrom the build pipeline in favor of standardtsccompilation. - Updated
tsconfig.json:- Set
moduletoCommonJS - Changed
targettoES2021 - Removed unused or Bun-specific options (
moduleResolution: bundler,verbatimModuleSyntax, etc.)
- Set
- Removed
"type": "module"and"module"fields frompackage.json. - Output still located in
dist/, includes.jsand.d.ts.
This release makes the package easier to consume in broader tooling and ecosystem setups (e.g., Jest, Node.js, older bundlers) while maintaining all functionality and TypeScript type support.
Published version
Section titled “Published version”The changelog above is the main branch, and its most recent entry is 1.1.2.
The version currently published to npm is 1.1.4.
| Source | Version |
|---|---|
package.json on main |
1.1.4 |
Last entry in main/docs/CHANGELOG.md |
1.1.2 |
API stability
Section titled “API stability”The public surface has not changed since 1.0.0:
new EventEmitter<T>(splitter?: string, maxCacheSize?: number)
on(event, listener): thisoff(event, listener?): thisemit(event, payload): thisSee the @glandjs/emitter reference.