Make publishes appear immediately in My Files #14

Merged
alexliebowitz merged 5 commits from publish-cache into master 2017-03-28 08:26:46 +02:00
alexliebowitz commented 2017-03-15 04:10:25 +01:00 (Migrated from github.com)

Uses a client side cache to simulate entries in the file manager and claims list.

Also adds new utility functions for using Local Storage.

Uses a client side cache to simulate entries in the file manager and claims list. Also adds new utility functions for using Local Storage.
alexliebowitz (Migrated from github.com) reviewed 2017-03-15 04:24:48 +01:00
alexliebowitz (Migrated from github.com) commented 2017-03-15 04:24:48 +01:00

Possibly break these out into their own module?

Also, I know this is the first time we've tried exporting functions at the top level instead of using object literals. I like the brevity, especially with long function names like this, (utils.savePendingPublish seems really long) but I'm not married to it.

Possibly break these out into their own module? Also, I know this is the first time we've tried exporting functions at the top level instead of using object literals. I like the brevity, especially with long function names like this, (`utils.savePendingPublish` seems really long) but I'm not married to it.
alexliebowitz (Migrated from github.com) reviewed 2017-03-15 04:28:27 +01:00
alexliebowitz (Migrated from github.com) commented 2017-03-15 04:28:27 +01:00

I don't love "pending publish" as the name for this data structure, kinda wordy. But what else to call it? Publish stub? Dummy publish?

I don't love "pending publish" as the name for this data structure, kinda wordy. But what else to call it? Publish stub? Dummy publish?
kauffj (Migrated from github.com) requested changes 2017-03-15 04:28:41 +01:00
kauffj (Migrated from github.com) commented 2017-03-15 04:26:12 +01:00

These functions should probably be moved/kept with the LBRY API logic?

These functions should probably be moved/kept with the LBRY API logic?
@ -0,0 +1,15 @@
/**
kauffj (Migrated from github.com) commented 2017-03-15 04:24:28 +01:00

Should all these functions actually be in the global namespace?

Should all these functions actually be in the global namespace?
alexliebowitz (Migrated from github.com) reviewed 2017-03-15 04:36:33 +01:00
alexliebowitz (Migrated from github.com) commented 2017-03-15 04:36:33 +01:00

Before, we were talking about aiming to make the lbry module only have API wrapper functions, not random utility functions and such. We could still put helper functions like this as private functions that are not exported, though.

The main reason I didn't do that is that I felt like lbry.js is already way too big. But it's going to shrink over time, so I guess it's OK.

Before, we were talking about aiming to make the lbry module only have API wrapper functions, not random utility functions and such. We could still put helper functions like this as private functions that are not exported, though. The main reason I didn't do that is that I felt like lbry.js is already way too big. But it's going to shrink over time, so I guess it's OK.
alexliebowitz (Migrated from github.com) reviewed 2017-03-15 04:43:42 +01:00
alexliebowitz (Migrated from github.com) commented 2017-03-15 04:43:42 +01:00

I know it's awkward to use Local Storage for queryable, list-like data like this. The main alternatives would be IndexedDB (too complicated without a wrapper), Sqlite (possibly too complicated and would require using IPC to do stuff in the main process), or a light JS key/value database like nedb (adds a dependency and stuff to learn).

If local storage isn't cool, it would be fairly quick to switch to something like nedb.

I know it's awkward to use Local Storage for queryable, list-like data like this. The main alternatives would be IndexedDB (too complicated without a wrapper), Sqlite (possibly too complicated and would require using IPC to do stuff in the main process), or a light JS key/value database like nedb (adds a dependency and stuff to learn). If local storage isn't cool, it would be fairly quick to switch to something like nedb.
alexliebowitz (Migrated from github.com) reviewed 2017-03-15 04:45:51 +01:00
@ -0,0 +1,15 @@
/**
alexliebowitz (Migrated from github.com) commented 2017-03-15 04:45:51 +01:00

In ES6 it defaults to module namespace. That might be an issue if we don't like the calling style (getLocal() vs utils.getLocal()) but it's not going to pollute scope anywhere we don't want it to.

In ES6 it defaults to module namespace. That might be an issue if we don't like the calling style (`getLocal()` vs `utils.getLocal()`) but it's not going to pollute scope anywhere we don't want it to.
kauffj (Migrated from github.com) reviewed 2017-03-15 13:39:03 +01:00
kauffj (Migrated from github.com) commented 2017-03-15 13:39:03 +01:00

The name is fine, probably more important to make it some kind of const if referenced in multiple places.

The name is fine, probably more important to make it some kind of const if referenced in multiple places.
kauffj (Migrated from github.com) reviewed 2017-03-15 13:39:32 +01:00
kauffj (Migrated from github.com) commented 2017-03-15 13:39:32 +01:00

I think lbry is the right place for this. They change the behavior of API calls provided by lbry.js.

I think lbry is the right place for this. They change the behavior of API calls provided by lbry.js.
kauffj (Migrated from github.com) reviewed 2017-03-15 13:39:45 +01:00
kauffj (Migrated from github.com) commented 2017-03-15 13:39:45 +01:00

Local storage is fine.

Local storage is fine.
kauffj commented 2017-03-15 13:40:11 +01:00 (Migrated from github.com)

@alexliebowitz you can merge this when ready

@alexliebowitz you can merge this when ready
kauffj commented 2017-03-19 15:16:32 +01:00 (Migrated from github.com)

@alexliebowitz let's get this out!

@alexliebowitz let's get this out!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#14
No description provided.