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

Remove JNI Binding usage of layoutContext #39402

Closed
wants to merge 2 commits into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Sep 12, 2023
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

fbshipit-source-id: 0b55b48444f3c88761fd22a93079509760f56060
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

fbshipit-source-id: 5a5ec0ff30c484d6993428aa96af34f16aef1e98
@analysis-bot
Copy link

analysis-bot commented Sep 12, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,969,745 +1,906
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 9,562,288 +1,980
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 5998320
Branch: main

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

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

fbshipit-source-id: 802b9b1f1ebbb56dd4f6e4d91e9b8f2bddc2312c
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

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

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Differential Revision: D49179243

fbshipit-source-id: 0bd0ac754bb47604963eea83644663dc5f99fc75
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 1646e0d07e4587c4720bb71e2cf7ca1abbbb1aea
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 12, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 6c9a5a8086d8dc3b8fa0fedb9020dfc1cef56bda
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 13, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 284d599581b39ba6de90ebbf3b2b7942b8786759
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 13, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 74cb999ae3cc7aa9261664c478315a62cf67dc1a
NickGerleman added a commit to NickGerleman/yoga that referenced this pull request Sep 13, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 423a64dfadba8e43c51425b31572d2389a6f60e6
NickGerleman and others added 2 commits September 12, 2023 19:08
Summary: Moves `isBaselineLayout` out of `CalculateLayout` into `Baseline.h`. This function is called by flex line justification code, which I have been looking at extracting.

Differential Revision: D49177937

fbshipit-source-id: 13531dff5ba8cd4ef99d0aea3b7f2b6b2149a6ba
Summary:
Pull Request resolved: facebook#39402

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

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

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

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

Pull Request resolved: facebook#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: c838dce0a4356eecce243db22b4050793c4920e4
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Sep 13, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 733c928.

facebook-github-bot pushed a commit to facebook/litho that referenced this pull request Sep 13, 2023
Summary:
X-link: facebook/react-native#39402

X-link: facebook/yoga#1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 7e4944bead864e6b73fd2208a47c5725c18ff2b0
facebook-github-bot pushed a commit to facebook/yoga that referenced this pull request Sep 13, 2023
Summary:
X-link: facebook/react-native#39402

Pull Request resolved: #1377

To avoid keeping a per-node mapping on native Yoga nodes to Java nodes, a per-layout context was added, to be able to pass information from the start of the layout, to measure functions, log functions, etc.

The way this was done was super invasive, and added quite a few private APIs used only by the JNI functions.

This change removes the context-using functions from the JNI bindings in favor of it managing its own context. Next diff removes all the cruft.

Reviewed By: javache

Differential Revision: D49179243

fbshipit-source-id: 7e4944bead864e6b73fd2208a47c5725c18ff2b0
adamaveray added a commit to adamaveray/react-native that referenced this pull request Sep 13, 2023
* main: (1012 commits)
  Add simple constructor for JSError (facebook#39415)
  Breaking: per-node pointScaleFactor (facebook#39403)
  Implement "tickleJS" for Hermes (facebook#39289)
  Add thread idle indicator (facebook#39206)
  Unblock `yarn android` on main (facebook#39413)
  Remove Codegen buck-oss scripts as they're unused (facebook#39422)
  Immediately dispatch events to the shared C++ infrastructure to support interruptability (facebook#39380)
  Fix race condition in Binding::reportMount (facebook#39420)
  Clone free state progression (facebook#39357)
  fix: return the correct default trait collection (facebook#38214)
  Read the React Native version and set the new arch flag properly (facebook#39388)
  Deprecate default_flags in Podfile (facebook#39389)
  Create Helper to read the package.json from Cocoapods (facebook#39390)
  Create helper to enforce the New Arch enabled for double released (facebook#39387)
  Remove layoutContext Drilling (facebook#39401)
  Remove JNI Binding usage of layoutContext (facebook#39402)
  Extract isBaselineLayout() (facebook#39400)
  Refactor and separate layout affected nodes react marker (facebook#39249)
  Bump AGP to 8.1.1 (facebook#39392)
  Fix broken Gradle Sync when opening the project with Android Studio (facebook#39412)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants