solid-contrib / solid-rest

a client-side API which supports any backend for Solid requests
37 stars 9 forks source link

Better Environment Detection #61

Closed CxRes closed 3 years ago

CxRes commented 3 years ago

Adds better detection for browser and node environments. This is particularly useful for initializing handlers in environments that support both (such as electron and NWjs).

Resolves #59.

jeff-zucker commented 3 years ago

As we discussed in https://github.com/solid/solid-rest/issues/59, I do not intend for solid-rest to load any default plugins or to check the environment at all. People who want to include solid-rest directly need to bring all their own auth libraries and solid-rest plugins. Solid-Node-Client will load default Solid-Rest plugins, but not based on environment since it only operates in nodejs. So I believe this patch will have nothing to patch when I rewrite solid-rest.

jeff-zucker commented 3 years ago

The code in localStorage.js needs to be cleaned up and renamed and the environment check removed. Originally this package covered both nodejs in-memory and browser localStorage. Browser localStorage is now handled through BrowserFS and the current localStorage package does only the nondejs so I will rename it to mem.js and have it handle the mem:protocol.

CxRes commented 3 years ago

As you wish. In the interim though, it does fix the issue. I am sure that the rewrite is a new branch any way!

In the long run, environment handling should be done by the lib user in the build stage.

jeff-zucker commented 3 years ago

Yes, right, I am removing environment checking from both solid-rest an solid-node-client and leaving it to the user.

My head can not work on both solid-node-client and solid-rest at once. I need to finalize the interface for solid-node-client, get it the way we want, THEN, fix solid-rest to work with it. Can't have both with moving pieces at the same time.

jeff-zucker commented 3 years ago

This is no longer relevant to Solid-Rest, but I am grabbing it for use in Data-Kitchen and elsewhere. Thanks!