Repository navigation
Commit cf3704f
authored
Mark SwiftPM remote-package mode as planned in the docs
## Summary
The SwiftPM docs describe remote-package mode as a feature that works today. In remote mode, React Native is fetched by URL (`RN_SPM_REMOTE_URL`). This mode is planned and not supported. The text made library authors think that their `Package.swift` needs a remote form. It also made them think that relative paths to the app's folders are a workaround.
This PR changes only docs:
1. The "Remote-package mode" section is now "Remote-package mode (planned)". A note at the top says that the mode is not supported. The design text stays below the note.
2. The path table no longer lists remote alternatives.
3. Rule 1 of the hand-authored library contract now shows the supported local form. A library refers to `../../../../xcframeworks` (React Native) and `../../../ios` (the app's `React-GeneratedCode` package) from its link folder `build/generated/autolinking/libs/<Name>`.
4. The docs say that these relative paths are the intended design and that the folders they point to are stable.
5. A new rule 2 says that each library target defines `RCT_NEW_ARCH_ENABLED=1` in `cSettings` and `cxxSettings`. SwiftPM mode supports only the New Architecture, and nothing else sets this define for a SwiftPM target. Libraries keep their `#ifdef` gates, because the same sources still build with CocoaPods.
6. The old rule 2 (the library ships its own generated code) is now rule 3, and it is optional.
7. `spm-scripts.md`, `spm-autolinking-plugins.md` and the docs index mark the remote environment variables, the remote build error and the remote `packageRef` shape as planned.
The `RN_SPM_REMOTE_URL` code does not change.
## Changelog:
[INTERNAL] [CHANGED] - Mark SwiftPM remote-package mode as planned in the SwiftPM docs
## Test Plan:
- `npx prettier --check packages/react-native/scripts/spm/__docs__/*.md` prints "All matched files use Prettier code style!".
- `git grep remote-package-mode` finds only links to the new `#remote-package-mode-planned` anchor.
- I compared the package names, products and relative paths in rule 1 with `scripts/spm/spm-utils.js`, `generate-spm-autolinking.js` and `scaffold-package-swift.js`.
Differential Revision: D129354597
Pull Request resolved: #596311 parent 5423038 commit cf3704f
4 files changed
Lines changed: 77 additions & 32 deletions
File tree
- packages/react-native/scripts/spm/__docs__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
310 | | - | |
| 308 | + | |
| 309 | + | |
311 | 310 | | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
315 | 314 | | |
316 | | - | |
| 315 | + | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
| |||
323 | 322 | | |
324 | 323 | | |
325 | 324 | | |
326 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
327 | 330 | | |
328 | 331 | | |
329 | 332 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
122 | 152 | | |
123 | 153 | | |
124 | 154 | | |
125 | 155 | | |
126 | 156 | | |
127 | 157 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
883 | | - | |
884 | | - | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
885 | 887 | | |
886 | 888 | | |
887 | 889 | | |
| |||
898 | 900 | | |
899 | 901 | | |
900 | 902 | | |
901 | | - | |
902 | | - | |
| 903 | + | |
| 904 | + | |
0 commit comments