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

Reapply "fix:dynamic import as namespace import (#1171)" (#1208) #1209

Merged
merged 9 commits into from
Jun 13, 2024

Conversation

stormslowly
Copy link
Member

@stormslowly stormslowly commented May 27, 2024

This reverts commit 6e69d85.

下周一单独发

Summary by CodeRabbit

  • 新功能
    • app_runtime.stpl文件中添加了一个名为requireModule.dr的新函数。

Copy link
Contributor

coderabbitai bot commented May 27, 2024

Walkthrough

整体变更包括对多个文件的修改,涉及 mako crate 中的函数初始化、模块结构调整以及依赖项版本更新等内容。

Changes

文件路径 变更摘要
crates/mako/src/generate/transform.rs 初始化 DynamicImport 结构有关的变更
crates/mako/src/plugins/bundless_compiler.rs DynamicImport 结构初始化方法的调整
crates/mako/src/plugins/context_module.rs 修改了 ContextModuleVisitorexpr.args 的赋值
crates/mako/src/visitors/dynamic_import.rs DynamicImport 结构和相关方法的调整,添加新字段和初始化方法,更新 VisitMut 实现
crates/mako/templates/app_runtime.stpl 添加了 requireModule.dr 函数及其用法
e2e/fixtures/javascript.require-dynamic/expect.js 更新了模块依赖处理方式,影响语言文件异步加载
e2e/fixtures/javascript.require-dynamic/src/index.ts 修改了动态加载函数以及异步处理 console.log 输出
packages/bundler-mako/package.json 更新 @umijs/mako 依赖版本号
packages/mako/npm/darwin-arm64/package.json 更新 @umijs/mako-darwin-arm64 版本号
packages/mako/npm/darwin-x64/package.json 更新 @umijs/mako-darwin-x64 版本号
packages/mako/npm/linux-x64-gnu/package.json 更新 @umijs/mako-linux-x64-gnu 版本号
packages/mako/npm/linux-x64-musl/package.json 更新 @umijs/mako-linux-x64-musl 版本号
packages/mako/package.json 更新 @umijs/mako 版本号及其不同平台的可选依赖版本
e2e/fixtures/runtime.dynamic_import_interop/expect.js 新增文件,对索引文件中的特定内容进行断言验证
e2e/fixtures/runtime.dynamic_import_interop/index.js 新增文件,演示 CommonJS 模块与默认导出之间的互操作性
e2e/fixtures/runtime.dynamic_import_interop/mako.config.json 新增文件,设置与运行时动态导入互操作性相关的优化、入口点和模块 ID 策略配置
e2e/fixtures/runtime.dynamic_import_interop/src/cjs.js 新增 CommonJS 模块,导出带有两个属性的对象
packages/mako/binding.d.ts 移除了带有 code 和可选 map 属性的 TransformOutput 接口

Poem

跳跳兔欢快游荡,文件纷至沓来翩翩舞。
动态加载变更有迹可寻,版本升级如诗入画。
模块互操作添新谱,依赖更新步履不改。
缤纷变更探索中,代码律动中显神往。


Note

Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://coderabbit.ai

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@stormslowly stormslowly changed the title wip: Reapply "fix:dynamic import as namespace import (#1171)" (#1208) Reapply "fix:dynamic import as namespace import (#1171)" (#1208) Jun 13, 2024
@stormslowly stormslowly merged commit 21526b6 into master Jun 13, 2024
8 checks passed
@sorrycc sorrycc deleted the fix/dynamic_import_as_namespace_import_2 branch August 9, 2024 03:35
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.

3 participants