amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
18.03k stars 1.16k forks source link

update src/index #1254

Closed bmatusiak closed 8 months ago

bmatusiak commented 2 years ago

for rebuilds

bmatusiak commented 2 years ago

for https://github.com/amark/gun/wiki/Unbuild#post-unbuild-process

amark commented 2 years ago

Oh, I thought the first 6 should get included because the core modules require them? And the 2nd 6 are core "convenience methods" - I assume most apps would want them, but they are technically optional, someone might not want them?

bmatusiak commented 2 years ago

i was thinking for re-builders like webpack/browserify so for this i think it should have everything that gun.js has, leaving the src folder to load same as gun.js,

amark commented 8 months ago

@bmatusiak won't this break NodeJS since it not have localStorage? etc.

bmatusiak commented 8 months ago

@bmatusiak won't this break NodeJS since it not have localStorage? etc.

i dont believe so.. Unless Gun becomes a global during source initialization. but as i can see localStorage check for gun as a global and does not use 'USE/require' before it checks for gun (looks like it should). i also see people load gun/gun in node sometimes

bmatusiak commented 8 months ago

@amark so i moved the original index to core and copied my index to its place, modified a few things to fix require preload issues.. that was pointing to index to point to root .

now the next time unbuild is ran.. it should copy to src folder

amark commented 8 months ago

and this fixes React-Native?

I'll merge, but note I might fiddle with it again in the future if I notice anything goofy.