Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/shakapacker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ default: &default
cache_path: tmp/shakapacker
webpack_compile_output: true
nested_entries: true
javascript_transpiler: babel
javascript_transpiler: swc

# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
Expand Down
23 changes: 23 additions & 0 deletions config/swc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const { env } = require('shakapacker');

const customConfig = {
options: {
jsc: {
// Preserve class names for Stimulus controller discovery
keepClassNames: true,
// Use spec-compliant transforms (override Shakapacker's loose: true default)
// This is required for Stimulus controllers to work correctly
loose: false,
transform: {
react: {
// Use automatic runtime (React 17+) - no need to import React
runtime: 'automatic',
// Enable React Fast Refresh in development
refresh: env.isDevelopment && env.runningWebpackDevServer,
},
},
},
},
};

module.exports = customConfig;
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"@rails/actioncable": "7.0.5",
"@rescript/core": "^0.5.0",
"@rescript/react": "^0.11.0",
"@swc/core": "^1.13.5",
"ajv": "^8.17.1",
Comment on lines +48 to +49
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that the SWC dependency versions are current.

The versions of SWC-related packages may be outdated. Please ensure you're using the latest stable versions for optimal performance and security.

Since my knowledge may be outdated, please verify the current versions:

Also applies to: 101-101


🌐 Web query:

What are the latest stable versions of @swc/core and swc-loader packages?

💡 Result:

@swc/core — 1.13.1 (latest stable, published Jul 19, 2025). [1]
swc-loader — 0.2.6 (latest stable). [2]

Sources:
[1] Snyk package page for @swc/core.
[2] npm package page for swc-loader.


Update @swc/core to latest stable (1.13.1)
The declared "^1.13.5" isn’t published; change it to "^1.13.1".

🤖 Prompt for AI Agents
package.json around lines 48-49: the dependency entry for "@swc/core" is set to
an unpublished "^1.13.5"; change it to the published latest stable "^1.13.1",
update package.json accordingly, then run your package manager (npm install or
yarn install) to update node_modules and lockfile (package-lock.json or
yarn.lock) and verify the project builds/tests pass.

"autoprefixer": "^10.4.14",
"axios": "^0.21.1",
"babel-loader": "^9.1.2",
Expand Down Expand Up @@ -96,6 +98,7 @@
"shakapacker": "9.0.0-beta.8",
"stimulus": "^3.0.1",
"style-loader": "^3.3.1",
"swc-loader": "^0.2.6",
"tailwindcss": "^3.3.3",
"terser-webpack-plugin": "5",
"turbolinks": "^5.2.0",
Expand Down
Loading