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

重构功能代码的加载 #3938

Merged
merged 5 commits into from
Feb 19, 2023

Conversation

timongh
Copy link
Contributor

@timongh timongh commented Jan 20, 2023

  1. 去除代码加载的异步执行需求。此处使用异步函数并没有明显的好处。
  2. 去除向用户和控制台输出的错误信息,改为抛出异常。面向用户的错误处理,放在安装功能时会更好。
  3. 之前有一部分代码是使用 parseExternalInput 来加载的,现在统一使用 loadFeatureCode
  4. 让代码在相对更封闭的沙箱中执行,尽量避免代码访问到局部变量。

现在代码里已经没有地方使用 parseExternalInput 函数了。可以考虑把它删掉或者将其解析 json 的功能单独抽出来。

@the1812 the1812 merged commit a360507 into the1812:preview-features Feb 19, 2023
@timongh timongh deleted the refactor-load-feature-code branch February 19, 2023 18:32
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.

None yet

2 participants