8000 Add file system data functions as shorthand methods by icidasset · Pull Request #464 · oddsdk/ts-odd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add file system data functions as shorthand methods #464

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

Merged
merged 4 commits into from
Jan 19, 2023

Conversation

icidasset
Copy link
Contributor

Closes #448

@icidasset icidasset requested review from avivash and bgins January 18, 2023 13:49
Copy link
Member
@avivash avivash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, much more scalable! 🎉

src/index.ts Outdated
Comment on lines 576 to 577
loadFileSystem: (username: string) => loadFileSystem({ config, username, dependencies: components }),
recoverFileSystem: (params: RecoverFileSystemParams) => recoverFileSystem({ auth, dependencies: components, ...params }),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have fileSystem.load and fileSystem.recover, should we remove the loadFileSystem and recoverFileSystem shorthands?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could yeah.


fileSystem: {
addPublicExchangeKey: (fs: FileSystem) => FileSystemData.addPublicExchangeKey(components.crypto, fs),
addSampleData: (fs: FileSystem) => FileSystemData.addSampleData(fs),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the use cases where developer would want to use this shorthand? I could see where it could see it being useful for quick experimentation, but I don't think developers will want exactly the directories it creates.

If we are the primary consumer of the shorthand, we should consider leaving it buried to keep the top-level API as simple as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The public key ones would be for whenever you have an app that you want to receive a private share on. The behaviour of these functions will change over time (eg. rs-wnfs will keep exchange keys in the root).

The sample data one would be for apps like Drive, which is less useful, but doesn't hurt to have it there I guess, even if it's for quick experimentation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, the public key ones are good additions 👌. I was questioning addSampleData.

Adding addSampleData has some cost because it's another bit of API for developers to learn. If it has a good use case for them, then it's worth adding. Otherwise, we should consider leaving it out.

It seems like quick experimentation is a secondary use case. If we want to support the quick experimentation, maybe addSampleData could add a file in addition to directories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll add a file 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👌


fileSystem: {
addPublicExchangeKey: (fs: FileSystem) => FileSystemData.addPublicExchangeKey(components.crypto, fs),
addSampleData: (fs: FileSystem) => FileSystemData.addSampleData(fs),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good 👌

Base automatically changed from icidasset/account-did to main January 19, 2023 09:14
@icidasset icidasset force-pushed the icidasset/fs-data-shorthand branch from 17fd43d to ebcba8f Compare January 19, 2023 14:14
@icidasset icidasset merged commit bea7a52 into main Jan 19, 2023
@icidasset icidasset deleted the icidasset/fs-data-shorthand branch January 19, 2023 14:35
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.

Export file system data functions from main module
3 participants
0