-
Notifications
You must be signed in to change notification settings - Fork 393
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
chore: enable local worker file in development mode #4273
base: main
Are you sure you want to change the base?
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options. 概述演练此次更改主要涉及两个文件: 变更
序列图sequenceDiagram
participant Client
participant ExpressFileServer
participant MonacoContribution
Client->>ExpressFileServer: 请求 /monaco/worker 路径
alt 开发模式
ExpressFileServer->>ExpressFileServer: 解析文件路径
ExpressFileServer->>ExpressFileServer: 获取内容类型
ExpressFileServer-->>Client: 返回文件内容
else 非开发模式
ExpressFileServer-->>Client: 默认处理
end
MonacoContribution->>MonacoContribution: 检查环境变量
alt 开发环境
MonacoContribution-->>Client: 使用本地工作线程脚本
else 生产环境
MonacoContribution-->>Client: 使用原有工作线程获取逻辑
end
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (2)packages/express-file-server/src/node/express-file-server.contribution.ts (1)
在开发环境下直接以相对路径提供本地文件非常方便,但需要确保:
建议在正式环境或基本安全场景下,额外验证
packages/monaco/src/browser/monaco.contribution.ts (1)
此处通过判断
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4273 +/- ##
=======================================
Coverage 54.27% 54.27%
=======================================
Files 1633 1633
Lines 99725 99725
Branches 21633 21641 +8
=======================================
+ Hits 54122 54127 +5
+ Misses 37889 37886 -3
+ Partials 7714 7712 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Types
Background or solution
Changelog
开发模式下直接加载本地的 monaco worker 文件
Summary by CodeRabbit
新功能
类型安全
getWorker
和getWorkerUrl
方法的类型安全,明确声明了url
变量的类型。