Skip to content
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

fix: Improvements and fixes from docs review. #362

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

yusinto
Copy link
Contributor

@yusinto yusinto commented Feb 6, 2024

These are discovered after the docs PR review:

  • Client sdk default baseUri should be clientsdk.launchdarkly instead of sdk.launchdarkly.
  • Add getConnectionMode.
  • Remove identify hash arg.
  • Change rn default logging to info.
  • Add debug config option.
  • Add comments about autoEnv applicationInfo.
  • Remove LDProvider context prop.

Copy link

This pull request has been linked to Shortcut Story #232618: RN fixes from Docs review.

@@ -1,9 +1,9 @@
{
"extends": "expo/tsconfig.base",
"compilerOptions": {
"jsx": "react",
"jsx": "react-jsx",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes typescript complaint: 'React' refers to a UMD global, but the current file is a module.

@@ -8,7 +8,13 @@ import {

import Welcome from './src/welcome';

const featureClient = new ReactNativeLDClient(MOBILE_KEY, AutoEnvAttributes.Enabled);
const featureClient = new ReactNativeLDClient(MOBILE_KEY, AutoEnvAttributes.Enabled, {
debug: true,
Copy link
Member

Choose a reason for hiding this comment

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

Not sure the example should enable debug.

Comment on lines +6 to +8
"typeRoots": ["./types"],
},
"exclude": ["e2e"]
"exclude": ["e2e"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prettier insists that tsconfig.json is a JSONC file and so trailing commas should be used.

@@ -18,25 +15,15 @@ type LDProps = {
*
* @param client The ReactNativeLDClient object. Initialize this object separately
* and then set this prop when declaring the LDProvider.
* @param context Optional. The LDContext object. If set, the LDProvider will
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this because this seems extraneous and unnecessary. Customers can already construct and then identify through LDClient which can be awaited so that should be the primary usage.

Secondly supplying the context this way and then having the LDProvider identifying it under the hood hides logic and creates a mysterious magic effect which we have to document and support. The identify call also can't be awaited which is a big problem.

The example app has been setup and tested with a manual identify thus far and everything works good.

Due to these I have decided its best to remove this for the initial v10 release. We can revisit if this is needed in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

watching this, because removing this will mean minor docs corrections -- I'll update when this PR is merged

@@ -100,12 +100,10 @@ export interface LDClient {
*
* @param context
* The LDContext object.
* @param hash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing this for now for RN v10 since it is unused. This will be revisited when we do the react sdk next project.

*
* The default value is false.
*/
debug?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Callout: this is new. It's an easy way to debug the sdk.

@yusinto yusinto requested a review from kinyoklion February 6, 2024 21:02
@yusinto yusinto enabled auto-merge (squash) February 6, 2024 21:06
@yusinto yusinto merged commit ba07fbf into main Feb 6, 2024
16 checks passed
@yusinto yusinto deleted the yus/sc-232618/rn-fixes-from-docs-review branch February 6, 2024 21:06
@github-actions github-actions bot mentioned this pull request Feb 6, 2024
yusinto pushed a commit that referenced this pull request Feb 6, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>akamai-edgeworker-sdk-common: 1.1.0</summary>

##
[1.1.0](akamai-edgeworker-sdk-common-v1.0.6...akamai-edgeworker-sdk-common-v1.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from ^2.1.3 to ^2.2.0
</details>

<details><summary>akamai-server-base-sdk: 2.1.0</summary>

##
[2.1.0](akamai-server-base-sdk-v2.0.6...akamai-server-base-sdk-v2.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.0.6 to
^1.1.0
    * @launchdarkly/js-server-sdk-common bumped from ^2.1.3 to ^2.2.0
</details>

<details><summary>akamai-server-edgekv-sdk: 1.1.0</summary>

##
[1.1.0](akamai-server-edgekv-sdk-v1.0.14...akamai-server-edgekv-sdk-v1.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.0.6 to
^1.1.0
    * @launchdarkly/js-server-sdk-common bumped from ^2.1.3 to ^2.2.0
</details>

<details><summary>cloudflare-server-sdk: 2.4.0</summary>

##
[2.4.0](cloudflare-server-sdk-v2.3.3...cloudflare-server-sdk-v2.4.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common-edge bumped from 2.1.3 to 2.2.0
</details>

<details><summary>js-client-sdk-common: 0.2.0</summary>

##
[0.2.0](js-client-sdk-common-v0.1.2...js-client-sdk-common-v0.2.0)
(2024-02-06)


### Features

* Implement common client side support for auto environment attributes.
([#356](#356))
([8d80259](8d80259))
* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Bug Fixes

* Add LDOptions.application name and versionName.
([#358](#358))
([cd75210](cd75210))
* Add RN SDK offline support through ConnectionMode.
([#361](#361))
([d97ce82](d97ce82))
* Implement anonymous context processing
([#350](#350))
([308100d](308100d))
* Improvements and fixes from docs review.
([#362](#362))
([ba07fbf](ba07fbf))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.1.1 to 2.2.0
</details>

<details><summary>js-sdk-common: 2.2.0</summary>

##
[2.2.0](js-sdk-common-v2.1.1...js-sdk-common-v2.2.0)
(2024-02-06)


### Features

* Implement common client side support for auto environment attributes.
([#356](#356))
([8d80259](8d80259))
* Implement common support for auto environment attributes.
([#355](#355))
([9f562e5](9f562e5))
* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Bug Fixes

* Add LDOptions.application name and versionName.
([#358](#358))
([cd75210](cd75210))
* Add RN SDK offline support through ConnectionMode.
([#361](#361))
([d97ce82](d97ce82))
* Implement anonymous context processing
([#350](#350))
([308100d](308100d))
* RN streamer connection in background and foreground.
([#360](#360))
([c69b768](c69b768))
</details>

<details><summary>js-server-sdk-common: 2.2.0</summary>

##
[2.2.0](js-server-sdk-common-v2.1.3...js-server-sdk-common-v2.2.0)
(2024-02-06)


### Features

* Implement common client side support for auto environment attributes.
([#356](#356))
([8d80259](8d80259))
* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Bug Fixes

* Add LDOptions.application name and versionName.
([#358](#358))
([cd75210](cd75210))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.1.1 to 2.2.0
</details>

<details><summary>js-server-sdk-common-edge: 2.2.0</summary>

##
[2.2.0](js-server-sdk-common-edge-v2.1.3...js-server-sdk-common-edge-v2.2.0)
(2024-02-06)


### Features

* Implement common client side support for auto environment attributes.
([#356](#356))
([8d80259](8d80259))
* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.1.3 to 2.2.0
</details>

<details><summary>node-server-sdk: 9.1.0</summary>

##
[9.1.0](node-server-sdk-v9.0.6...node-server-sdk-v9.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.1.3 to 2.2.0
</details>

<details><summary>node-server-sdk-dynamodb: 6.1.0</summary>

##
[6.1.0](node-server-sdk-dynamodb-v6.0.6...node-server-sdk-dynamodb-v6.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.0.6 to 9.1.0
</details>

<details><summary>node-server-sdk-redis: 4.1.0</summary>

##
[4.1.0](node-server-sdk-redis-v4.0.6...node-server-sdk-redis-v4.1.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.0.6 to 9.1.0
</details>

<details><summary>react-native-client-sdk: 0.2.0</summary>

##
[0.2.0](react-native-client-sdk-v0.1.5...react-native-client-sdk-v0.2.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Bug Fixes

* Add RN SDK offline support through ConnectionMode.
([#361](#361))
([d97ce82](d97ce82))
* Implement RN SDK EventSource jitter backoff.
([#359](#359))
([95e58bd](95e58bd))
* Improvements and fixes from docs review.
([#362](#362))
([ba07fbf](ba07fbf))
* RN streamer connection in background and foreground.
([#360](#360))
([c69b768](c69b768))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 0.1.2 to 0.2.0
</details>

<details><summary>vercel-server-sdk: 1.3.0</summary>

##
[1.3.0](vercel-server-sdk-v1.2.3...vercel-server-sdk-v1.3.0)
(2024-02-06)


### Features

* React-native support for auto-env attributes. Only affects
react-native package.
([deea99c](deea99c))
* Update eslint jest configuration and versions.
([deea99c](deea99c))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common-edge bumped from 2.1.3 to 2.2.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants