-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix: chunk_loading_global #1590
Conversation
Walkthrough此次更改涉及对 Changes
Possibly related PRs
Poem
Tip OpenAI O1 model for chat
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 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range and nitpick comments (1)
e2e/fixtures/config.output.chunk_loading_global/src/index.tsx (1)
2-2
: 考虑移除或改进日志语句。当前的
console.log(1)
语句没有提供有意义的信息。建议移除该语句,或者记录一些更有价值的变量或消息。例如:
-console.log(1); +// console.log(1);或者:
-console.log(1); +console.log('Module loaded successfully');
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (6)
- crates/mako/src/generate/chunk_pot/util.rs (1 hunks)
- crates/mako/templates/app_runtime.stpl (1 hunks)
- e2e/fixtures/config.output.chunk_loading_global/expect.js (1 hunks)
- e2e/fixtures/config.output.chunk_loading_global/mako.config.json (1 hunks)
- e2e/fixtures/config.output.chunk_loading_global/src/a.ts (1 hunks)
- e2e/fixtures/config.output.chunk_loading_global/src/index.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- e2e/fixtures/config.output.chunk_loading_global/src/a.ts
Additional comments not posted (2)
e2e/fixtures/config.output.chunk_loading_global/mako.config.json (1)
1-5
: 配置文件看起来不错!这个新的配置文件正确地设置了
chunkLoadingGlobal
属性的值,其中包含一个单引号字符。这与 PR 的目标一致,即修复包含单引号的chunk_loading_global
字符串的处理问题。配置文件的格式正确,没有发现任何问题。
e2e/fixtures/config.output.chunk_loading_global/expect.js (1)
1-16
: 测试文件设置正确,断言语句全面覆盖了入口文件和异步 chunk 文件中全局变量的检查。该测试文件使用了适当的工具函数来解析构建结果,并使用
assert
语句正确地检查了foo' oo
全局变量在index.js
和src_a_ts-async.js
文件中的存在性。测试内容全面,涵盖了入口文件和异步 chunk 文件两种情况。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1590 +/- ##
==========================================
+ Coverage 62.05% 62.17% +0.11%
==========================================
Files 127 128 +1
Lines 15358 15528 +170
==========================================
+ Hits 9531 9655 +124
- Misses 5827 5873 +46 ☔ View full report in Codecov by Sentry. |
If the chunk_loading_global String contains a single quote, it will be sanitized to
'
see rust-sailfish/sailfish#145 (comment). This behavior is not matched with async chunk register.Summary by CodeRabbit
新功能
chunkLoadingGlobal
的处理方式,采用 JSON 字符串表示。mako.config.json
,允许自定义全局上下文的 chunk 加载设置。a.ts
,导出简单字符串值 'a'。index.tsx
中实现动态导入模块,优化性能。测试
expect.js
,验证全局变量在构建文件中的存在性。