Commit 34a1441
authored
Add private_output_path configuration for SSR bundles (#592)
Introduces a new configuration option for managing server-side rendering (SSR) bundle outputs separately from public assets. This feature enables better organization and security for server-only bundles that should not be publicly accessible.
Key improvements:
- Add private_output_path configuration option to shakapacker.yml
- Implement Configuration#private_output_path method with nil-safe handling
- Default value set to 'ssr-generated' for consistent behavior
- Gracefully returns nil when configuration is not set
Configuration changes:
- New optional setting: private_output_path in shakapacker.yml
- Defaults to 'ssr-generated' directory relative to Rails root
- Can be set to nil to disable the feature
Implementation details:
- Method safely handles nil values to prevent join errors
- Follows existing configuration pattern for consistency
- Includes comprehensive test coverage
Impact on existing installations:
- No breaking changes - feature is opt-in with sensible defaults
- Existing installations without SSR are unaffected
- New installations get the default 'ssr-generated' path configured
Use cases:
- Server-side rendering bundles that shouldn't be served publicly
- Separation of public and private webpack outputs
- Better security isolation for server-only JavaScript bundles1 parent 20e3239 commit 34a1441
5 files changed
Lines changed: 29 additions & 1 deletion
File tree
- lib
- install/config
- shakapacker
- spec/shakapacker
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
931 | 931 | | |
932 | 932 | | |
933 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
934 | 943 | | |
935 | 944 | | |
936 | 945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 | | |
58 | 64 | | |
59 | 65 | | |
| |||
0 commit comments