Skip to content

Commit 99c55f5

Browse files
ihabadhamclaude
andcommitted
Import react-on-rails-pro directly in first-party code
The previous commit aliased all 'react-on-rails' imports to 'react-on-rails-pro' at bundle time. That worked but left two things sloppy: 1. First-party code still read as if it depended on the core package, hiding the real Pro dependency behind a webpack alias. Anyone reading the source couldn't tell we were on Pro. 2. The alias had a '/node_package' sub-path entry that was legacy — neither package actually ships a node_package/ folder, and nothing imports that path anywhere in the tree. Rewriting first-party imports to 'react-on-rails-pro' directly matches the react_on_rails :pro generator's update_imports_to_pro_package step and makes the dependency legible. The webpack alias is now narrowed to its real job: shimming rescript-react-on-rails (the one third-party package still importing 'react-on-rails'), and only for exact-specifier imports — Pro's package exports don't mirror core's sub-path surface, so a prefix alias could break resolution for OSS-only sub-paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5ad8908 commit 99c55f5

11 files changed

Lines changed: 17 additions & 14 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React from 'react';
33
import request from 'axios';
44
import Immutable from 'immutable';
55
import _ from 'lodash';
6-
import ReactOnRails from 'react-on-rails';
6+
import ReactOnRails from 'react-on-rails-pro';
77
import { IntlProvider, injectIntl } from 'react-intl';
88
import BaseComponent from 'libs/components/BaseComponent';
99
import SelectLanguage from 'libs/i18n/selectLanguage';

client/app/bundles/comments/startup/App/ror_components/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Provider } from 'react-redux';
22
import React from 'react';
3-
import ReactOnRails from 'react-on-rails';
3+
import ReactOnRails from 'react-on-rails-pro';
44

55
import NonRouterCommentsContainer from '../../../containers/NonRouterCommentsContainer.jsx';
66
import 'intl/locale-data/jsonp/en';

client/app/bundles/comments/startup/ClientRouterAppExpress.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Compare to ../ServerRouterApp.jsx
22
import { Provider } from 'react-redux';
33
import React from 'react';
4-
import ReactOnRails from 'react-on-rails';
4+
import ReactOnRails from 'react-on-rails-pro';
55
import { Router, browserHistory } from 'react-router';
66
import { syncHistoryWithStore } from 'react-router-redux';
77

client/app/bundles/comments/startup/NavigationBarApp/ror_components/NavigationBarApp.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { Provider } from 'react-redux';
55
import React from 'react';
6-
import ReactOnRails from 'react-on-rails';
6+
import ReactOnRails from 'react-on-rails-pro';
77

88
import NavigationBar from '../../../components/NavigationBar/NavigationBar.jsx';
99
import NavigationBarContainer from '../../../containers/NavigationBarContainer.jsx';

client/app/bundles/comments/startup/RouterApp/ror_components/RouterApp.client.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Compare to ./RouterApp.server.jsx
22
import { Provider } from 'react-redux';
33
import React from 'react';
4-
import ReactOnRails from 'react-on-rails';
4+
import ReactOnRails from 'react-on-rails-pro';
55
import { BrowserRouter } from 'react-router-dom';
66
import routes from '../../../routes/routes.jsx';
77

client/app/bundles/comments/startup/RouterApp/ror_components/RouterApp.server.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { Provider } from 'react-redux';
33
import React from 'react';
44
import { StaticRouter } from 'react-router-dom/server';
5-
import ReactOnRails from 'react-on-rails';
5+
import ReactOnRails from 'react-on-rails-pro';
66
import routes from '../../../routes/routes.jsx';
77

88
function ServerRouterApp(_props, railsContext) {

client/app/bundles/comments/startup/serverRegistration.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Example of React + Redux
2-
import ReactOnRails from 'react-on-rails';
2+
import ReactOnRails from 'react-on-rails-pro';
33

44
import App from './App/ror_components/App';
55
import RouterApp from './RouterApp/ror_components/RouterApp.server';

client/app/libs/requestsManager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import request from 'axios';
2-
import ReactOnRails from 'react-on-rails';
2+
import ReactOnRails from 'react-on-rails-pro';
33

44
const API_URL = 'comments.json';
55

client/app/packs/stimulus-bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ReactOnRails from 'react-on-rails';
1+
import ReactOnRails from 'react-on-rails-pro';
22
import 'jquery-ujs';
33
import { Turbo } from '@hotwired/turbo-rails';
44

client/app/packs/stores-registration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ReactOnRails from 'react-on-rails';
1+
import ReactOnRails from 'react-on-rails-pro';
22
import routerCommentsStore from '../bundles/comments/store/routerCommentsStore';
33
import commentsStore from '../bundles/comments/store/commentsStore';
44

0 commit comments

Comments
 (0)