Skip to content

Release notes for v2.0.0

Robert Painsi edited this page Oct 10, 2025 · 4 revisions

v2.0.0 is here! 🙌

Replacing the old inheritance approach with a shiny new event listener one. This helps to encapsulate and modularize your code, making it easy to reuse in multiple projects and create plugins ✨ e.g. you can check out a simple plug-in to store and load the checked filters from the hash here.

A major version upgrade often also means breaking changes 😱 No worries though, I will get through all "4" of them in this article. You'll see, these changes will be straight forward 😅


1.

- class MyFlow extends FilteringFlow { ... }

You can remove inheritance entirely. Instead of overriding specific methods, you simply register event listeners now, similar to the DOM API.


2.

const flow = new FilteringFlow(domElement);
+ flow.filter();

Previously, the filter() method was called by default when initializing FilteringFlow, which may seem convenient. However, to modularize your code and to make plugin development easier, you have to call the filter() method manually now.


3.1

- FilteringFlow.handleFilterResult(result, filterData) { ... }
+ flow.addEventListener('filter', (event) {
+   const {result, filterData} = event.data;
+ }

Instead of overriding the handleFilterResult() method, register a filter event instead.


3.2

- FilteringOptions.filterItem: (item, schema, filterData)
+ flow.filtering.addEventListener('filter-item', (event) {
+   const {item, schema, filterData} = event.data;
+ }

Instead of using a single function to specify if an item should be considered for filtering, you can register multiple filter-item event listeners now. Returning true will consider the item for filtering, similar to JavaScript's Array.filter. If you register multiple event listeners, every one has to return true.


3.3

- FilteringFlow.beforeFilter: (filterElement)
+ flow.addEventListener('should-filter', (event) {
+   const {filter} = event.data;
+ }

Instead of using a single function to specify if FilteringFlow should do it's magic, you can register multiple should-filter event listeners now. If you register multiple event listeners, every one has to return true.


4.

Following changes will rarely effect you or should already be handled by one of the points above.

  • Removed FilteringOptions
  • Removed FilteringFlowOptions.triggerFilterAfterInitializing
  • Removed beforeInitializing() and afterInitializing()
    • I don't see the point of these methods.
  • Removed Group.getFilterNames()
    • Inlined single line of code.

Clone this wiki locally