Skip to content
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

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

Kocal
Copy link
Member

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

@Kocal Kocal force-pushed the test-css-modules-frameworks branch from 0f7130e to 8f3aef2 Compare September 20, 2024 12:54
babelConfig.presets.push([require.resolve('@babel/preset-react'), {
// TODO: To remove when Babel 8, "automatic" will become the default value
runtime: 'automatic',
}]);
Copy link
Member 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'

@Kocal Kocal force-pushed the test-css-modules-frameworks branch from 8f3aef2 to a4450ee Compare September 20, 2024 13:03
@@ -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
Member 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
Member 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 force-pushed the test-css-modules-frameworks branch from a4450ee to c22943b Compare September 20, 2024 13:08
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants