Skip to content

Integration 2025 7 14 #235

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

Draft
wants to merge 1,359 commits into
base: main
Choose a base branch
from
Draft

Conversation

iamAbhi-916
Copy link

@iamAbhi-916 iamAbhi-916 commented Jul 14, 2025

Summary

Integration starting from
Hermes-windows commit hash (11c154b)
facebook commit hash (c4b0847)

Test Plan

Microsoft Reviewers: Open in CodeFlow

cortinico and others added 30 commits September 9, 2024 09:07
Summary:
This is just a nit because this string is not entirely correct.

Pull Request resolved: facebook#1514

Test Plan: Nothing to test

Reviewed By: cipolleschi

Differential Revision: D62381946

Pulled By: cortinico

fbshipit-source-id: 643aab29fc3f4fc8532f7e2d545b5a1c0844db5b
…xist.

Summary:
I (ddetlefs) created a trace.  At the time I did this, there was a problem with the trace fixup tool, so I fixed up the trace by hand, removing the incomplete last record.  When I ran it, the trace interpreter crashed.  I figured out that this was from accessing the records vector out of bounds.

While we have also fixed the fixup-tool to walk back to "last empty stack", we decided it would also be good to harden the TraceInterpreter against such crashes.  I by considering where "records" is accessed, I identified 3 such places.  This diff fixes them, in both the hermes and static_h copies of TraceInterpreter.cpp.

Reviewed By: mattbfb

Differential Revision: D61546894

fbshipit-source-id: c6a99b2631b16913b07956912914c3803f91a15c
Summary:
A newline should not be allowed between `async` and `function` when
using method syntax. Verify this by checking
`isNewLineBeforeCurrentToken`.

Reviewed By: tmikov

Differential Revision: D62671336

fbshipit-source-id: aa47fbfe24a5b93098188dc5bc7cd3afa1013335
…#1483)

Summary:
Fixes following issue:
- facebook#1466
- facebook#1138
- facebook#789

**Why this change is made?**

There are few cases where signDisplay is not being handled correctly.
Examples:
```
1.
new Intl.NumberFormat('de-DE', {
 style: 'currency',
 currency: 'EUR',
 signDisplay: 'exceptZero',
}).format(8537.71)

Output: +8,537,71+
Expected: +8.537,71 €

2.
new Intl.NumberFormat('ja-JP', {
 style: 'currency',
 currency: 'JPY',
 signDisplay: 'exceptZero'
}).format(123456.789)

Output: +123,457
Expected: +¥123,457
```

**ChangeLog**

This PR updates the implementation and testing of the signDisplay functionality in the DecimalFormat class within the Hermes engine, specifically for Android API level 31 and above.

**Key Changes:**

Implementation:
- Integrated the **setSignAlwaysShown** method of DecimalFormat for API level 31 and above to control the display of the sign (+ or -) based on the signDisplay option. [For more detail about setSignAlwaysShown check [here](https://developer.android.com/reference/android/icu/text/DecimalFormat#setSignAlwaysShown(boolean))]
- For API levels below 31, maintained the existing logic for handling sign display, ensuring backward compatibility.

Pull Request resolved: facebook#1483

Test Plan:
- Added a comprehensive set of test cases in **HermesIntlAndroidTest.java** to validate the behaviour of the signDisplay functionality, specifically for API level 31 and above.
- Test cases cover scenarios for signDisplay: `NEVER | ALWAYS | EXCEPTZERO`

Reviewed By: avp

Differential Revision: D62153166

Pulled By: neildhar

fbshipit-source-id: d45c55ae7ffbfbc38ec4b331339859b8c96486c7
Summary:
X-link: facebook/react-native#46519

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D62763246

fbshipit-source-id: db0296d9ec5c04374c9cacb947b4879671044264
Summary:
The runtime crash callback is intended to run in a signal handler
environment, and so should not perform any memory allocations.

While it currently likely does not allocate because of the small string
optimisation, it is better to explicitly allocate the necessary storage
on the stack.

Reviewed By: tmikov

Differential Revision: D63055368

fbshipit-source-id: 7042539bc74e5b8edca4f6d6239460658db53e0f
Summary:
I have to use comment-type and noformat these files, because the toolchain used by hermes cannot handle the new syntax.

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D63496291

fbshipit-source-id: 5c9ab4098ebbe3edd58e6eedac8735cb0c445157
Summary: Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D63506281

fbshipit-source-id: a992a1786a570f5d9562fbec71e0d2628c139bf3
Summary:
There is no reason why we don't want to allow that, other than keeping consistent with the behavior of parsing function rest params. We can't change the JS spec for function rest params, but we can for component syntax to make it more permissive.

Prettier will still remove the trailing comma if we still care about the consistency of checked-in code, but it will at least make the experience of manually convert function component to component syntax slightly easier.

Changelog: [parser] Trailing comma is now allowed after rest parameter in component syntax.

Reviewed By: alexmckenley

Differential Revision: D63488906

fbshipit-source-id: d3afbdd5163de46ef11caf0824c45261af8c7482
Summary:
X-link: facebook/react-native#46710

Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D63560047

fbshipit-source-id: a43ac647fee12115c794aa8002bd340a4c4bcf16
Summary: Changelog: [Internal]

Reviewed By: SamChou19815

Differential Revision: D63441410

fbshipit-source-id: 57c93eff3dfd8490341d41ec6f579ddea7c3f56d
Summary:
Similar to D63488906, this diff does the same for component types.

Changelog: [parser] Trailing comma is now allowed after rest parameter in component type.

Reviewed By: alexmckenley

Differential Revision: D63661834

fbshipit-source-id: 5a1b80d186316bd24521a2fe79024171c1c41973
Summary:
Capture and replay the return values from Date getters that return
localized date numbers, ensuring they return the same numbers in
different timezones.

Reviewed By: neildhar

Differential Revision: D62754273

fbshipit-source-id: a687eafd7e8c1e0c9158def75ed3b0e14973ad68
Summary: Release version 0.24.0

Reviewed By: alexmckenley

Differential Revision: D63785082

fbshipit-source-id: b12ac0afe9cead170682901408c0076a9b20fe0b
Summary:
Enables support for `as const` construct with similar semantics to [typescript's](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions)

Changelog: [internal]

Reviewed By: alexmckenley

Differential Revision: D64146248

fbshipit-source-id: cee0b0d7e0477f690720b3a55f990aa0f59424bc
Summary:
Imported from static_h
Original Author: [email protected]
Original Git: 26e205d
Original Reviewed By: dannysu
Original Revision: D63863793

Step-out calculation must consider that there's a already a
breakpoint up the stack, so it has to check and use the real opcode
when calculating where to set the new step-out breakpoint.

`getNextOffset` is a function that shouldn't exist because it only is
used in the debugger when we should be accounting for breakpoints.

Reviewed By: avp

Differential Revision: D64125240

fbshipit-source-id: 773862d494debd31578b0e087119ca86fd6cef93
Summary:
Imported from static_h
Original Author: [email protected]
Original Git: b623a8d
Original Reviewed By: dannysu
Original Revision: D63920292

The interpreter inspects the IP up the stack to determine where to
return to, so check whether there's a breakpoint there before doing
`nextInstCall`. The check is now faster because we maintain a count of
how many installed breakpoints each `CodeBlock` has when the debugger is
enabled and check that before doing the more expensive map lookup on
every Ret.

Reviewed By: avp

Differential Revision: D64125238

fbshipit-source-id: 3bf400146c76d6d6cb715b8973ec6dea289f317f
Summary:
Light refactor of the CDP method name matching logic in CDPAgent to cut
down on repetitive string comparisons, en route to adding more methods
up the stack.

Reviewed By: dannysu

Differential Revision: D61274282

fbshipit-source-id: 8e93bd4662a43e5982ed0101940470cd1387eb1a
Summary: TSIA, V8 compatibility fix

Reviewed By: dannysu, robhogan

Differential Revision: D61280395

fbshipit-source-id: fab9cab348826d229f1e472d4bde1afa2a765652
Summary:
X-link: facebook/react-native#46032

Changelog: [Internal]

Implements the [`Runtime.releaseObject`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObject) and [`Runtime.releaseObjectGroup`](https://cdpstatus.reactnative.dev/devtools-protocol/tot/Runtime#method-releaseObjectGroup) CDP methods. These are used by CDT in a few places to release inspected objects (e.g. as part of the [popover](https://github.com/facebookexperimental/rn-chrome-devtools-frontend/blob/7b143e5d05a102c8c9cc7e282bab7b0751f75d61/front_end/panels/sources/DebuggerPlugin.ts#L766) feature), which is important to prevent memory leaks in long-running Fusebox sessions.

Reviewed By: dannysu, robhogan

Differential Revision: D61280394

fbshipit-source-id: 82181c6d0d6e52cf606ef2f48d389631e44b295e
Summary:
Add Apple TV support for Hermes.

*Note:* This support requires a few source file changes to work around code that will not compile for tvOS. Comments containing the compiler errors have been added.

Pull Request resolved: facebook#1529

Test Plan:
- tvOS is added to the Apple test app and to Circle CI
- Patch will be added to a test build of React Native TV to verify against RNTester

Reviewed By: tmikov

Differential Revision: D64030986

Pulled By: neildhar

fbshipit-source-id: 3338a4b97f3e750d1a116916f051d23c15d51976
Summary:
Instead of defining the OS preprocessor flags ourselves in CMake,
import TargetConditionals.h which will define them.

Reviewed By: tmikov

Differential Revision: D64090935

fbshipit-source-id: 8f0bc4f1947a400b657caca10ac3cc81bf839c6e
Summary:
Fix up some comments and remove unnecessary ifdefs in ICU, since we
never use ICU on Apple platforms.

Reviewed By: tmikov

Differential Revision: D64090933

fbshipit-source-id: 023f57d0508503a421115cca483fb6e462af3633
Summary:
Pull Request resolved: facebook#1530

The body of `Execute` is currently ifdef'd out on tvOS, which includes
the return statement. Instead, return false and report an error when it
is called on tvOS.

Reviewed By: tmikov

Differential Revision: D64090934

fbshipit-source-id: 45fdfdcd6bc5f30518c1faefdb6b5716b9701d02
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D64225120

fbshipit-source-id: ce00574ea5d367737191ac430017332799906ebe
Summary:
This is on by default in 0.248

https://github.com/facebook/flow/blob/v0.248/src/commands/config/flowConfig.ml#L248

Reviewed By: SamChou19815

Differential Revision: D64246738

fbshipit-source-id: d63a675f124544f658064ce349b919ec4622d822
Summary:
X-link: facebook/react-native#47004

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D64280903

fbshipit-source-id: f3f7a7bfdab30574fa911ba940032255932cd508
…t `React.Ref` translation

Summary:
- Add support for `React.RefSetter`. Now `React.RefSetter` in flow is equivalent to `React.Ref` in typescript.
- Removed support for `React.Ref` support. It's currently incorrectly translated anyways, since the right way to translate it should wrap the input with `React.ElementRef`.

Reviewed By: alexmckenley

Differential Revision: D64336172

fbshipit-source-id: a61ad77d41343e29c60873293a5cce1a09055ab4
Reviewed By: alexmckenley

Differential Revision: D64337078

fbshipit-source-id: fc7f20deec7771e73de769276aefe70c47fdbacc
Summary:
There are build errors when building with libstdc++:
1. DomainState.h doesn't `#include <string>`, but it's needed for
libstdc++
1. libstdc++ doesn't have the thread safety analysis stuff

Reviewed By: neildhar

Differential Revision: D64356105

fbshipit-source-id: f4ea7f12386bbbd305e53e862d49cee50d7999b2
tsaichien and others added 23 commits May 14, 2025 17:14
Summary:
Add interface `IHermesRuntimeV0` to contain the Hermes-specific runtime
functionalities. The interface `HermesRuntime` will inherit from both
`jsi::Runtime` and `IHermesRuntimeV0` to provide functionalities from
both.

This allows usage of `HermesRuntime` to remain the same for now while we
work on migrating these usages to query the appropriate interface
incrementally.

Reviewed By: tmikov

Differential Revision: D71132856

fbshipit-source-id: 75bcf3e18c2e4c9c3134c654af72c1bc0f1c08ca
…r version of Hermes

Summary:
Cast into `IHermes` in Synth Traces when Hermes-specific runtime
functionalities are used, instead of performing `dynamic_cast`

While we are here, also updated all unique_ptr usages of `jsi::Runtime`
to shared_ptr.

Reviewed By: neildhar

Differential Revision: D73525167

fbshipit-source-id: 8aab275bc4fa3fd1f5c34f162710296859af9096
Summary:
In SH, we have removed the ArrayBuffer runtime config, it's now always
required. To make sure that code uses
`hardenedHermesRuntimeConfig().rebuild().withArrayBuffer(true)` can
compile on both SH and Hermes, we need to update it to call
`withArrayBuffer` with true.

Reviewed By: dannysu

Differential Revision:
D75094298

Privacy Context Container: L1181999

fbshipit-source-id: 6ec5778503c06f1e6c184c091fdf997ca821b574
Summary: Added a wrapper around `StateValue`, which can be used for storing boolean flags in domain state.

Reviewed By: dannysu

Differential Revision: D68772900

fbshipit-source-id: ee25f8ac61f1888abdc706745cdfdf92a593c62b
Summary:
These changes add support for persisting the `breakpointsActive` flag in domain state, which survives reload of the CDP stack.

When `DebuggerDomainAgent` is constructed, it will read the persisted domain state and use the flag value, if persisted. If not, we will set it to `true` by default, this aligns with the behaviour on Web:
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/inspector/v8-debugger-agent-impl.cc;l=450-454;drc=27d34700b83f381c62e3a348de2e6dfdc08364b8

We will allow overwriting local state of the agent, even if the domain is disabled, this is where we diverge from V8's approach: https://source.chromium.org/chromium/chromium/src/+/main:v8/src/inspector/v8-debugger-agent-impl.cc;l=450-454;drc=27d34700b83f381c62e3a348de2e6dfdc08364b8

Reviewed By: dannysu

Differential Revision: D68772901

fbshipit-source-id: b461ad67691769eb69e9bdd8a8312762b130eca2
Summary: applying changes to xplat to make it compatible with both 2021 and 2024 rust editions

Reviewed By: dtolnay

Differential Revision: D75266795

fbshipit-source-id: 5bbcf33abd6621a7ffb362421dc4677b0d889412
Summary:
With latest top of trunk LLVM-20, we are getting this error from Hermes: https://www.internalfb.com/sandcastle/workflow/45035996293871392.

```
xplat/hermes/lib/Support/UTF8.cpp:190:20: error: implicit conversion from 'char16_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion]
  190 |     char32_t c32 = c;
      |              ~~~   ^
1 error generated.
```
https://www.internalfb.com/sandcastle/workflow/3355181722398743121
```
xplat/hermes/lib/Regex/RegexSerialization.cpp:89:22: error: implicit conversion from 'const char16_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion]
   89 |   char32_t c = insn->c;
      |            ~   ~~~~~~^
xplat/hermes/lib/Regex/RegexSerialization.cpp:150:22: error: implicit conversion from 'const char16_t' to 'char32_t' may change the meaning of the represented code unit [-Werror,-Wcharacter-conversion]
  150 |   char32_t c = insn->c;
      |            ~   ~~~~~~^
2 errors generated.
```
Fixing by adding explicit conversion.

Reviewed By: wlei-llvm

Differential Revision: D75381657

fbshipit-source-id: 4b527a96d199e466c047068824f0f60440ec12c1
Summary:
Pull Request resolved: facebook#1714

Pull Request resolved: facebook#1715

X-link: facebook/react-native#51651

this breaks certain compilers/build setups in cpp

Reviewed By: NickGerleman

Differential Revision: D75478125

fbshipit-source-id: d5a9db25ebeecb229e157babf2117e8a2096e0d2
Differential Revision:
D75478125

Original commit changeset: d5a9db25ebee

Original Phabricator Diff: D75478125

fbshipit-source-id: a5d06fccfb955cbb598e20c96f607b95b26795d1
… platform.

Summary: This generates both suffixless and Android suffixed rule that is consistent.

Reviewed By: rameshviswanathan

Differential Revision: D76324078

fbshipit-source-id: 74e161a3a820547ed76feab2f47cb73f64b5fb53
Summary:
`IHermes::resetTimezoneCache()` must be called by the integrator when a
timezone change has been detected.

Reviewed By: dannysu

Differential Revision: D75544519

Pulled By: tmikov

fbshipit-source-id: 3b698d2768eb7e226963f95018cd1d0758d9012d
Reviewed By: dannysu

Differential Revision: D76226574

fbshipit-source-id: 0878a2ad412d6c15b38747d0935a6d8875a28934
Summary:
RN has updated its minimum node version to 22:
facebook/react-native@df39ead

Upgrade the node version we are using to 24 so that we can continue to
build RN in our CI.

Also, RN no longer builds RNTester with JSC, and has renamed
installHermesRelease to just installRelease.

Pull Request resolved: facebook#1720

Reviewed By: avp

Differential Revision: D76639527

Pulled By: neildhar

fbshipit-source-id: 8019e48ceb7e0fa1d549fafde5d895fa7c6b8838
Summary:
## Instructions about RACER Diffs:
This diff fixes a 'Shadow Variable Warning' issue identified by Quality Insight from [Monetization codehub](https://fburl.com/quality/wmkbc0si):
 - Accept and ship the diff (racer does not do auto land)
 - [**Recommended**] Commandeer and land this diff.

If you are happy with the changes, please accept and ship, or commandeer it if minor edits are needed.
If you are not happy with the changes, please comment on the diff with clear actions and send it back to the author. Racer will pick it up and regenerate.
If you really feel the Racer is not helping with this change (alas, some complex changes are hard for AI) feel free to abandon this diff.

This diff was pre-created by Racer AI agent for your convenience on top of T228185350. More details about the program see this [post](https://fb.workplace.com/groups/1177219810659335/permalink/1198503531864296/). For questions or suggestions please post in [RACER Feedback and Q&A](https://fb.workplace.com/groups/2477474979269093) group.
## Summary:
Fix shadow variable warning in ESTreeIRGen-expr.cpp by renaming the inner 'done' variable to 'throwDone' to avoid shadowing the outer 'done' variable declared at line 1252.
 ---
> Generated by [RACER](https://www.internalfb.com/wiki/RACER_(Risk-Aware_Code_Editing_and_Refactoring)/), powered by [Confucius](https://www.internalfb.com/wiki/Confucius/Analect/Shared_Analects/Confucius_Code_Assist_(CCA)/)
[Session](https://www.internalfb.com/confucius?session_id=0f8811cc-50c9-11f0-872e-e2d3556ca05e&tab=Chat), [Trace](https://www.internalfb.com/confucius?session_id=0f8811cc-50c9-11f0-872e-e2d3556ca05e&tab=Trace)

Reviewed By: GeniusYe

Differential Revision: D76958334

fbshipit-source-id: 950ee853fb851924091dd5b4740f7bdbd4b85f1f
Summary: .

Reviewed By: neildhar

Differential Revision: D77328766

fbshipit-source-id: b5f4a0368457b9644fb04893f1decbf858fbdd54
Summary:
How to bypass React Native's default Hermes integration through
CocoaPods. I spent 2 days trying to build my app in iOS using a custom
 hermes build, and it was impossible until I found this flag.

Pull Request resolved: facebook#1724

Test Plan:
no need

Rollback Plan:

Reviewed By: avp

Differential Revision: D77121476

Pulled By: tmikov

fbshipit-source-id: ce39ff04446003c14bcc9865222bdccba4a414f8
Summary:
Vulnerability detected in the ws version we're using.
Ran `npm update ws`.

Reviewed By: fbmal7

Differential Revision: D77888903

fbshipit-source-id: 7dc568bb50b37c9a5ce549f116f84064487affd2
Summary:
ProfileGenerator class declaration was moved to .cpp file, the header only exposes `generateProfile()` method, which guarantees that there is a single `ProfileGenerator` instance for a single constructed `Profile`.

NOTE: No changes to logic or changes to Hermes' public API were made as part of this diff.

Reviewed By: fbmal7

Differential Revision: D76459081

fbshipit-source-id: 447155d3ba4d301a623b142234bb02bb4f6d0e89
Summary:
There are few key changes:
1. `stringStorage_` of public `Profile` struct is now `std::deque`. We use it because it is a stable container, which would guarantee the validity of `std::string_view` that referece the raw string owned by `stringStorage_` during the generation of the `Profile` object. It is also important to mention that `stringStorage_` is a private data member of `Profile`, so no actual changes were made to the public API.
2. Because of [1], we can safely remove `StringEntry` struct, because this is redunant now. All `std::string_view` will be stable and not invalidated if `stringStorage_` is populated.

Reviewed By: fbmal7

Differential Revision: D76974309

fbshipit-source-id: 4b22e510d03abdebd9a607bd616080569eec4676
Summary:
## Bug
Sparse arrays calling `Array.prototype.toSpliced` incorrectly fill empty slots with the last non-empty element. This issue arises because `arrayCopyHelper` does not reset the `fromValueHandle` when looping.
#### example:
```js
[1, , , , 5].toSpliced()    // output: [1, 1, 1, 1, 5]
                            // expected: [1, undefined, undefined, undefined, 5]
```

## Fix
Reseting `fromValueHandle` to `undefined` as per [MDN Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toSpliced#description)

Pull Request resolved: facebook#1728

Reviewed By: lavenzg

Differential Revision: D77894084

Pulled By: tmikov

fbshipit-source-id: 1224c0ea6b1f37a397b6c2c4df801602bb84991d
Reviewed By: fbmal7

Differential Revision: D78186116

fbshipit-source-id: 32fea118070688ddc63f3d9602da5b8b28c8d5b8
@iamAbhi-916 iamAbhi-916 requested a review from a team as a code owner July 14, 2025 11:17
Copy link
Member

@vmoroz vmoroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not look right. I guess you did not follow the merge process that we previously discussed.

@iamAbhi-916 iamAbhi-916 changed the title Merge 2025 7 14 Integration 2025 7 14 Jul 15, 2025
@iamAbhi-916 iamAbhi-916 marked this pull request as draft July 15, 2025 06:44
@iamAbhi-916 iamAbhi-916 requested a review from vmoroz July 15, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.