From cbf9408dd0e3b66718d4ffef41293dd6c06ad43a Mon Sep 17 00:00:00 2001 From: David Vacca Date: Sun, 30 Jul 2023 11:54:13 -0700 Subject: [PATCH] Introduce FrameworkAPI annotation to document APIs that are provided ONLY for frameworks (#38686) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38686 In this diff I'm introducing the FrameworkAPI annotation to document APIs that are provided ONLY for frameworks changelog: [internal] internal Reviewed By: cortinico Differential Revision: D47839411 fbshipit-source-id: 254a1f6cd42279478fba0ddb3f3736bb2b675bae --- .../react/common/annotations/FrameworkAPI.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/FrameworkAPI.kt diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/FrameworkAPI.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/FrameworkAPI.kt new file mode 100644 index 00000000000..3d3d5b9e9c8 --- /dev/null +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/common/annotations/FrameworkAPI.kt @@ -0,0 +1,18 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.react.common.annotations + +@Retention(AnnotationRetention.RUNTIME) +@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) +@RequiresOptIn( + level = RequiresOptIn.Level.ERROR, + message = + "This API is provided only for React Native frameworks and not intended for general users. " + + "This API can change between minor versions in alignment with React Native frameworks " + + "and won't be considered a breaking change.") +annotation class FrameworkAPI