Commit 34dfcd6
committed
feat(style): keep
Graduating `backgroundSize`, `backgroundPosition` and `backgroundRepeat` by
renaming them outright would break any app already using the
`experimental_` prefixed names. Instead, keep the prefixed names working as
aliases alongside the new ones, so the removal can happen in a later
release. This mirrors what `backgroundImage` already does.
The non-prefixed name takes precedence when both are set.
- C++: nested `convertRawProp` fallback in the `BaseViewProps` constructor
(this is also what registers the alias key with the raw props parser),
plus an extra `RAW_SET_PROP_SWITCH_CASE` per prop in `setProp`. This is
what covers iOS, which reads the typed props and never the raw names.
- JS: alias entries in `ReactNativeStyleAttributes` (used wholesale as
`style` by `BaseViewConfig.ios.js`) and in `BaseViewConfig.android.js`,
plus the Flow and TypeScript style types.
- Android additionally dispatches props to ViewManagers by string name, so
each alias needs its own `ViewProps` constant and `@ReactProp` setter
delegating to the real one.experimental_ prefixed background props as aliases1 parent 229e916 commit 34dfcd6
8 files changed
Lines changed: 74 additions & 3 deletions
File tree
- packages/react-native
- Libraries
- Components/View
- NativeComponent
- StyleSheet
- ReactAndroid
- api
- src/main/java/com/facebook/react
- uimanager
- views/view
- ReactCommon/react/renderer/components/view
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| 216 | + | |
214 | 217 | | |
215 | 218 | | |
216 | 219 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
217 | 218 | | |
| 219 | + | |
218 | 220 | | |
| 221 | + | |
219 | 222 | | |
220 | 223 | | |
221 | 224 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
| 507 | + | |
506 | 508 | | |
507 | 509 | | |
| 510 | + | |
| 511 | + | |
508 | 512 | | |
| 513 | + | |
| 514 | + | |
509 | 515 | | |
510 | 516 | | |
511 | 517 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
897 | 898 | | |
| 899 | + | |
| 900 | + | |
898 | 901 | | |
| 902 | + | |
899 | 903 | | |
900 | 904 | | |
901 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4532 | 4532 | | |
4533 | 4533 | | |
4534 | 4534 | | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
4535 | 4538 | | |
4536 | 4539 | | |
4537 | 4540 | | |
| |||
6523 | 6526 | | |
6524 | 6527 | | |
6525 | 6528 | | |
| 6529 | + | |
| 6530 | + | |
| 6531 | + | |
6526 | 6532 | | |
6527 | 6533 | | |
6528 | 6534 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
| 82 | + | |
| 83 | + | |
80 | 84 | | |
| 85 | + | |
| 86 | + | |
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| |||
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewManager.kt
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| |||
191 | 199 | | |
192 | 200 | | |
193 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
194 | 210 | | |
195 | 211 | | |
196 | 212 | | |
| |||
208 | 224 | | |
209 | 225 | | |
210 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | 236 | | |
213 | 237 | | |
| |||
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
225 | 230 | | |
226 | 231 | | |
227 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
228 | 238 | | |
229 | 239 | | |
230 | 240 | | |
231 | 241 | | |
232 | 242 | | |
233 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
234 | 249 | | |
235 | 250 | | |
236 | 251 | | |
| |||
339 | 354 | | |
340 | 355 | | |
341 | 356 | | |
| 357 | + | |
342 | 358 | | |
| 359 | + | |
| 360 | + | |
343 | 361 | | |
| 362 | + | |
344 | 363 | | |
345 | 364 | | |
346 | 365 | | |
| |||
0 commit comments