Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add tests for CSS Modules with React and Preact #1343

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

Kocal
Copy link
Contributor

@Kocal Kocal commented Sep 20, 2024

Q A
Bug fix? no
New feature? no
Deprecations? no
Issues Fix #...
License MIT

Quick PR to add functional tests about using CSS Modules with React and Preact, to see it it also break CSS Modules with them in #1319.

babelConfig.presets.push([require.resolve('@babel/preset-react'), {
// TODO: To remove when Babel 8, "automatic" will become the default value
runtime: 'automatic',
}]);
Copy link
Contributor Author

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 use runtime: 'automatic'

@@ -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",
Copy link
Member

Choose a reason for hiding this comment

The 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 peerDependencies section.

btw, we should update our features utility to make it enforce versions based on peerDependencies rather than devDependencies now that we properly define peer dependencies. Or we should drop that runtime check entirely in favor of letting yarn/npm/pnpm show the warning at installation time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, forgot about peerDeps, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw, we should update our features utility to make it enforce versions based on peerDependencies rather than devDependencies now that we properly define peer dependencies. Or we should drop that runtime check entirely in favor of letting yarn/npm/pnpm show the warning at installation time.

Totally! Maybe we can do 1) for v5, and 2) for v6?

Copy link
Member

Choose a reason for hiding this comment

The 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.

@Kocal Kocal merged commit 675d68d into symfony:main Sep 20, 2024
28 checks passed
@Kocal Kocal deleted the test-css-modules-frameworks branch September 20, 2024 13:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants