-
Notifications
You must be signed in to change notification settings - Fork 73
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: #1476 mako support scss #1482
Conversation
Walkthrough此次更改显著扩展了对 SASS 和 SCSS 文件的支持,调整了文件扩展名的处理逻辑。应用移除了对 SASS 和 SCSS 的不支持标记,并增加了对 SCSS 扩展名的识别。这一变化使得该应用程序能够更灵活地处理不同类型的样式表,为未来的开发奠定了基础。 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App
participant CSSResolver
User->>App: 请求加载组件
App->>CSSResolver: 请求解析样式
CSSResolver->>App: 返回样式
App->>User: 渲染组件
Assessment against linked issues
Poem
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 as PR comments)
Additionally, you can add 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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- crates/mako/src/build/load.rs (1 hunks)
- crates/mako/src/resolve/mod.rs (1 hunks)
- crates/mako/src/visitors/virtual_css_modules.rs (1 hunks)
- examples/with-sass/index.scss (1 hunks)
- examples/with-sass/index.tsx (1 hunks)
- examples/with-sass/mako.config.json (1 hunks)
- examples/with-sass/package.json (1 hunks)
- examples/with-sass/public/index.html (1 hunks)
Files skipped from review due to trivial changes (3)
- examples/with-sass/index.scss
- examples/with-sass/index.tsx
- examples/with-sass/public/index.html
Additional comments not posted (5)
examples/with-sass/mako.config.json (1)
1-1
: 文件创建成功!该文件是一个简单的 JSON 配置,当前只包含一个空的 "sass" 对象。确保在未来需要时添加具体的配置。
examples/with-sass/package.json (1)
1-10
: 依赖配置正确!
package.json
文件定义了项目的依赖关系。React 和 SASS 的版本选择合理。确保这些版本与项目的其他部分兼容。crates/mako/src/visitors/virtual_css_modules.rs (1)
13-13
: 扩展名识别更新成功!
is_css_path
函数现在支持.scss
扩展名。这一更改符合对 SCSS 文件的支持目标。crates/mako/src/build/load.rs (1)
41-41
: 注意更新的支持文件扩展名
UNSUPPORTED_EXTENSIONS
常量中移除了 "sass" 和 "scss",这意味着这些文件类型现在被支持或不再被标记为不支持。请确保在其他相关代码中正确处理这些文件类型。crates/mako/src/resolve/mod.rs (1)
384-384
: 扩展 CSS 解析器以支持 SCSS在
get_resolver
函数中添加了 ".scss" 扩展名,这使得解析器现在能够处理 SCSS 文件。这是对解析器功能的有益扩展。
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- crates/mako/src/build/load.rs (1 hunks)
- crates/mako/src/resolve/mod.rs (1 hunks)
- crates/mako/src/visitors/virtual_css_modules.rs (1 hunks)
- examples/with-sass/index.scss (1 hunks)
- examples/with-sass/index.tsx (1 hunks)
- examples/with-sass/mako.config.json (1 hunks)
- examples/with-sass/package.json (1 hunks)
- examples/with-sass/public/index.html (1 hunks)
Files skipped from review due to trivial changes (4)
- examples/with-sass/index.scss
- examples/with-sass/mako.config.json
- examples/with-sass/package.json
- examples/with-sass/public/index.html
Files skipped from review as they are similar to previous changes (4)
- crates/mako/src/build/load.rs
- crates/mako/src/resolve/mod.rs
- crates/mako/src/visitors/virtual_css_modules.rs
- examples/with-sass/index.tsx
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- crates/mako/src/build/load.rs (1 hunks)
- crates/mako/src/resolve/mod.rs (1 hunks)
- crates/mako/src/visitors/virtual_css_modules.rs (1 hunks)
- examples/with-sass/index.scss (1 hunks)
- examples/with-sass/index.tsx (1 hunks)
- examples/with-sass/mako.config.json (1 hunks)
- examples/with-sass/package.json (1 hunks)
- examples/with-sass/public/index.html (1 hunks)
Files skipped from review due to trivial changes (5)
- examples/with-sass/index.scss
- examples/with-sass/index.tsx
- examples/with-sass/mako.config.json
- examples/with-sass/package.json
- examples/with-sass/public/index.html
Files skipped from review as they are similar to previous changes (3)
- crates/mako/src/build/load.rs
- crates/mako/src/resolve/mod.rs
- crates/mako/src/visitors/virtual_css_modules.rs
merge 下 master 修下 ci,其他没有问题。 |
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (8)
- crates/mako/src/build/load.rs (1 hunks)
- crates/mako/src/resolve/mod.rs (1 hunks)
- crates/mako/src/visitors/virtual_css_modules.rs (1 hunks)
- examples/with-sass/index.scss (1 hunks)
- examples/with-sass/index.tsx (1 hunks)
- examples/with-sass/mako.config.json (1 hunks)
- examples/with-sass/package.json (1 hunks)
- examples/with-sass/public/index.html (1 hunks)
Files skipped from review due to trivial changes (4)
- examples/with-sass/index.scss
- examples/with-sass/index.tsx
- examples/with-sass/mako.config.json
- examples/with-sass/public/index.html
Files skipped from review as they are similar to previous changes (4)
- crates/mako/src/build/load.rs
- crates/mako/src/resolve/mod.rs
- crates/mako/src/visitors/virtual_css_modules.rs
- examples/with-sass/package.json
有个用例挂了,本地执行 |
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (1)
- e2e/fixtures/sass.normal/src/index.tsx (1 hunks)
Additional comments not posted (2)
e2e/fixtures/sass.normal/src/index.tsx (2)
2-2
: 确认样式导入方式的改变。将 SCSS 文件从 CSS 模块改为标准 CSS 导入,这可能影响样式的封装和作用域。请确认这一改变是有意为之,并符合项目的样式策略。
5-5
: 验证类名使用的变化对样式封装的影响。直接使用字符串作为类名,而不是引用
styles
对象,这与从 CSS 模块切换到标准 CSS 的改变一致。请确认这不会对样式封装产生负面影响。
Close #1476
Summary by CodeRabbit
Summary by CodeRabbit
新特性
.scss
文件扩展,增强了样式表解析功能。文档
package.json
文件以配置项目的依赖项。