waku-org / js-waku

JavaScript implementation of Waku v2
https://js.waku.org
Apache License 2.0
162 stars 41 forks source link

chore: setup localstorage dynamic polyfill for node env #1963

Closed danisharora099 closed 2 months ago

danisharora099 commented 2 months ago

Problem

Reference to https://github.com/waku-org/js-waku/issues/1953, we see local storage related functionality breaking on node environments because localStorage is undefined.

While js-waku is targeted for browser environments, we need to offer flexibility in terms of its usage in node environment without things breaking.

Solution

Allow dynamic imports to polyfill localStorage in node environments.

Notes

Contribution checklist:

danisharora099 commented 2 months ago

closing this PR in favor of deprioritising nodejs