Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dim and pos arrays #1373

Closed
wants to merge 10 commits into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than CalculateLayout.cpp, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49134566

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49134566

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39397

Pull Request resolved: facebook#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: c561603c41bff22eaadb547ceba3eccb62e3cbe8
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Sep 12, 2023
Summary:
Pull Request resolved: facebook#39397

X-link: facebook/yoga#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: b52677c7c513fede666a87fa4ce9b1d14b1a2a27
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49134566

NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39397

Pull Request resolved: facebook#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: 2706ab7e1949b0b349dc8581b95fcaddaaed556a
NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Sep 12, 2023
Summary:
Pull Request resolved: facebook#39397

X-link: facebook/yoga#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: 5c852178effd25df6f4c74f18115c3b2889b486b
NickGerleman and others added 10 commits September 11, 2023 19:00
Summary:
This changes public Yoga API to in more places accept const structures where before they required mutable ones.

This tries to avoid more breaking changes yet, e.g. changing callbacks to require clients do not modify nodes when they are passed for logging. We also don't have const variants for returning child structures which would allow mutation of dependencies of the const object. These would need new names under the public API, since we do not have operator overloading in C.

Differential Revision: D49130412

fbshipit-source-id: 6cf09885ad3e9d4c152eb3b910be418302ad647d
Summary:
Pull Request resolved: facebook#1369

X-link: facebook/react-native#39370

This fixes const-correctness of callbacks (e.g. not letting a logger function modify nodes during layout). This helps us to continue to fix const-correctness issues inside of Yoga.

This change is breaking to the public API, since it requires a change in signature passed to Yoga.

Changelog: [Internal]

Differential Revision: https://internalfb.com/D49130714

fbshipit-source-id: 9e45ee99f1ead499558c948778fcdf03f77357e9
Summary:
Yoga's public API exposes indices most often as `uint32_t`, with exception of clone callbacks which are `int32_t`. Yoga internally represents these indices as `size_t` when dealing with the child vector, and this is the true index.

This changes the API to consistently be `size_t`. This should not be breaking for most users, but will cause breaks where:

1. Users set a clone node callback (I think this should be rare. RN uses it, but only because it relies on a separate private API).
2. Callers of `YGNodeGetChildCount()` are assigning to an int with less width than `size_t` and have strong warnings enabled.
3. Using a newer Yoga binary with older source, since we are not preserving ABI compatibility (Yoga in general does not aim to be ABI stable between major versions, only ABI safe for a given set of sources).

Differential Revision: D49130914

fbshipit-source-id: f409fec9a35ca2713db4d6195bfc44795a216e28
Summary:
This was added in facebook#497 specifically for tests related to memory leaks in the C# bindings to count how often YGConfigFree.

This is the wrong layer for this check, we don't have officially supported C# bindings anymore, and this API is not safe when Yoga runs on multiple threads. This removes it.

Differential Revision: D49131207

fbshipit-source-id: fd31e294655ab7d37a81adf7ea6c3f8d3e87c0d6
Summary: These were marked as deprecated as part of the public Yoga 2.0 release, and were alredy emitting deprecation warnings. Remove them.

Differential Revision: https://internalfb.com/D49131250

fbshipit-source-id: c9e3a7b35b2bd30c02c64669518dd91c0de3e1ea
Summary: Moves some messiness around conditionally using Android's logger to `Log.cpp`, isolated to within a single function.

Differential Revision: D49131964

fbshipit-source-id: 7dee6f25d9488287054e135bc315f9ee4cb70de3
Differential Revision: https://internalfb.com/D49132476

fbshipit-source-id: 763197c14a6898176bce87342da33bfc445d063d
Summary:
D18029030 added `-fvisibility-hidden`, and a corresponding `YOGA_EXPORT` macro for defining shared library visibility.

There was already a `WIN_EXPORT` macro doing the same thing when building a DLL, but in the header, instead of CPP files, and sometimes missing for important parts of the public API?

This reconciles those into a single visiblity macro, that we always place with declaration instead of definition.

Differential Revision: D49132643

fbshipit-source-id: 27dc91380707ff289c1e0ff88cce24b5e84a1e00
Differential Revision: D49133837

fbshipit-source-id: 9673ff32901593a1971f53022ef35fcbbb587ad9
Summary:
X-link: facebook/react-native#39397

Pull Request resolved: facebook#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: 8148376f40b3560c1d1bc3193412caa0f0de6bc6
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D49134566

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Sep 12, 2023
Summary:
Pull Request resolved: facebook#39397

X-link: facebook/yoga#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: d618b4a523303ad90321eac0b6411c9baaaae914
facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39397

X-link: facebook/yoga#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: cb806539ba0733a5773c594713720d465987e469
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Sep 12, 2023
Summary:
Pull Request resolved: #39397

X-link: facebook/yoga#1373

These are used to get the position origin edge from axis (same as leading edge), and dimension from axis.

Replace them with function usage, so that we can call into them from other files than `CalculateLayout.cpp`, and so that we can later use scoped enums not implicitly convertible to ints.

Reviewed By: rshest

Differential Revision: D49134566

fbshipit-source-id: cb806539ba0733a5773c594713720d465987e469
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 62ba8eb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants