Releases: fabio-nettis/tiny-bus
v1.2.1
Decreased bundle size 📉
After #12 in release v1.2.0 the package size increased quite a bit due to the badly designed Debug Logging API. By implementing a smarter approach to the default debug logger the package size has been decreased roughly by 4kB (unoptimized). The user facing API has not been changed.
Bundle size history
Here you can see the changes in bundle size for latest releases.
Release 🚀 | Minified 👌🏻 | Gzipped 📦 |
---|---|---|
v1.1.4 | 5.1 kB | 2.0 kB |
v1.2.0 | 9.6 kB | 2.8 kB |
v1.2.1 (latest) | 7.6 kB | 2.7 kB |
What's Changed
- refractor: optimize enlarged bundle size by @fabio-nettis in #13
Full Changelog: v1.2.0...v1.2.1
v1.2.0
Debug Logging 🧷
Debug logging is now available for all methods of TinyBus! You can either enable it by setting the debug
flag or by providing a onDebug
callback function in the constructor.
import TinyBus from "tiny-b";
// use the default logger
const debugBus = new TinyBus({ debug: true });
// or provide your own logger function
const customDebugBus = new TinyBus({
onDebug: (debugEventName, debugEventId, duration) => {
console.log(debugEventName, debugEventId, duration);
},
});
Increase of bundle size
The bundle size has been increased from 5.1 kB to 9.6 kB minified and from 2 kB to 2.8kB gzipped. In a future release we may try to reduce the added weight by refractoring some bloated code.
What's Changed
- feat: add debug logging functionality by @fabio-nettis in #12
Full Changelog: v1.1.4...v1.2.0
v1.1.4
Reached good repository health ✅
As it currently stands the repository has reached a good place. With an informative and good looking readme, a github actions integration and version 1.1.4 already published on npm. Of course this does not mean that this project is done! In the near future you can expect features like event tracing, debug logging and much more.
Documentation coming soon
For all the different API's and configurations that are available for TinyBus, a documentation page would be very helpful. I will try to tackle this in the future too.
What's Changed
- refractor: update package keywords for npm by @fabio-nettis in #11
Full Changelog: v1.1.3...v1.1.4
v1.1.3
What's Changed
- refractor: optimize readme headline by @fabio-nettis in #6
- refractor: optimize code coverage and test suites by @fabio-nettis in #7
- feat: integrate repository with github actions by @fabio-nettis in #8
- fix: resolve issues with github actions by @fabio-nettis in #9
- fix: resolve issues with readme on npm by @fabio-nettis in #10
Full Changelog: v1.1.2...v1.1.3
v1.1.2
Package entry point issues resolved 💥
This release fixes the package entry point issues introduced by #4.
What's Changed
- fix(emergency): resolve package entry point issues by @fabio-nettis in #5
Full Changelog: v1.1.1...v1.1.2
v1.1.1
Import issue resolved 💥
This releases changes the packaged bundle to use the .mjs
extension for ES modules. This will enable the usage of the package in Node.js 12+ without the need for transpilation.
What's Changed
- fix: resolve import issues for node.js usage by @fabio-nettis in #4
Full Changelog: v1.1.0...v1.1.1
v1.1.0
Event Replay API 🕙
This release adds the planned event replay API to TinyBus! You can now replay events that have been send through the event bus by sending them to all subscribers again.
const tinyBus = new TinyBus({
// enables event persistence and replay abilities, defaults to true
persistEvents: true,
});
await tinyBus.on("example-replay", {
onCallback: () => console.log("Hello World"),
});
// if persistEvents is false, emit will return undefined
const eventId = tinyBus.emit("example-replay", "arg1", "arg2");
await tinyBus.replay(eventId);
Custom persistence and restoration handlers
Of course you can control how the an event is persisted and restored, this can be useful if you want to save your events into a database. For that you can use the TinyBus
constructor, but remember: If you provide a onRestore
function you also need to provide a onPersist
function and vise verca or an error will be thrown.
const tinyBus = new TinyBus({
// expects you to return an id of type `EventID`
onPersist: async (event) => {},
// expects you to return an event of type `TinyBusEvent`
onRestore: async (eventId) => {},
});
What's Changed
- feat: add event replay capabilities by @fabio-nettis in #3
Full Changelog: v1.0.0...v1.1.0
v1.0.0
Initial release 🚀
This is the initial release TinyBus! A lightweight and highly customizable event bus featuring full type safety, retry handlers and different dispatch strategies.
What's Changed
- refractor: make package ready for publishing by @fabio-nettis in #1
- fix: resolve naming conflict for publishing on npm by @fabio-nettis in #2
Full Changelog: https://github.com/fabio-nettis/tiny-bus/commits/v1.0.0