Skip to content

Commit 56a62f9

Browse files
prepare 2.19.3 release (#235)
1 parent ab471f5 commit 56a62f9

File tree

7 files changed

+18
-23
lines changed

7 files changed

+18
-23
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: circleci/node:11.10.1
5+
- image: cimg/node:12.22
66
steps:
77
- checkout
88

.ldrelease/config.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: 2
2+
13
repo:
24
public: js-client-sdk
35
private: js-client-sdk-private
@@ -6,11 +8,14 @@ publications:
68
- url: https://www.npmjs.com/package/launchdarkly-js-client-sdk
79
description: npm
810

9-
template:
10-
name: npm
11+
jobs:
12+
- docker:
13+
image: node:12-buster
14+
template:
15+
name: npm
1116

1217
documentation:
13-
githubPages: true
18+
gitHubPages: true
1419
title: LaunchDarkly JavaScript SDK
1520

1621
sdk:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ Note: _If you are using JavaScript in a non-browser environment,_ please see our
1616

1717
Please note that the JavaScript 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 JavaScript 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 JavaScript code, you must check the "Make this flag available to client-side SDKs" box on that flag's Settings page.
1818

19-
### ReactJS
19+
## ReactJS
2020

2121
The SDK does not require any particular JavaScript framework. However, if you are using [React](https://reactjs.org/), there is an add-on to simplify use of the SDK. See [`react-client-sdk`](https://github.com/launchdarkly/react-client-sdk).
2222

2323
## Browser compatibility
2424

2525
The LaunchDarkly SDK can be used in all major browsers. However, web browsers vary widely in their support of specific features and standards. Three features that are used by the LaunchDarkly SDK that may not be available on every browser are `Promise`, `EventSource`, and `document.querySelectorAll()`. For more information on whether you may need to use a polyfill to ensure compatibility, and how to do so, see ["JS SDK requirements and polyfills"](https://docs.launchdarkly.com/sdk/client-side/javascript/requirements-polyfills).
2626

27-
### Logging
27+
## Logging
2828

2929
By default, the SDK sends log output to the browser console. There are four logging levels: `debug`, `info`, `warn`, and `error`; by default, `debug` and `info` messages are hidden. See [`LDOptions.logger`](https://launchdarkly.github.io/js-client-sdk/interfaces/_launchdarkly_js_client_sdk_.ldoptions.html#logger) and [`createConsoleLogger`](https://launchdarkly.github.io/js-client-sdk/index.html#createconsolelogger) for more details.
3030

docs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ html: prepare
1717
../node_modules/.bin/typedoc --options typedoc.js
1818
mv before-typedoc-package.json ../package.json
1919
mv before-typedoc-package-lock.json ../package-lock.json
20+
if [ -n "$(LD_RELEASE_DOCS_DIR)" ]; then cp -r build/html/* "$(LD_RELEASE_DOCS_DIR)"; fi
2021

2122
prepare:
2223
cp ../package.json before-typedoc-package.json

src/GoalManager.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ export default function GoalManager(clientVars, readyCallback) {
99

1010
const ret = {};
1111

12-
ret.goalKeyExists = key => {
13-
if (!goals) {
14-
return true;
15-
}
16-
for (let i = 0; i < goals.length; i++) {
17-
if (goals[i].kind === 'custom' && goals[i].key === key) {
18-
return true;
19-
}
20-
}
21-
return false;
22-
};
23-
2412
function getGoalsPath() {
2513
return '/sdk/goals/' + clientVars.getEnvironmentId();
2614
}

src/__tests__/LDClient-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sinon from 'sinon';
22

3-
import * as common from 'launchdarkly-js-sdk-common';
43
import * as LDClient from '../index';
54
import * as pkg from '../../package.json';
65

@@ -148,15 +147,16 @@ describe('LDClient', () => {
148147
expect(errorSpy).not.toHaveBeenCalled();
149148
});
150149

151-
it('should warn when tracking an unknown custom goal event', async () => {
150+
it('should not warn when tracking an unknown custom goal event', async () => {
152151
server.respondWith([200, { 'Content-Type': 'application/json' }, '[{"key": "known", "kind": "custom"}]']);
153152

154153
const client = LDClient.initialize(envName, user, { bootstrap: {}, sendEvents: false });
155154
await client.waitForInitialization();
156155
await client.waitUntilGoalsReady();
157156

158157
client.track('unknown');
159-
expect(warnSpy).toHaveBeenCalledWith('LD: [warn] ' + common.messages.unknownCustomEventKey('unknown'));
158+
expect(warnSpy).not.toHaveBeenCalled();
159+
expect(errorSpy).not.toHaveBeenCalled();
160160
});
161161
});
162162

src/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export function initialize(env, user, options = {}) {
2929
client.waitUntilGoalsReady = () => goalsPromise;
3030

3131
if (validatedOptions.fetchGoals) {
32-
const goalManager = GoalManager(clientVars, () => emitter.emit(goalsEvent));
33-
platform.customEventFilter = goalManager.goalKeyExists;
32+
GoalManager(clientVars, () => emitter.emit(goalsEvent));
33+
// Don't need to save a reference to the GoalManager - its constructor takes care of setting
34+
// up the necessary event wiring
3435
} else {
3536
emitter.emit(goalsEvent);
3637
}

0 commit comments

Comments
 (0)