Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vanilla #59

Merged
merged 8 commits into from
Nov 18, 2021
Merged

Vanilla #59

merged 8 commits into from
Nov 18, 2021

Conversation

arj03
Copy link
Owner

@arj03 arj03 commented Nov 4, 2021

TODO:

  • Update ssb-browser-example

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 6, 2021

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'

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 6, 2021

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:

https://github.com/arj03/ssb-browser-demo/blob/584a6bfa3e11f85821d7d2dc2cf7444416b3e553/ssb-singleton-setup.js#L78

EDIT: More complete path info in case it wasn't obvious.

@arj03 arj03 marked this pull request as draft November 7, 2021 11:40
@arj03
Copy link
Owner Author

arj03 commented Nov 7, 2021

@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).

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 7, 2021

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.

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 8, 2021

This works now:

arj03/ssb-browser-demo#325

Initial sync is really, really slow now.

@arj03
Copy link
Owner Author

arj03 commented Nov 8, 2021

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.

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 8, 2021

Yeah. I figure by getting ssb-browser-demo working, we have another way to test it with a decent UI.

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 9, 2021

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.

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 9, 2021

This needs to be updated to SSB.helpers.getPeer()

const peer = SSB.getPeer()

@arj03
Copy link
Owner Author

arj03 commented Nov 9, 2021

The feedreplication functions are removed. getGraph can be replaced wiith getGraphForFeed in helpers I think.

@KyleMaas
Copy link
Collaborator

KyleMaas commented Nov 9, 2021

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?

@KyleMaas
Copy link
Collaborator

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?

@arj03
Copy link
Owner Author

arj03 commented Nov 12, 2021

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.

@KyleMaas
Copy link
Collaborator

Dagnabbit...I guess I'll work on something else, then. Thanks!

@arj03
Copy link
Owner Author

arj03 commented Nov 12, 2021

Latest change should fix initialization with an empty database. I would be grateful if you have a look @KyleMaas. It works for me locally.

@KyleMaas
Copy link
Collaborator

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.

@KyleMaas
Copy link
Collaborator

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

@KyleMaas
Copy link
Collaborator

It does seem to have finished syncing - latest message shown in Public is now <10 minutes ago.

@arj03 arj03 marked this pull request as ready for review November 18, 2021 20:37
@arj03 arj03 merged commit da9dd68 into master Nov 18, 2021
@arj03 arj03 deleted the vanilla branch November 18, 2021 20:38
@arj03
Copy link
Owner Author

arj03 commented Nov 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants