typicode / lowdb

Simple and fast JSON database
MIT License
21.35k stars 918 forks source link

fix: make LocalStorage adapter available in the browser #533

Closed Arondight closed 1 year ago

Arondight commented 2 years ago

https://github.com/typicode/lowdb/pull/528 cause this issue, it breaks Browser example.

Arondight commented 2 years ago

@typicode hi can you review this pull?

typicode commented 1 year ago

Hey,

Sorry for the late reply.

As part of v4/v5 update, I went ahead and simply removed global. I tested it and it works in Vite and CodeSandbox (with .js). Also TypeScript doesn't seem to complain when lib has DOM in tsconfig.json.

Is there still a failing use case that I may be missing? Or v5 fixes your initial issue?

Arondight commented 1 year ago

New version looks good but import path of adapters breaks old code