From d52b9d2f8636b7c49c2f613faf48de6ccf03f6f9 Mon Sep 17 00:00:00 2001 From: Chi Tsai Date: Sat, 15 Nov 2025 17:50:26 -0800 Subject: [PATCH] Add JSI_UNSTABLE flag (#54547) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54547 We want to have a proper way of releasing new JSI features, rather than releasing into JSI as they are added. To do this, we are adding a new `JSI_UNSTABLE` flag that will gate new features. Until Hermes releases a new version, all of these "unstable" features are subject to change. Interfaces may be modified, API behavior may be changed, etc. When Hermes release a new version, the new additions will be moved out of the "unstable" status and become frozen. This diff adds the `JSI_UNSTABLE` flag to JSI and adds corresponding changes to the BUCK build. Later diffs will use this gate new APIs. Changelog: [Internal] Reviewed By: lavenzg Differential Revision: D85915163 fbshipit-source-id: b2f754af4bb53db8dfe837e3ea2e2543d691754d --- packages/react-native/ReactCommon/jsi/jsi/jsi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react-native/ReactCommon/jsi/jsi/jsi.h b/packages/react-native/ReactCommon/jsi/jsi/jsi.h index 08edcd2a032..f4a2f6d63d4 100644 --- a/packages/react-native/ReactCommon/jsi/jsi/jsi.h +++ b/packages/react-native/ReactCommon/jsi/jsi/jsi.h @@ -252,6 +252,12 @@ class JSI_EXPORT NativeState { virtual ~NativeState(); }; +// JSI_UNSTABLE gates features that will be released with a Hermes version in +// the future. Until released, these features may be subject to change. After +// release, these features will be moved out of JSI_UNSTABLE and become frozen. +#ifdef JSI_UNSTABLE +#endif // JSI_UNSTABLE + /// Represents a JS runtime. Movable, but not copyable. Note that /// this object may not be thread-aware, but cannot be used safely from /// multiple threads at once. The application is responsible for