Closed arj03 closed 2 years ago
When trying to build ssb-browser-demo with this, I get the following error:
(Path redacted)/ssb-browser-core/node_modules/@minireq/browser/build/bundle.esm.js:1
import { defaultSerializers, defaults, makeQueryString } from '@minireq/common';
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
Apparently I can get past that error by removing the "module" lines from:
node_modules/@minireq/common/package.json
node_modules/@minireq/node/package.json
node_modules/@minireq/browser/package.json
However, then I run into this line which needs to be ported to the new singleton changes:
EDIT: More complete path info in case it wasn't obvious.
@KyleMaas this is WIP :) Was I was doing here is trying to get SSB browser core as close as possible to a normal ssb-server. This requires some more rework. I'm using this for a private group app I'm working on (not ready yet).
No problem. I'm just excited about the idea of everything being closer to stock (well, probably more like changes upstreamed, but still) and think it might fix some of the problems with ssb-browser-demo not making it through a full sync if it can be made to work.
This works now:
https://github.com/arj03/ssb-browser-demo/pull/325
Initial sync is really, really slow now.
Yep, this is why we need partial replication using meta feeds. I have a few local changes to this branch I was working on yesterday. It needs some more fine tuning, but it makes SSB browser a lot closer to normal sbot. So in that regard it does require quite a few changes, but they are mostly search/replace.
Yeah. I figure by getting ssb-browser-demo working, we have another way to test it with a decent UI.
What should these calls be replaced with?
SSB.net.feedReplication.inSync()
(used by the Connected indicator to show whether or not sync is complete so it can display green)SSB.net.feedReplication.partialStatus()
(used by the Connections tab to show replication information)SSB.net.feedReplication.updatePartialState()
(used a few times by the Profile tab)SSB.net.feedReplication.getGraph()
(used for filtering by direct follow on the Public tab)~ (Updated)EDIT: Adding the reasons they're used in ssb-browser-demo.
This needs to be updated to SSB.helpers.getPeer()
The feedreplication functions are removed. getGraph
can be replaced wiith getGraphForFeed
in helpers I think.
And with that last change to blobs, blobs now work in ssb-browser-demo again. Nice to have a nice easy way to test it. :)
Profile and Public are updated to use getGraphForFeed
, although that ended up being a little bit of a pain for Public since getGraph
was synchronous whereas getGraphForFeed
is async. Code's a little weird, but it works.
Re: feedReplication
being removed: that's why I'm wondering what those calls could be replaced with. I'd think we'd still want to be able to show sync status to the user. What new functionality replaces those?
Finally have a bit of time to work on ssb-browser-demo but don't really want to do much until vanilla's merged since nearly everything I could do would cause conflicts. Any more progress on your end or is there anything I can do to help?
Yesterday I found that this branch does not work when you start from scratch. It's a bit of a icky issue related to the singleton. I'm working on a solution. As for browser demo, I'd really like other clients to support meta feeds for initial sync to be decent speed and that is still quite a way into the future. Next year realisticly.
Dagnabbit...I guess I'll work on something else, then. Thanks!
Latest change should fix initialization with an empty database. I would be grateful if you have a look @KyleMaas. It works for me locally.
Maybe I'm not patient enough with the sync, but I'm not seeing much difference. Without the feedReplication
stuff, there's no progress indication in the UI anymore, so I don't really know if it's done.
Getting these after leaving it for a while:
WebSocket connection to 'wss://between-two-worlds.dk:8989/' failed:
module.exports @ bundle-ui.js:115870
client @ bundle-ui.js:90618
client @ bundle-ui.js:90135
client @ bundle-ui.js:90216
connect @ bundle-ui.js:121078
hooked @ bundle-ui.js:66615
(anonymous) @ bundle-ui.js:95349
(anonymous) @ bundle-ui.js:95348
connect @ bundle-ui.js:125154
CONN.connect @ bundle-ui.js:126051
hooked @ bundle-ui.js:66615
(anonymous) @ bundle-ui.js:125784
maintainConnections @ bundle-ui.js:125784
updateHubNow @ bundle-ui.js:125813
updateNow @ bundle-ui.js:125836
(anonymous) @ bundle-ui.js:125846
bundle-ui.js:63084 Error: stackless error
at module.exports (bundle-ui.js:63084)
at abort (bundle-ui.js:120535)
at Object.cb (bundle-ui.js:120542)
at drain (bundle-ui.js:114924)
at bundle-ui.js:114941
at bundle-ui.js:114898
at bundle-ui.js:115604
at read (bundle-ui.js:116083)
at bundle-ui.js:115596
at bundle-ui.js:114896
It does seem to have finished syncing - latest message shown in Public is now <10 minutes ago.
I don't expect browser-demo to use this v13, but I'll release a project tomorrow that uses this. It's a major version bump so one can always keep using the existing version.
TODO: