Repository navigation
SampleApp: Defining all configuration specific in app.plist to not having to modify AppDelegate.m - #2101
Closed
gre wants to merge 1 commit into
Closed
SampleApp: Defining all configuration specific in app.plist to not having to modify AppDelegate.m#2101gre wants to merge 1 commit into
gre wants to merge 1 commit into
Conversation
…ving to modify AppDelegate.m
Contributor
|
This looks good! Might be useful to merge with the work being done in #1546 |
Contributor
|
closing for now because sampleApp is removed from master |
Contributor
|
@gre updated the pull request. |
Contributor
Author
|
@chirag04 where is it gone? I guess a bootstrapped project could benefit from this idea of having config file. Anyway, I'm leaving this to someone else, I got it working for my project, if someone want to push this idea again, feel free :) |
Contributor
FalseLobster
added a commit
to FalseLobster/react-native
that referenced
this pull request
Jul 3, 2024
## Summary: main targeted PR of react#2100 Prior to 0.73, the new `role` prop was remapped to `accessibilityRole` on the JS-side. Starting with react#37304, the work needs to be completed on the native side. Since the new prop is ARIA inspired, the mappings are taking from the [ARIA Core AAM](https://www.w3.org/TR/core-aam-1.2/#mapping_role_table) which disagrees with some of the mappings used in the old `accessibilityRole` prop. Users of the old prop are unaffected, but the new prop will take the mappings from the spec. ## Test Plan: Tested a variety of permutations of accessibilityRole and role to confirm the behavior looks correct in Accessibility Inspector
meta-codesync Bot
pushed a commit
that referenced
this pull request
Dec 3, 2026
Summary:
* Count the sizes nested boxes state in automatic minimum sizes
Why
===
With automatic minimum sizes on (`YGErrataMinSizeUndefinedInsteadOfAuto` off), a flex item does not shrink below its min-content size (css-flexbox-1 §4.5). That size is built from its children's min-content contributions (css-sizing-3 §5.2), and a child that states a size contributes that size. Yoga's min-content walk reads only content (measure functions, padding, border, margins) and ignores `width`, `height`, `min-*`, `max-*` and `aspect-ratio` on everything below the item:
```html
<div style="display: flex; width: 200px">
<div style="display: flex; flex-shrink: 1"> <!-- Chrome: 100px. Yoga: 20px -->
<div style="width: 100px; height: 10px; flex-shrink: 0"></div>
</div>
<div style="width: 180px; flex-shrink: 0"></div>
</div>
```
How
===
The walk takes each child's min-content contribution along the axis it is asked for:
- the size the child states, with its padding and border for a content-box size;
- otherwise its content's min-content size, as before, or, where larger, the size its aspect ratio transfers from the size it states on the other axis (css-sizing-4);
- clamped to the minimum and maximum it states, and no less than its padding and border (`boundAxis`).
A percentage size, minimum or maximum depends on the size being found, so it behaves as `auto` or as no limit (css-sizing-3 §5.2.1). A child that states its size on an axis is not measured, walked or cloned for that axis. The item's own specified size suggestion is unchanged.
The walk still differs from the specifications or from Chrome in these ways:
- A child's `flex-basis` and flex factors are not read. css-flexbox-1 §9.9.3 caps a flex item's contribution at its flex base size if it cannot grow and floors it there if it cannot shrink, and Chrome counts a definite flex basis for a child that cannot shrink. An item around a `flex: 0 0 70px` child is 70px in Chrome; with this change and without it, the item is the size of the child's content.
- §9.9.3 also takes the larger of a flex item's min-content size and its stated size. The walk takes the stated size, as css-sizing-3 does. For a child that cannot grow, the cap gives the same result (`child_width_smaller_than_content`: 20px in Chrome). Chrome was not checked for a child that can grow.
- A `display: contents` child is still walked, and counted, as a box of its own.
- A percentage padding or margin resolves against the owner's width, as it does elsewhere in the walk. Chrome resolves it against zero for an intrinsic contribution (css-sizing-3 §5.2.1): a content-box child with `width: 30px; padding-left: 10%` contributes 30px in Chrome and 50px under a 200px owner in Yoga. Following Chrome would remove most of the walk's owner-width memo key, so it belongs in a change of its own.
- The aspect-ratio transfer uses the border-box size, also for a content-box child.
`container_min_content_memo_respects_owner_width` relied on a 20px spacer not counting toward its parent's min-content size. The parent now has `max-width: 70px`, which keeps the two probes the test compares apart.
Test Plan
=========
`yarn gentest -f YGAutoMinSizeTest` generates the new fixtures in `YGAutoMinSizeTest.html` from Chrome. `cmake --build tests/build && tests/build/yogatests` passes with them and with the hand-written tests for whether the probe runs and for the memo.
With the change to `CalculateLayout.cpp` reverted, every new test fails. The width or height of the shrinking item, in Chrome and without the change:
| Fixture | Chrome | Without the change |
| --- | --- | --- |
| `counts_child_width` | 100 | 20 |
| `counts_child_height` | 100 | 20 |
| `counts_widest_child_of_column` | 60 | 20 |
| `item_width_larger_than_content` | 30 | 10 |
| `child_width_larger_than_content` | 100 | 20 |
| `child_width_smaller_than_content` | 20 | 10 |
| `child_min_width` | 50 | 20 |
| `child_max_width` | 40 | 20 |
| `child_percent_width` | 30 | 20 |
| `child_content_box_width` | 66 | 20 |
| `child_padding_exceeds_width` | 40 | 20 |
| `child_aspect_ratio` | 60 | 20 |
| `child_aspect_ratio_column` | 60 | 20 |
| `counts_content_of_overflow_hidden_child` | 130 | 60 |
`child_with_stated_size_skips_min_content_probe` sees 2 probes where it expects none, and `stated_size_with_percentage_padding_follows_owner_width` sees 10 and 0 where it expects 50 and 40.
`yarn gentest -h` leaves the tree clean, and `node ./scripts/clang-format.js --check` passes. The generated Java tests were not run, because the Gradle project has no unit-test source set, and neither were the generated JavaScript tests, which need Emscripten.
Changelog:
[General][Fixed] - Fix Yoga's automatic minimum size ignoring the width, height, min/max sizes and aspect ratio of boxes inside a flex item
* Mark percentage padding in a child's min-content contribution
An empty child, or one with a static min-content size, reports a
contribution that does not depend on the owner's width, but boundAxis then
floors it at the child's padding and border. With a percentage padding the
result depends on the owner's width, so the memo of the container around it
has to be keyed on that width.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Wearable integration
====================
The wearable UI adapter retains zero automatic minima for unmeasured, untyped app boxes and size-contained boxes, without disabling Yoga's native WSS and measured-text minima. Explicit minima remain authoritative; containment and type-rule changes remap both minimum axes so compatibility defaults do not persist after they stop applying.
Differential Revision: D135304422
Pull Request resolved: #60483
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've made some changes in
AppDelegate.mso it uses aapp.plistthat contains all your app specific configuration and in order to not have to change any line of Objective-C.and here is the default
app.plist:This also allow to set the
initialPropsthat are passed to the Root component in order to inject some custom settings (that are specific for each dev working on an App), for instance the URL of your app API:also I've created a "devServer" field where user can set it's react-native server URL, and if not provided it will fallback on the bundled JS.