Skip to content

Commit 2c9192b

Browse files
justin808claude
andcommitted
Fix CI build failures from React on Rails 16.1.1 migration
- Keep pack files in app/javascript/packs with proper imports - Add client/app to additional_paths in shakapacker.yml for module resolution - Update build scripts to compile ReScript before webpack - Add minimal i18n default and translations files - Configure sass-resources-loader for global SASS variables - Remove incorrectly committed ReScript generated files (.bs.js) - Revert CSS module import changes (use default export) ReScript files are now properly gitignored and built during compilation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent adb07eb commit 2c9192b

27 files changed

+47
-972
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import ReactOnRails from 'react-on-rails';
2+
// eslint-disable-next-line import/no-webpack-loader-syntax
3+
import 'expose-loader?exposes=$,jQuery!jquery';
4+
import 'jquery-ujs';
5+
6+
import App from 'bundles/comments/startup/App';
7+
import RouterApp from 'bundles/comments/startup/ClientRouterApp';
8+
import SimpleCommentScreen from 'bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen';
9+
import routerCommentsStore from 'bundles/comments/store/routerCommentsStore';
10+
import commentsStore from 'bundles/comments/store/commentsStore';
11+
import NavigationBarApp from 'bundles/comments/startup/NavigationBarApp';
12+
import Footer from 'bundles/comments/components/Footer/Footer';
13+
import RescriptShow from 'bundles/comments/rescript/ReScriptShow.bs.js';
14+
15+
import 'assets/styles/application';
16+
17+
ReactOnRails.setOptions({
18+
// traceTurbolinks: process.env.TRACE_TURBOLINKS, // eslint-disable-line no-undef
19+
// process.env.TRACE_TURBOLINKS -> error: development is not defined
20+
traceTurbolinks: true,
21+
});
22+
23+
ReactOnRails.register({
24+
App,
25+
RouterApp,
26+
NavigationBarApp,
27+
SimpleCommentScreen,
28+
Footer,
29+
RescriptShow,
30+
});
31+
32+
ReactOnRails.registerStore({
33+
routerCommentsStore,
34+
commentsStore,
35+
});
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Server bundle imports
2+
import serverRegistration from 'bundles/comments/startup/serverRegistration';

client/app/packs/stimulus-bundle.js renamed to app/javascript/packs/stimulus-bundle.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import 'jquery-ujs';
33
import { Turbo } from '@hotwired/turbo-rails';
44

55
// eslint-disable-next-line no-unused-vars
6-
import controllers from '../controllers';
6+
import controllers from 'controllers';
77

8-
import NavigationBarApp from '../bundles/comments/startup/NavigationBarApp';
9-
import Footer from '../bundles/comments/components/Footer/Footer';
8+
import NavigationBarApp from 'bundles/comments/startup/NavigationBarApp';
9+
import Footer from 'bundles/comments/components/Footer/Footer';
1010

11-
import '../assets/styles/application';
11+
import 'assets/styles/application';
1212

1313
Turbo.session.drive = false;
1414

client/app/bundles/comments/components/CommentBox/CommentBox.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import SelectLanguage from 'libs/i18n/selectLanguage';
88
import { defaultMessages, defaultLocale } from 'libs/i18n/default';
99
import CommentForm from './CommentForm/CommentForm';
1010
import CommentList, { commentPropTypes } from './CommentList/CommentList';
11-
import * as css from './CommentBox.module.scss';
11+
import css from './CommentBox.module.scss';
1212

1313
class CommentBox extends BaseComponent {
1414
static propTypes = {

client/app/bundles/comments/components/SimpleCommentScreen/SimpleCommentScreen.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { translations } from 'libs/i18n/translations';
1212

1313
import CommentForm from '../CommentBox/CommentForm/CommentForm';
1414
import CommentList from '../CommentBox/CommentList/CommentList';
15-
import * as css from './SimpleCommentScreen.module.scss';
15+
import css from './SimpleCommentScreen.module.scss';
1616

1717
class SimpleCommentScreen extends BaseComponent {
1818
constructor(props) {

client/app/bundles/comments/rescript/Actions/Actions.bs.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

client/app/bundles/comments/rescript/CommentForm/CommentForm.bs.js

Lines changed: 0 additions & 215 deletions
This file was deleted.

0 commit comments

Comments
 (0)