Conversation
Summary of ChangesHello @fireairforce, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a critical bug impacting how module aliases are processed within Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
你好,感谢你的贡献。本次 PR 旨在修复 node_modules 中的模块在使用项目别名时因解析配置不一致而导致解析失败的问题。你通过将 enable_typescript、enable_react 等选项应用到 foreign 模块(即 node_modules 中的模块)的解析上下文中,统一了内外部模块的解析行为,从根本上解决了这个问题。代码改动清晰、准确。同时,你还将测试代码中的 tt.run 更新为 tt.run_once 并简化了错误处理,这是一个很好的重构。新增的快照测试也充分验证了修复的有效性。整体来看,这是一个高质量的提交,我没有发现需要修改的地方。做得很好!
Summary
closes: #2221
这种 case webpack 是支持处理的,参考下面的能通过的 test case:
调试发现是 resolve 的 alias extension 在处理 foreign(
node_modules模块)跟 internal(项目内部模块) extension 配置好像没统一导致的(例如假设项目的 alias extension 是要找一个*.ts文件,但 node_modules 里面的产物是 js,这样 node_modules 中的依赖内容 resolve alias 的时候在没有配置enable_typescript的情况下会找不到对应的文件)。Test Plan
新增了对应的快照测试