You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
0 commit comments