-
-
Notifications
You must be signed in to change notification settings - Fork 198
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
Add tests for CSS Modules with React and Preact #1343
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { h } from 'preact'; | ||
import './styles.css'; | ||
import './styles.less'; | ||
import './styles.scss'; | ||
import './styles.stylus'; | ||
import stylesCss from './styles.module.css?module'; | ||
import stylesLess from './styles.module.less?module'; | ||
import stylesScss from './styles.module.scss?module'; | ||
import stylesStylus from './styles.module.stylus?module'; | ||
|
||
export default function App() { | ||
return <div className={`red large justified lowercase ${stylesCss.italic} ${stylesLess.underline} ${stylesScss.bold} ${stylesStylus.rtl}`}></div> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red { | ||
color: red; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.justified { | ||
text-align: justify; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.italic { | ||
font-style: italic; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.underline { | ||
text-decoration: underline; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.bold { | ||
font-weight: bold; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.rtl | ||
direction: rtl; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.large { | ||
font-size: 50px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.lowercase | ||
text-transform: lowercase |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { h, render } from 'preact'; | ||
|
||
import App from './components/App'; | ||
|
||
render(<App />, document.getElementById('app')); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import './styles.css'; | ||
import './styles.less'; | ||
import './styles.scss'; | ||
import './styles.stylus'; | ||
import stylesCss from './styles.module.css?module'; | ||
import stylesLess from './styles.module.less?module'; | ||
import stylesScss from './styles.module.scss?module'; | ||
import stylesStylus from './styles.module.stylus?module'; | ||
|
||
export default function App() { | ||
return <div className={`red large justified lowercase ${stylesCss.italic} ${stylesLess.underline} ${stylesScss.bold} ${stylesStylus.rtl}`}></div> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red { | ||
color: red; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.justified { | ||
text-align: justify; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.italic { | ||
font-style: italic; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.underline { | ||
text-decoration: underline; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.bold { | ||
font-weight: bold; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.rtl | ||
direction: rtl; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.large { | ||
font-size: 50px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.lowercase | ||
text-transform: lowercase |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import {createRoot} from 'react-dom/client'; | ||
import App from './components/App'; | ||
|
||
const root = createRoot(document.getElementById('app')); | ||
|
||
root.render(<App />); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ | |
"@babel/eslint-parser": "^7.17.0", | ||
"@babel/plugin-transform-react-jsx": "^7.12.11", | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-react": "^7.9.0", | ||
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. bumping the dev dependency alone is not enough. For our users, what matters for the package managers is the btw, we should update our 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. Oh yes, forgot about peerDeps, thanks 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.
Totally! Maybe we can do 1) for v5, and 2) for v6? 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. the first change can even be done in a minor version (as that's about changing the internal implementation only). Our peerDependencies is already what package managers will report. |
||
"@babel/preset-typescript": "^7.0.0", | ||
"@hotwired/stimulus": "^3.0.0", | ||
"@symfony/mock-module": "file:fixtures/stimulus/mock-module", | ||
|
@@ -81,6 +81,8 @@ | |
"preact": "^10.5.0", | ||
"preact-compat": "^3.17.0", | ||
"puppeteer": "^23.2.2", | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0", | ||
"sass": "^1.17.0", | ||
"sass-loader": "^16.0.1", | ||
"sinon": "^14.0.0", | ||
|
@@ -102,7 +104,7 @@ | |
"@babel/core": "^7.17.0", | ||
"@babel/plugin-transform-react-jsx": "^7.12.11", | ||
"@babel/preset-env": "^7.16.0", | ||
"@babel/preset-react": "^7.0.0", | ||
"@babel/preset-react": "^7.9.0", | ||
"@babel/preset-typescript": "^7.0.0", | ||
"@symfony/stimulus-bridge": "^3.0.0", | ||
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0", | ||
|
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.
Quick-win, let's bump
@babel/preset-react
to ^7.9.0 to useruntime: 'automatic'