git ssb


10+

Dominic / patchbay



This refactors patchbay to use the new depject.

%OSDN2p2is598nGnEiiggNyKYmFZHRd9bGOrc1k1SgSY=.sha256
Closed Dominic wants to merge commits into master from depject2
Dominic · 12/4/2016, 11:20:19 AM

This refactors patchbay to use the new depject.

New depject has several improvements - modules can encapsulate state, instead of relying on global state, which means for testing, you can have multiple instances of a plugin in a test (essential for testing sbot, etc) also, it's okay for plugins to have cycles, or depend on things they export.

Migrating to this design was quite a pain, mainly because there is actually quite a lot of code here! but I believe it's a better way forward, because we can also use this pattern within sbot.

%7PcNZlSnH1BHnZT61P7Pztdj42qSt6RhUGyktINL1aY=.sha256 dinosaur · 12/4/2016, 1:24:51 PM

sweet! i really like the new depject. :sparkles:

it seems to make possible what i described in %1t8bRUO...:

so i had an idea to create some "base" modules: %hFAgSbS.... i got stuck on how to do sbot.js (almost need dynamic module injector, like an init function for each module, because some module definitions depend on other modules being defined), is this a terrible idea or a good idea?

%IrB62ZqgrdRknk0LeL8upXbDxwxNI24ffj3gB63P7Nk=.sha256 ev · 12/4/2016, 3:27:46 PM

@dominic I've tested this branch, and there are a few depject modules that aren't working for me anymore upon rebuild

  • connection status
  • menu
  • suggest
  • posts aren't loading on profile pages
Dominic updated the branch to 2c6e2055 · 12/4/2016, 7:11:12 PM
%pEhG/96eI64MIYqtI0jTW36reQKYKqhfLHQEo+Pj3Xs=.sha256 Dominic · 12/4/2016, 7:11:43 PM

@ev sorry, I pushed a few more commits on that branch, those things are all working for me now.

%YWi9lA4TZIuW+6Njlg7VlNsQ9Ie/dNcZRPJd7KC3afU=.sha256 Dominic · 12/4/2016, 7:16:01 PM

@dinosaur can you make a PR describing your base-modules idea? from the name it sounds like a refactor, but also a good direction.

dinosaur mentioned this pull request in oh, and this pull request is a **work in progress**, do not merge yet please. also will be better to wait after %OSDN2p2is598nGnEiiggNyKYmFZ
%7F2nnSCU+DR+unkZMiQaN1YS0L8ogNOcwUQNu664A1Q=.sha256 ev · 12/5/2016, 10:19:51 PM

@dominic suggest and profile pages are working for me now, but I'm still not seeing menu and the status lite.

Dominic updated the branch to f6c852fa · 12/8/2016, 7:50:46 AM
%d78KobftmBysxy9Yo30dPN2H9XOqzPUJCyf7t07Y7i8=.sha256 ev · 12/8/2016, 5:16:48 PM

@dominic Something in this latest push (I think?) broke the lite client under bay/depject2.

The error I'm getting is

Uncaught ReferenceError: setImmediate is not defined
Dominic updated the branch to 361edfb3 · 12/9/2016, 9:58:24 AM
%U7XBW6oVZO8A2iltf3uydWlOsB1w3Csu1G69LZ0fqRM=.sha256 Dominic · 12/9/2016, 9:58:41 AM

sorry, should have used setTimeout

%1fR1cBmQrvm7GkEU5xJ+ZKXo6fCYtb7PyigrT+RJ0S4=.sha256 mix · 12/9/2016, 4:12:03 PM

i was reading about setImmediate - @matt uses it in mutant for performance. I installed this to acces it : https://www.npmjs.com/package/setimmediate

%3dEPrHfgPsbgXdib71dSX8A52n5vt3kgvNibs6Mq/zw=.sha256 ev · 12/9/2016, 4:21:47 PM

I think this branch almost ready for a merge. The last thing I'm having issues with is the /network tab, which is showing a ReferenceError: avatar is not defined. I took a look at the code, and it says

exports.needs = {
  avatar: 'first',
  sbot_gossip_peers: 'first',
  sbot_gossip_connect: 'first'
}

So it should be loading, but isn't?

Dominic updated the branch to f27adcb6 · 12/9/2016, 4:25:49 PM
%bkckqnydojXAwcx9xUECDNyiQ6kpKKZXC6p73kqqVMA=.sha256 Dominic · 12/9/2016, 4:28:12 PM

in new depject you do

export.create = function (api) {
  api.avatar(...)
}

but before it was

var avatar = plugs.first(exports.avatar = [])
//then
avatar(...)

so if you see this, fix it by adding api. infront. Which I just fixed - also, I made local peers appear at the top of the network page - can you test that for me?

%t1btHVNWd2+b4ekXvpPZeeycmVCQere8qqpgwdwsaCg=.sha256 Dominic · 12/9/2016, 4:28:41 PM

for some reason, avatars are not showing - do you also see that?

%KD4bFHoCSJ+g1ghvILV7OJVoY7E89TCa8Drx9VdlaB0=.sha256 ev · 12/9/2016, 5:03:35 PM

@dominic I see avatars. No issues here.

%wzYcbUw21mAkGFuGp1ezu72Bm9JXBB9Rs0wmSCPX/OY=.sha256 Dominic · 12/9/2016, 5:07:54 PM

okay, I'm gonna merge

%ImFPCLW1hBWCrAfkjZwb+2SzeJvfkMAEFL8pL+Do5Cc=.sha256 gb · 12/9/2016, 5:10:24 PM

@dominic avatars show up for me

%nJKN/50hxNa4t6zkAivBNOdID6+i9y2FaWOdSOYwvZw=.sha256 ev · 12/9/2016, 5:11:10 PM

I made local peers appear at the top of the network page - can you test that for me?

Just tested. I saw @gb pop up for a moment, but then she disappeared from the /network page entirely and was nowhere to be found.

But I've been seeing a lot of connect/disconnects to my local peer(s), so maybe that has something to do it?

%5vgptCmW/60KkMaWcbvuStAg1iWQZ/EkaBs2FAgOxMI=.sha256 Dominic · 12/9/2016, 5:13:26 PM

@cel looks like this issue didn't get closed when i merged?

· 12/9/2016, 5:13:30 PM
%qQCilA3jq/6+jmogjtSttq3Ub9epgrQHfFTt0IJUe3s=.sha256 cel · 12/9/2016, 6:41:13 PM

@dominic yes, this is an issue. %VAsfToqCdEQuxEVbcfKCRHAJQq0grwXhvEsZY+wldPc=.sha256


Built with git-ssb-web