3 Star 6 Fork 0

Gitee 极速下载/codepilot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/CodePilotai/codepilot
克隆/下载
README.md 1.32 KB
一键复制 编辑 原始数据 按行查看 历史

Services

These services are all built to be executed in a forked process (e.g. in src/renderer/state/modules/interface.js). The advantage is that these expensive operations will not block the main thread use by the UI, preventing interface freezes.

Each service is its own mini-application, compiled separately from the rest of the app. That means you can reference dependencies, but you should never have to reference source files outside of the src/services directory. If you want to create multiple files for a service, create a folder by the same name and add any other files there.

Refactor Ideas

  • It might be useful to develop a service wrapper in index.js, allowing services to be created and consumed in a normal promise interface, created by a key passed to the promise function to share/split processes. I (Chris) have never done this before, but I think it should be manageable.

Optimization Ideas

  • Turn code highlighting into a stream that chunks work into ~50 lines at a time, so earlier code is prioritized rather than waiting for the entire file to finish. However, as long as the language is sometimes detected from the file content, there's a risk of some parts of a file being highlighted using a different syntax.
  • Move from highlight.js to prism.js (perhaps via node-prismjs), as it's supposed to be faster.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/codepilot.git
git@gitee.com:mirrors/codepilot.git
mirrors
codepilot
codepilot
master

搜索帮助