Skip to content

Releases: fabio-nettis/tiny-bus

v1.2.1

01 Feb 10:06
46143d1
Compare
Choose a tag to compare

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

Full Changelog: v1.2.0...v1.2.1

v1.2.0

29 Jan 09:38
37b6341
Compare
Choose a tag to compare

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

Full Changelog: v1.1.4...v1.2.0

v1.1.4

25 Jan 10:41
47341df
Compare
Choose a tag to compare

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

Full Changelog: v1.1.3...v1.1.4

v1.1.3

25 Jan 09:55
20b8565
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.1.2...v1.1.3

v1.1.2

24 Jan 14:05
ca81cfc
Compare
Choose a tag to compare

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

24 Jan 13:56
ead8289
Compare
Choose a tag to compare

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

Full Changelog: v1.1.0...v1.1.1

v1.1.0

24 Jan 13:21
0fae7d6
Compare
Choose a tag to compare

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

Full Changelog: v1.0.0...v1.1.0

v1.0.0

24 Jan 10:43
ad98c6e
Compare
Choose a tag to compare

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

Full Changelog: https://github.com/fabio-nettis/tiny-bus/commits/v1.0.0