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

[Question] 如果要将缓存的代码写会到远端服务,如何实现,目前文档缺失的内容比较多 #29

Open
wwsun opened this issue Oct 12, 2023 · 1 comment
Labels
question Further information is requested

Comments

@wwsun
Copy link

wwsun commented Oct 12, 2023

描述你的问题(Describe you question here)

例如下面的例子示范了如何初始化工作区,并将修改缓存到 indexxedDB 中。如果要将缓存到数据再同步到远端服务,要怎么做?在官网没找到相应的文档。

const App = () => {
  return (
    <AppRenderer
      appConfig={{
        // 工作空间目录
        workspaceDir: 'sample',
        // modules:[unregisterKeybindingModule],
        extensionMetadata: [WorkerExample],
        defaultPreferences: {
          'editor.autoSave': 'afterDelay',
        },
      }}
      runtimeConfig={{
        workspace: {
          // 本地indexedDB文件系统
          filesystem: {
            fs: 'OverlayFS',
            options: {
              writable: { fs: 'IndexedDB' },
              readable: {
                fs: 'DynamicRequest',
                options: {
                  readDirectory(p: string) {
                    return dirMap[p];
                  },
                  async readFile(p) {
                    return new TextEncoder().encode(fileMap[p]);
                  },
                },
              },
            },
          },
        },
      }}
    />
  );
};
@AhkunTa AhkunTa added the question Further information is requested label Oct 13, 2023
@AhkunTa
Copy link
Member

AhkunTa commented Oct 13, 2023

CodeBlitz内 源代码管理功能 目前是基于插件来实现

插件侧主要模拟类似git源代码管理的部分能力如提交,建分支,diff等
这些都需要code-api 模块内部做适配

需要实现几个必需接口 并引入web SCM 插件

  1. 批量提交接口
  2. 所有文件接口 负责为文件改动做判断
  3. 文件blob接口
  4. 文件树接口
  5. ..

可以参考 github 接口

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

No branches or pull requests

2 participants