Skip to content

Commit a4d1760

Browse files
fix: [FFM-12209]: bump version from 1.14.0 to 2.0.0 (#23)
- fix error encounered after upgrade react-native to v0.76
1 parent b9cb73e commit a4d1760

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function MultipleFeatureFlags() {
102102
By default, the React Client SDK will block rendering of children until the initial load of Feature Flags has completed.
103103
This ensures that children have immediate access to all Flags when they are rendered. However, in some circumstances it
104104
may be beneficial to immediately render the application and handle display of loading on a component-by-component basis.
105-
The React Client SDK's asynchronous mode allows this by passing the optional `async` prop when connecting with the
105+
The React Client SDK's asynchronous mode allows this by passing the optional `asyncMode` prop when connecting with the
106106
`FFContextProvider`.
107107

108108

@@ -112,7 +112,7 @@ It includes the flag, variation, and whether the SDK was still initializing (`lo
112112

113113
This can happen when:
114114

115-
1. Using `async` mode without `cache` or `initialEvaluations` and where the SDK is still initializing.
115+
1. Using `asyncMode` mode without `cache` or `initialEvaluations` and where the SDK is still initializing.
116116
2. The flag identifier is incorrect (e.g., due to a typo).
117117
3. The wrong API key is being used, and the expected flags are not available for that project.
118118

@@ -232,7 +232,7 @@ using the `useFeatureFlag` and `useFeatureFlags` hooks and `withFeatureFlags`
232232
your Harness Feature Flags account, and the `target`. You can think of a `target` as a user.
233233

234234
The `FFContextProvider` component also accepts an `options` object, a `fallback` component, an array
235-
of `initialEvaluations`, an `onError` handler, and can be placed in [Async mode](#Async-mode) using the `async` prop.
235+
of `initialEvaluations`, an `onError` handler, and can be placed in [Async mode](#Async-mode) using the `asyncMode` prop.
236236
The `fallback` component will be displayed while the SDK is connecting and fetching your flags. The `initialEvaluations`
237237
prop allows you pass an array of evaluations to use immediately as the SDK is authenticating and fetching flags.
238238
The `onError` prop allows you to pass an event handler which will be called whenever a network error occurs.
@@ -245,7 +245,7 @@ import { FFContextProvider } from '@harnessio/ff-react-client-sdk'
245245
function MyComponent() {
246246
return (
247247
<FFContextProvider
248-
async={false} // OPTIONAL: whether or not to use async mode
248+
asyncMode={false} // OPTIONAL: whether or not to use async mode
249249
apiKey="YOUR_API_KEY" // your SDK API key
250250
target={{
251251
identifier: 'targetId', // unique ID of the Target

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@harnessio/ff-react-client-sdk",
3-
"version": "1.14.0",
3+
"version": "2.0.0",
44
"author": "Harness",
55
"license": "Apache-2.0",
66
"module": "dist/esm/index.js",

src/context/FFContext.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('FFContextProvider', () => {
7171
expect(getByText('Loaded')).toBeInTheDocument()
7272
})
7373

74-
test('it triggers onFlagNotFound callback when flag is missing with async disabled', async () => {
74+
test('it triggers onFlagNotFound callback when flag is missing with asyncMode disabled', async () => {
7575
const mockOn = jest.fn()
7676
const mockOnFlagNotFound = jest.fn()
7777

@@ -86,7 +86,7 @@ describe('FFContextProvider', () => {
8686
apiKey="test-api-key"
8787
target={{ identifier: 'test-target' }}
8888
onFlagNotFound={mockOnFlagNotFound}
89-
async={false}
89+
asyncMode={false}
9090
>
9191
<p>Loaded</p>
9292
</FFContextProvider>
@@ -116,7 +116,7 @@ describe('FFContextProvider', () => {
116116
)
117117
})
118118

119-
test('it triggers onFlagNotFound callback when flag is missing with async enabled', async () => {
119+
test('it triggers onFlagNotFound callback when flag is missing with asyncMode enabled', async () => {
120120
const mockOn = jest.fn()
121121
const mockOnFlagNotFound = jest.fn()
122122

@@ -131,7 +131,7 @@ describe('FFContextProvider', () => {
131131
apiKey="test-api-key"
132132
target={{ identifier: 'test-target' }}
133133
onFlagNotFound={mockOnFlagNotFound}
134-
async={true}
134+
asyncMode={true}
135135
>
136136
<p>Loaded</p>
137137
</FFContextProvider>

src/context/FFContext.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface FFContextProviderProps extends PropsWithChildren {
3838
target: Target
3939
options?: Options
4040
fallback?: ReactNode
41-
async?: boolean
41+
asyncMode?: boolean
4242
initialEvaluations?: Evaluation[]
4343
onError?: (event: NetworkError | 'PropsError', error?: unknown) => void
4444
onFlagNotFound?: (
@@ -53,7 +53,7 @@ export const FFContextProvider: FC<FFContextProviderProps> = ({
5353
target,
5454
options = {},
5555
fallback = <p>Loading...</p>,
56-
async = false,
56+
asyncMode = false,
5757
initialEvaluations,
5858
onError = () => void 0,
5959
onFlagNotFound = () => void 0
@@ -161,7 +161,7 @@ export const FFContextProvider: FC<FFContextProviderProps> = ({
161161

162162
return (
163163
<FFContext.Provider value={{ loading, flags, client: clientInstance }}>
164-
{!async && loading ? fallback : children}
164+
{!asyncMode && loading ? fallback : children}
165165
</FFContext.Provider>
166166
)
167167
}

0 commit comments

Comments
 (0)