Skip to content

Commit eebfdec

Browse files
committed
Fix Stimulus controller class name for SWC compatibility
SWC's keepClassNames option doesn't preserve anonymous class names. Changed from 'export default class extends Controller' to 'export default class CommentsController extends Controller' to ensure the class name is preserved for Stimulus registration. This should fix the failing RSpec tests where Stimulus controllers weren't being properly registered.
1 parent 4907899 commit eebfdec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

client/app/controllers/comments_controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { mangle } from 'marked-mangle';
77
marked.use(gfmHeadingId());
88
marked.use(mangle());
99

10-
export default class extends Controller {
10+
export default class CommentsController extends Controller {
1111
static targets = ['commentList', 'commentAuthor', 'commentText', 'commentRefresh', 'alertDiv', 'errorList'];
1212

1313
resetText() {

0 commit comments

Comments
 (0)