-
Notifications
You must be signed in to change notification settings - Fork 8
Ensure that the browser version is empty #1
Comments
I see the problem and will brush up on my build fu to figure out how to solve it in solid-auth-cli so it doesn't need to be repeatedly solved elsewhere. If I'm understanding you correctly, you're suggesting I make two builds and essentially have the browser build be a blank file? |
Yeah; and since it's a blank file, you probably do not need a build process at all. |
😄 good point! |
Alternatively, the browser version could fall back to solid-auth-client, which would make it the solution suggested here: LDflex/LDflex-Comunica#12 (comment) |
That seems like a great way to go. But I wonder if it should be reversed: the wrapper would be in s-a-client so that it falls back to s-a-cli in browserless context. Downstream apps including rdflib would always depend only on s-a-client which itself would depend on s-a-cli for its browserless build. That way no downstream apps need to even know there are two libraries or have conditional requires. |
The idea is typically that Node is main, and browser is the fallback. So I think that this is the right place. (Otherwise, solid-auth-client would expose nothing to Node, which can be problematic for those who want to transpile.) |
Ah, OK, I have a lot to learn when it comes to build issues. So can I point the browser build directly to solid-auth-client in package.json/webpack.config or should I make a browser/index.js which requires then exports solid-auth-client? |
Probably the latter is safest. |
OK, thanks, I'll give it a shot. |
I have been trying to get query-ldflex to work with solid-auth-cli and run into problems with the readme example. I've required solid-auth-cli instead of client in my local query-ldflex files and get this error when I try "await person.label". Any tips on where I should look?
|
Weird, this is a not directly related component. |
We should ensure that solid-auth-cli is never included for the browser by using a technique such as this one: https://github.com/solid/solid-auth-client/blob/v2.3.0/package.json#L6
This avoids things like https://github.com/linkeddata/rdflib.js/pull/306/files#diff-11e9f7f953edc64ba14b0cc350ae7b9dR45 (which would be necessary again on every library, for instance, also libraries that use rdflib).
The text was updated successfully, but these errors were encountered: