Commit 14f4a45
fix: address PR B review feedback for unified renderer cache staging
- Doctor check now tailors the suggested migration command per matched
file type: Dockerfile entries get the bare 'rake pre_seed_renderer_cache'
(MODE=copy is the default); Procfile/bin entries get 'MODE=symlink'.
- The copy-mode env-var error now mentions 'MODE=symlink' as an escape
hatch for CI users who don't need an immutable artifact.
- make_relative_symlink rescues Errno::ENOENT from Pathname#realpath and
surfaces a clearer ReactOnRailsPro::Error when a bundle/asset vanished
between existence check and staging (e.g. webpack output rotating
mid-stage, dangling symlinks in the source tree).
- PrepareNodeRenderBundles.reset_deprecation_warned! is now
private_class_method; specs invoke it via send.
- Rake task now downcases ENV['MODE'] and validates against
PreSeedRendererCache::VALID_MODES before to_sym, accepting 'MODE=Copy',
'MODE=COPY', etc. Unknown values abort with a clear error listing
valid modes.
- Added a :symlink-mode spec that exercises asset symlinking (previously
only covered via the PrepareNodeRenderBundles shim).
- env-var-bypass spec now uses ensure block with a local tmpdir variable
to guarantee cleanup even if Dir.mktmpdir or an intermediate assertion
raises.
Declined: thread-safety wrapper around @deprecation_warned. This code
runs only from rake tasks and AssetsPrecompile.call (single-threaded
contexts); a race would produce at most a harmless duplicate warning,
not a correctness issue. Consistent with PR A precedent for
@renderer_bundle_path_deprecation_warned.
27 dummy specs pass; rubocop clean on all changed files.
Refs: #3122, #3167
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e97260d commit 14f4a45
6 files changed
Lines changed: 56 additions & 11 deletions
File tree
- react_on_rails_pro
- lib
- react_on_rails_pro
- tasks
- spec/dummy/spec
- react_on_rails/lib/react_on_rails
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2748 | 2748 | | |
2749 | 2749 | | |
2750 | 2750 | | |
2751 | | - | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
| 2751 | + | |
2755 | 2752 | | |
2756 | 2753 | | |
2757 | 2754 | | |
| |||
2760 | 2757 | | |
2761 | 2758 | | |
2762 | 2759 | | |
| 2760 | + | |
| 2761 | + | |
| 2762 | + | |
| 2763 | + | |
| 2764 | + | |
| 2765 | + | |
| 2766 | + | |
| 2767 | + | |
| 2768 | + | |
| 2769 | + | |
| 2770 | + | |
2763 | 2771 | | |
2764 | 2772 | | |
2765 | 2773 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
| |||
127 | 132 | | |
128 | 133 | | |
129 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
130 | 139 | | |
131 | 140 | | |
132 | 141 | | |
133 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
134 | 148 | | |
135 | 149 | | |
136 | 150 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
Lines changed: 18 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
70 | 83 | | |
71 | 84 | | |
72 | 85 | | |
| |||
81 | 94 | | |
82 | 95 | | |
83 | 96 | | |
84 | | - | |
| 97 | + | |
| 98 | + | |
85 | 99 | | |
86 | 100 | | |
87 | | - | |
| 101 | + | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments