Skip to content

Commit 8cdfe62

Browse files
justin808claude
andcommitted
Address code review feedback
Fixed issues identified in code review: 1. **Fixed babel.config.js comment** - Corrected misleading comment about @babel/preset-react location (it IS in devDependencies) 2. **Restored environment-aware development mode** - Changed from always-true to !isProductionEnv to match previous behavior and avoid inconsistent test results in production builds 3. **Removed unused dependency** - Removed babel-plugin-transform-react-remove-prop-types which was no longer used after removing Babel plugins from config 4. **Security audit complete** - Ran yarn audit; found 9 pre-existing vulnerabilities in dev dependencies (axios, webpack-dev-server, resolve-url-loader). These are not introduced by this PR and are low/moderate severity in dev-only packages. Remaining items from #678 (out of scope for this PR): - SWC dependency updates (1.13.5 and 0.2.6 are latest available) - Dual-transpiler testing (Jest uses Babel, webpack uses SWC) - ajv dependency documentation - Performance metrics These can be addressed in separate PRs as needed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 42052bf commit 8cdfe62

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

babel.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
module.exports = function (api) {
44
const defaultConfigFunc = require('shakapacker/package/babel/preset.js');
55
const resultConfig = defaultConfigFunc(api);
6+
const isProductionEnv = api.env('production');
67

7-
// Add React preset for Jest testing
8-
// Note: @babel/preset-react is in devDependencies since it's only needed for testing
8+
// Add React preset for Jest testing and ESLint
9+
// Note: @babel/preset-react is in devDependencies (only needed for Jest/ESLint, not webpack)
910
const changesOnDefault = {
1011
presets: [
1112
[
1213
'@babel/preset-react',
1314
{
1415
runtime: 'automatic',
15-
development: true, // Always use development mode for better test error messages
16+
// Use development mode for better error messages in tests and development
17+
development: !isProductionEnv,
1618
useBuiltIns: true,
1719
},
1820
],

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"ajv": "^8.17.1",
4949
"autoprefixer": "^10.4.14",
5050
"axios": "^0.21.1",
51-
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
5251
"classnames": "^2.3.2",
5352
"compression-webpack-plugin": "10.0.0",
5453
"css-loader": "^6.7.3",

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,11 +2902,6 @@ babel-plugin-polyfill-regenerator@^0.6.5:
29022902
dependencies:
29032903
"@babel/helper-define-polyfill-provider" "^0.6.5"
29042904

2905-
babel-plugin-transform-react-remove-prop-types@^0.4.24:
2906-
version "0.4.24"
2907-
resolved "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz"
2908-
integrity sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==
2909-
29102905
babel-preset-current-node-syntax@^1.0.0:
29112906
version "1.2.0"
29122907
resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz"

0 commit comments

Comments
 (0)