openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

[cache] Reimplementation to use the new core caches #191

Closed florian-h05 closed 1 year ago

florian-h05 commented 1 year ago

Fixes #184.

Reference https://github.com/openhab/openhab-core/pull/2887. Reference https://github.com/openhab/openhab-core/pull/3204.

Description

This implements:

Unit test is updated to test the JSCache class instead of the exported methods of the cache namespace, because testing the exported methods for each case is quite complex and given the fact that the compatibility layer will be removed at some time, I decided to not take that effort.

Testing

The functionality of JSCache is tested by the Jest unit test, the exports are tested by me.

florian-h05 commented 1 year ago

@digitaldan @jpg0 @rkoshak Can you please review? This is urgent, because we should get this merged before the sixth milestome and the feature freeze comes on Sunday evening.

You only need to review cache.js and the README changes, the rest is not so important.

florian-h05 commented 1 year ago

@digitaldan @jpg0 If you want to give your review, please do it until this evening (+11 hours from now). After this, I'll merge to get this in before the feature freeze; I've already got two reviews so it is not unreviewed.

jpg0 commented 1 year ago

LGTM!