Skip to content

Commit 3f558ba

Browse files
prepare 2.16.1 release (#20)
1 parent 9c8d0d9 commit 3f558ba

File tree

6 files changed

+20
-24
lines changed

6 files changed

+20
-24
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
- run:
1818
name: dependency audit
1919
command: ./scripts/better-audit.sh
20+
- run:
21+
name: packaging test
22+
command: ./scripts/packaging-test.sh
2023
- store_test_results:
2124
path: reports/junit/
2225
- store_artifacts:

CHANGELOG.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,7 @@
33
All notable changes to the LaunchDarkly Client-side SDK for React will be documented in this file. For the source code for versions 2.13.0 and earlier, see the corresponding tags in the [js-client-sdk](https://github.com/launchdarkly/js-client-sdk) repository; this code was previously in a monorepo package there. See also the [JavaScript SDK changelog](https://github.com/launchdarkly/js-client-sdk/blob/master/CHANGELOG.md), since the React SDK inherits all of the underlying functionality of the JavaScript SDK; this file covers only changes that are specific to the React interface. This project adheres to [Semantic Versioning](http://semver.org).
44

55
## [2.16.0] - 2019-12-16
6-
### Added:
7-
- Configuration property `eventCapacity`: the maximum number of analytics events (not counting evaluation counters) that can be held at once, to prevent the SDK from consuming unexpected amounts of memory in case an application generates events unusually rapidly. In JavaScript code this would not normally be an issue, since the SDK flushes events every two seconds by default, but you may wish to increase this value if you will intentionally be generating a high volume of custom or identify events. The default value is 100.
8-
- Configuration properties `wrapperName` and `wrapperVersion`: used by the React SDK to identify a JS SDK instance that is being used with a wrapper API.
9-
10-
### Changed:
11-
- The SDK now logs a warning if any configuration property has an inappropriate type, such as `baseUri:3` or `sendEvents:"no"` (normally not possible in TypeScript, but could happen if an arbitrary object is cast to `LDOptions`). For boolean properties, the SDK will still interpret the value in terms of truthiness, which was the previous behavior. For all other types, since there's no such commonly accepted way to coerce the type, it will fall back to the default setting for that property; previously, the behavior was undefined but most such mistakes would have caused the SDK to throw an exception at some later point.
12-
13-
### Fixed:
14-
- When calling `identify`, the current user (as reported by `getUser()`) was being updated before the SDK had received the new flag values for that user, causing the client to be temporarily in an inconsistent state where flag evaluations would be associated with the wrong user in analytics events. Now, the current-user state will stay in sync with the flags and change only when they have finished changing. (Thanks, [edvinerikson](https://github.com/launchdarkly/js-sdk-common/pull/3)!)
15-
16-
### Deprecated:
17-
- The `samplingInterval` configuration property was deprecated in the code in the previous minor version release, and in the changelog, but the deprecation notice was accidentally omitted from the documentation comments. It is hereby deprecated again.
18-
6+
***This release was broken and has been removed.***
197

208
## [2.15.1] - 2019-11-14
219
### Fixed:

scripts/packaging-test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
npm pack
6+
TARBALL=$(ls *.tgz)
7+
trap "rm ${TARBALL}" EXIT
8+
9+
tar tfz ${TARBALL} | grep '^package/lib/.*\.js$' || (echo "tarball contained no .js files"; exit 1)
10+
tar tfz ${TARBALL} | grep '^package/lib/.*\.d\.ts$' || (echo "tarball contained no .d.ts files"; exit 1)
11+
12+
echo "tarball contained .js and .d.ts files in package/lib/ - OK"

src/initLDClient.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ jest.mock('launchdarkly-js-client-sdk', () => {
1010
import { initialize, LDClient, LDOptions, LDUser } from 'launchdarkly-js-client-sdk';
1111
import { defaultReactOptions, LDReactOptions } from './types';
1212
import initLDClient from './initLDClient';
13-
import * as packageJson from '../package.json';
1413

1514
const ldClientInitialize = initialize as jest.Mock;
1615

1716
const clientSideID = 'deadbeef';
1817
const defaultUser: LDUser = { key: 'abcdef' };
19-
const options: LDOptions = { bootstrap: 'localStorage', wrapperName: 'React', wrapperVersion: packageJson.version };
18+
const options: LDOptions = { bootstrap: 'localStorage', wrapperName: 'React' };
2019
const flags = { 'test-flag': false, 'another-test-flag': true };
2120

2221
describe('initLDClient', () => {
@@ -42,11 +41,7 @@ describe('initLDClient', () => {
4241
const anonUser: LDUser = { anonymous: true };
4342
await initLDClient(clientSideID);
4443

45-
expect(ldClientInitialize.mock.calls[0]).toEqual([
46-
clientSideID,
47-
anonUser,
48-
{ wrapperName: 'React', wrapperVersion: packageJson.version },
49-
]);
44+
expect(ldClientInitialize.mock.calls[0]).toEqual([clientSideID, anonUser, { wrapperName: 'React' }]);
5045
expect(mockLDClient.variation).toHaveBeenCalledTimes(0);
5146
});
5247

src/initLDClient.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { initialize as ldClientInitialize, LDClient, LDFlagSet, LDOptions, LDUser } from 'launchdarkly-js-client-sdk';
22
import { AllFlagsLDClient, defaultReactOptions, LDReactOptions } from './types';
33
import { camelCaseKeys } from './utils';
4-
import * as packageJson from '../package.json';
54

65
/**
76
* Internal function to initialize the `LDClient`.
@@ -21,7 +20,7 @@ const initLDClient = async (
2120
options?: LDOptions,
2221
targetFlags?: LDFlagSet,
2322
): Promise<AllFlagsLDClient> => {
24-
const allOptions = { wrapperName: 'React', wrapperVersion: packageJson.version, ...options };
23+
const allOptions = { wrapperName: 'React', ...options };
2524
const ldClient = ldClientInitialize(clientSideID, user, allOptions);
2625

2726
return new Promise<AllFlagsLDClient>(resolve => {

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"noImplicitAny": true,
1111
"strictNullChecks": true,
1212
"jsx": "react",
13-
"esModuleInterop": true,
14-
"resolveJsonModule": true,
13+
"esModuleInterop": true
1514
},
1615
"files": [
1716
"./node_modules/@testing-library/jest-dom/extend-expect.d.ts"

0 commit comments

Comments
 (0)