-
-
Notifications
You must be signed in to change notification settings - Fork 639
fixed css-loader instalation and css import in example files #1634
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,8 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac | |
| ### [Unreleased] | ||
| Changes since the last non-beta release. | ||
|
|
||
| #### Fixed | ||
| - Fixed css-loader installation with [PR 1634](https://github.com/shakacode/react_on_rails/pull/1634) by [vaukalak](https://github.com/vaukalak) | ||
| #### Fixed | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid duplicate headings. The use of multiple identical headings ('Fixed') within the same section is flagged. Consider merging these or rephrasing to maintain clarity and structure. - #### Fixed
ToolsMarkdownlint
|
||
| - Address a number of typos and grammar mistakes [PR 1631](https://github.com/shakacode/react_on_rails/pull/1631) by [G-Rath](https://github.com/G-Rath) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import PropTypes from 'prop-types'; | ||
| import React, { useState } from 'react'; | ||
| import style from './HelloWorld.module.css'; | ||
| import * as style from './HelloWorld.module.css'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://www.perplexity.ai/search/Im-using-latest-upydKTUDSP.1jhdYmW5tGw#0 When using CSS Modules with webpack, the choice between
This syntax is typically used when the CSS loader is configured with Benefits:
Example usage: import style from './some-css-file.module.css';
console.log(style.className); // Outputs the generated class name
This syntax is often used when the CSS loader is configured with Benefits:
Example usage: import * as style from './some-css-file.module.css';
console.log(style.className); // Outputs the generated class name
// Or with destructuring:
import { className1, className2 } from './some-css-file.module.css';In most cases, the first syntax (
However, the second syntax ( Ultimately, the choice depends on your project's specific needs and your team's preferences. Both approaches are valid and will work with properly configured CSS Modules in webpack[1][4]. Citations: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const HelloWorld = (props) => { | ||
| const [name, setName] = useState(props.name); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| import PropTypes from 'prop-types'; | ||
| import React from 'react'; | ||
| import style from './HelloWorld.module.css'; | ||
| import * as style from './HelloWorld.module.css'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Incorrect import statement for CSS module. The
Analysis chainCorrected import statement to use namespace import for CSS module. This change aligns with common practices for importing CSS modules in React applications, especially when the CSS file contains multiple named exports. Ensure the Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that the CSS module supports namespace import.
# Test: Search for multiple named exports in the CSS module.
rg --type css 'export' lib/generators/react_on_rails/templates/redux/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css
Length of output: 298 Script: #!/bin/bash
# Description: Locate the CSS module file for HelloWorld component.
# Search for the CSS module file within the project directory.
fd --glob 'HelloWorld.module.css'
Length of output: 150 Script: #!/bin/bash
# Description: Verify the structure of the CSS module file to support namespace import.
# Test: Search for multiple named exports in the CSS module.
rg --type css 'export' lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css
Length of output: 139 Script: #!/bin/bash
# Description: Display the contents of the CSS module file for manual inspection.
# Display the contents of the CSS module file.
cat lib/generators/react_on_rails/templates/base/base/app/javascript/bundles/HelloWorld/components/HelloWorld.module.css
Length of output: 175 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @vaukalak can you explain the nature of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| const HelloWorld = ({ name, updateName }) => ( | ||
| <div> | ||
|
|
||
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.
Ensure proper spacing around headings and list items.
The markdown linting errors indicate missing blank lines around headings and list items. This can affect readability and the proper rendering of the document.
Committable suggestion
Tools
Markdownlint