Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
d7d3e4d
Initial commit
yusinto Dec 17, 2019
ad4e40b
Delete extraneous files from lib.
yusinto Dec 17, 2019
11cbc6e
Merge branch 'master' into yus/include-package-version
yusinto Dec 17, 2019
a8da84e
Update initLDClient.test.ts
yusinto Dec 17, 2019
400bf91
Update withLDProvider.tsx (#18)
bwoskow-ld Feb 7, 2020
6b6dd3c
update JS SDK dependency to 2.16.3
eli-darkly Feb 10, 2020
c2b165d
merge from public after release
LaunchDarklyCI Feb 11, 2020
06740cb
use JS SDK 2.17.0
eli-darkly Feb 14, 2020
6fe7dc8
improve tests to clarify which options we're passing in and which one…
eli-darkly Feb 14, 2020
8ea62ee
Merge branch 'master' into yus/include-package-version
eli-darkly Feb 14, 2020
5f571b2
set wrapperName to react-client-sdk
eli-darkly Feb 14, 2020
861f3a5
lint
eli-darkly Feb 14, 2020
643cc66
Merge pull request #14 from launchdarkly/yus/include-package-version
eli-darkly Feb 14, 2020
0120afa
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
eli-darkly Feb 20, 2020
5139887
Update withLDProvider.test.tsx
yusinto Mar 2, 2020
b9d12a4
Merge pull request #20 from launchdarkly/yus/ch67846/remove-test-only…
yusinto Mar 2, 2020
79fae1b
update JS SDK to 2.17.5 + a few dev dependency bumps (#21)
eli-darkly May 19, 2020
2712355
merge from public after release
LaunchDarklyCI May 19, 2020
8bbb2fa
downgrade typescript to 3.8.3 (#22)
bwoskow-ld May 27, 2020
e8e9eff
merge from public after release
LaunchDarklyCI May 27, 2020
aff2ffc
[Fixes for] Expose LDProvider as a standalone component (#31)
Morton Jun 12, 2020
1bb5eb0
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Jun 12, 2020
8b557ab
remove startsWith usage (#23)
bwoskow-ld Jul 13, 2020
70c3b3e
Fix the broken build (#24)
bwoskow-ld Jul 14, 2020
6db0f08
Expose ld provider (#40)
bezreyhan Jul 15, 2020
352a155
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Jul 15, 2020
9e7b06e
merge from public after release
LaunchDarklyCI Jul 15, 2020
919f25b
update to JS SDK 2.18.0 (adds disableSyncEventPost) (#25)
eli-darkly Jul 17, 2020
c8ca3e3
merge from public after release
LaunchDarklyCI Jul 17, 2020
2244420
Merge branch 'master' of github.com:launchdarkly/react-client-sdk int…
bwoskow-ld Aug 13, 2020
65627a6
45 fix providers to respect subscribed flags (#46)
clayembry Aug 13, 2020
ab0aa0d
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 13, 2020
5df4e95
targetflags simplified logic (#26)
bwoskow-ld Aug 19, 2020
c724bbc
merge from public after release
LaunchDarklyCI Aug 19, 2020
ba659f8
Merge branch 'master' of github.com:launchdarkly/react-client-sdk int…
bwoskow-ld Aug 20, 2020
95a8f54
remove client-side ids from examples (#27)
bwoskow-ld Sep 2, 2020
87d390a
update JS SDK to 2.18.1
eli-darkly Sep 14, 2020
099c4e8
Merge pull request #28 from launchdarkly/eb/ch89575/update-js-sdk
eli-darkly Sep 14, 2020
39b3365
merge from public after release
LaunchDarklyCI Sep 14, 2020
0500fd5
Merge branch 'master' into contrib
bwoskow-ld Oct 12, 2020
707bd0d
Fixing camelCaseKeys export (#44)
GreenGremlin Oct 14, 2020
14b71ab
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Oct 14, 2020
ac101c1
new js-common-sdk version (#30)
bwoskow-ld Nov 17, 2020
d96bcbd
merge from public after release
LaunchDarklyCI Nov 17, 2020
d7c0538
adding alias functionality (#31)
bwoskow-ld Jan 27, 2021
9a603d1
pin typedoc to unblock our releases (#32)
bwoskow-ld Jan 27, 2021
2bedf2e
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Jan 27, 2021
b8e0ca5
Removed the guides link
bwoskow-ld Feb 3, 2021
fc04bcd
add inlineUsersToEvents to TypeScript defs by updating js-client-sdk …
eli-darkly Apr 1, 2021
d152a5f
merge from public after release
LaunchDarklyCI Apr 3, 2021
d9414bf
debugging
bwoskow-ld Apr 5, 2021
989115d
Fix linting errors
yusinto Apr 6, 2021
89e33d8
[ch103643] Fix examples to use local sdk
yusinto Apr 6, 2021
02f5913
Remove unwanted changes.
yusinto Apr 6, 2021
845c1dc
Update package.json
yusinto Apr 6, 2021
f9cb379
Update yarn.lock
yusinto Apr 6, 2021
9892e1a
Update lock files.
yusinto Apr 6, 2021
2b6deb5
Merge branch 'master' into yus/ch103643/react-17-version-upgrade
yusinto Apr 6, 2021
4daa509
Update package-lock.json
yusinto Apr 6, 2021
0cac0de
Update package-lock.json
yusinto Apr 6, 2021
499ef3a
Update package.json
yusinto Apr 6, 2021
f18da04
Update link-dev.sh
yusinto Apr 6, 2021
72060ec
Update link-dev.sh
yusinto Apr 6, 2021
9c3af17
Update yarn.lock
yusinto Apr 6, 2021
4ae953b
Merge pull request #35 from launchdarkly/yus/ch103643/react-17-versio…
yusinto Apr 7, 2021
bd593c4
Merge branch 'master' of github.com:launchdarkly/react-client-sdk int…
bwoskow-ld Apr 7, 2021
7e12d7d
Add react 17 peer dep (#61)
maclockard Apr 7, 2021
2ba476c
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Apr 7, 2021
008ebe6
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Apr 7, 2021
9a66a07
Update common JS SDK library to use fixes for debug event generation …
gwhelanLD Jun 9, 2021
2a15a92
Merge remote-tracking branch 'public/master'
gwhelanLD Jun 9, 2021
2c749c2
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Jun 11, 2021
373d97c
Merge branch 'master' of github.com:launchdarkly/react-client-sdk int…
bwoskow-ld Jul 16, 2021
c7597dc
HOC static hoisting (#71)
NathanWaddell121107 Jul 16, 2021
a31eda4
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Jul 16, 2021
e2e4d09
Added a test for hoisting react statics in withLDProvider HOC
ctawiah Jul 16, 2021
e9fa2c1
Fixed linting errors
ctawiah Jul 16, 2021
3932985
Fixed more linting errors
ctawiah Jul 16, 2021
495ca74
Merge pull request #37 from launchdarkly/ctawiah/ch107066/add-test-fo…
ctawiah Jul 16, 2021
6ae2008
merge from public after release
Jul 16, 2021
d9740c6
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
3873e25
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
34f9014
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
a93509b
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
dcd5978
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
1c8e04c
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 5, 2021
31c97db
update example app deps (#38)
bwoskow-ld Aug 10, 2021
f67d178
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Aug 11, 2021
392baae
Updated asyncWithLDProvider to fetch latest flag values when the Prov…
ctawiah Sep 2, 2021
3be61ad
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Sep 2, 2021
9e69ac0
merge from public after release
Sep 3, 2021
3cdc9e1
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Sep 21, 2021
7a3f7ff
Merge branch 'master' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Sep 21, 2021
36cead6
Updates docs URLs
ember-stevens Sep 26, 2021
d8a2b47
Merge pull request #40 from launchdarkly/emberstevens/sc-118589/url-a…
ember-stevens Sep 27, 2021
e4c356d
Merge branch 'master' of github.com:launchdarkly/react-client-sdk int…
bwoskow-ld Oct 6, 2021
0871aa2
fix: improve types of withLDProvider (#97)
dsifford Oct 6, 2021
6f706f5
Merge branch 'contrib' of github.com:launchdarkly/react-client-sdk
bwoskow-ld Oct 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing to the LaunchDarkly Client-side SDK for React

LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.
LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/sdk/concepts/contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.

## Submitting bug reports and feature requests

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## LaunchDarkly overview

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Expand All @@ -16,7 +16,7 @@ Additionally, refer to the [JavaScript SDK README](https://github.com/launchdark

## Getting started

Refer to the [SDK documentation](https://docs.launchdarkly.com/docs/react-sdk-reference#section-getting-started) for instructions on getting started with using the SDK.
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/client-side/react/react-web#getting-started) for instructions on getting started with using the SDK.

Please note that the React SDK has two special requirements in terms of your LaunchDarkly environment. First, in terms of the credentials for your environment that appear on your [Account Settings](https://app.launchdarkly.com/settings/projects) dashboard, the React SDK uses the "Client-side ID"-- not the "SDK key" or the "Mobile key". Second, for any feature flag that you will be using in React code, you must check the "Make this flag available to client-side SDKs" box on that flag's Settings page.

Expand All @@ -41,7 +41,7 @@ We encourage pull requests and other contributions from the community. Check out
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
* Explore LaunchDarkly
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
Expand Down
2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface LDContext {
* An instance of `LDClient` from the LaunchDarkly JS SDK (`launchdarkly-js-client-sdk`).
* This will be be undefined initially until initialization is complete.
*
* @see http://docs.launchdarkly.com/docs/js-sdk-reference
* @see https://docs.launchdarkly.com/sdk/client-side/javascript
*/
ldClient?: LDClient;
}
Expand Down
10 changes: 5 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export interface LDReactOptions {
* This is true by default, meaning that keys will automatically be converted to camel-case.
*
* For more information, see the React SDK Reference Guide on
* [flag keys](https://docs.launchdarkly.com/docs/react-sdk-reference#section-flag-keys).
* [flag keys](https://docs.launchdarkly.com/sdk/client-side/react/react-web#flag-keys).
*
* @see https://docs.launchdarkly.com/docs/react-sdk-reference#section-flag-keys
* @see https://docs.launchdarkly.com/sdk/client-side/react/react-web#flag-keys
*/
useCamelCaseFlagKeys?: boolean;
}
Expand All @@ -43,7 +43,7 @@ export interface ProviderConfig {
* A LaunchDarkly user object. If unspecified, a new user with a
* random key will be created and used. This user's key will remain constant across browser sessions.
*
* @see http://docs.launchdarkly.com/docs/js-sdk-reference#section-users
* @see https://docs.launchdarkly.com/sdk/features/user-config#javascript
*/
user?: LDUser;

Expand All @@ -55,7 +55,7 @@ export interface ProviderConfig {
/**
* LaunchDarkly initialization options. These options are common between LaunchDarkly's JavaScript and React SDKs.
*
* @see https://docs.launchdarkly.com/docs/js-sdk-reference#section-customizing-your-client
* @see https://docs.launchdarkly.com/sdk/features/config#javascript
*/
options?: LDOptions;

Expand Down Expand Up @@ -98,7 +98,7 @@ export interface AllFlagsLDClient {
/**
* An instance of `LDClient` from the LaunchDarkly JS SDK (`launchdarkly-js-client-sdk`).
*
* @see http://docs.launchdarkly.com/docs/js-sdk-reference
* @see https://docs.launchdarkly.com/sdk/client-side/javascript
*/
ldClient: LDClient;
}
2 changes: 1 addition & 1 deletion src/withLDConsumer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface LDProps {
/**
* An instance of `LDClient` from the LaunchDarkly JS SDK (`launchdarkly-js-client-sdk`)
*
* @see http://docs.launchdarkly.com/docs/js-sdk-reference
* @see https://docs.launchdarkly.com/sdk/client-side/javascript
*/
ldClient?: LDClient;
}
Expand Down
8 changes: 5 additions & 3 deletions src/withLDProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ import hoistNonReactStatics from 'hoist-non-react-statics';
* @param config - The configuration used to initialize LaunchDarkly's JS SDK
* @return A function which accepts your root React component and returns a HOC
*/
export function withLDProvider(config: ProviderConfig): (WrappedComponent: React.ComponentType) => React.ComponentType {
return function withLDProviderHoc(WrappedComponent: React.ComponentType): React.ComponentType {
export function withLDProvider<T = {}>(
config: ProviderConfig,
): (WrappedComponent: React.ComponentType<T>) => React.ComponentType<T> {
return function withLDProviderHoc(WrappedComponent: React.ComponentType<T>): React.ComponentType<T> {
const { reactOptions: userReactOptions } = config;
const reactOptions = { ...defaultReactOptions, ...userReactOptions };
const providerProps = { ...config, reactOptions };

class HoistedComponent extends React.Component {
class HoistedComponent extends React.Component<T> {
render() {
return (
<LDProvider {...providerProps}>
Expand Down