launchdarkly-js-sdk-common 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.yaml +0 -1
- package/CHANGELOG.md +4 -0
- package/docs/typedoc.js +1 -1
- package/jest.config.js +0 -3
- package/package.json +1 -3
- package/src/__tests__/.eslintrc.yaml +0 -1
- package/src/__tests__/LDClient-test.js +0 -8
- package/src/__tests__/utils-test.js +2 -2
- package/src/index.js +0 -3
- package/src/utils.js +1 -1
- package/test-types.ts +0 -2
- package/typings.d.ts +0 -6
package/.eslintrc.yaml
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the `launchdarkly-js-sdk-common` package will be documented in this file. Changes that affect the dependent SDKs such as `launchdarkly-js-client-sdk` should also be logged in those projects, in the next release that uses the updated version of this package. This project adheres to [Semantic Versioning](http://semver.org).
|
|
4
4
|
|
|
5
|
+
## [4.0.2] - 2022-01-25
|
|
6
|
+
### Removed:
|
|
7
|
+
- Removed the `version` export which was originally a constant inserted by the Rollup build, but was no longer usable since Rollup is no longer being used. The SDKs never used this export, since they have `version` properties of their own; the version string of `launchdarkly-js-sdk-common` was never meant to be exposed to applications.
|
|
8
|
+
|
|
5
9
|
## [4.0.1] - 2022-01-21
|
|
6
10
|
### Changed:
|
|
7
11
|
- This package is now published as a regular Node module. Previously, it was published as minified bundles created by Rollup. There was no need for this since Rollup is only needed for web code, and the `js-client-sdk` build already runs Rollup to embed the `js-sdk-common` code. Using Rollup caused the platform-dependent behavior of `uuid` to fail because the code for only one platform (browser or Node) was embedded.
|
package/docs/typedoc.js
CHANGED
|
@@ -4,7 +4,7 @@ module.exports = {
|
|
|
4
4
|
'**/node_modules/**',
|
|
5
5
|
'test-types.ts'
|
|
6
6
|
],
|
|
7
|
-
name: "LaunchDarkly Javascript SDK Core Components (4.0.
|
|
7
|
+
name: "LaunchDarkly Javascript SDK Core Components (4.0.2)",
|
|
8
8
|
readme: 'none', // don't add a home page with a copy of README.md
|
|
9
9
|
entryPoints: "/tmp/project-releaser/project/typings.d.ts",
|
|
10
10
|
entryPointStrategy: "expand"
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "launchdarkly-js-sdk-common",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "LaunchDarkly SDK for JavaScript - common code",
|
|
5
5
|
"author": "LaunchDarkly <team@launchdarkly.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,8 +40,6 @@
|
|
|
40
40
|
"launchdarkly-js-test-helpers": "1.1.0",
|
|
41
41
|
"prettier": "1.11.1",
|
|
42
42
|
"readline-sync": "^1.4.9",
|
|
43
|
-
"semver": "^5.5.0",
|
|
44
|
-
"semver-compare": "^1.0.0",
|
|
45
43
|
"typescript": "~4.4.4"
|
|
46
44
|
},
|
|
47
45
|
"dependencies": {
|
|
@@ -2,7 +2,6 @@ import * as LDClient from '../index';
|
|
|
2
2
|
import * as messages from '../messages';
|
|
3
3
|
import * as utils from '../utils';
|
|
4
4
|
|
|
5
|
-
import semverCompare from 'semver-compare';
|
|
6
5
|
import { eventSink, promisifySingle, sleepAsync, withCloseable, AsyncQueue } from 'launchdarkly-js-test-helpers';
|
|
7
6
|
|
|
8
7
|
import { respond, respondJson } from './mockHttp';
|
|
@@ -106,13 +105,6 @@ describe('LDClient', () => {
|
|
|
106
105
|
});
|
|
107
106
|
});
|
|
108
107
|
|
|
109
|
-
it('should contain package version', () => {
|
|
110
|
-
const version = LDClient.version;
|
|
111
|
-
// All client bundles above 1.0.7 should contain package version
|
|
112
|
-
const result = semverCompare(version, '1.0.6');
|
|
113
|
-
expect(result).toEqual(1);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
108
|
async function verifyCustomHeader(sendLDHeaders, shouldGetHeaders) {
|
|
117
109
|
await withServers(async (baseConfig, pollServer) => {
|
|
118
110
|
await withClient(user, { ...baseConfig, sendLDHeaders }, async client => {
|
|
@@ -120,11 +120,11 @@ describe('utils', () => {
|
|
|
120
120
|
});
|
|
121
121
|
|
|
122
122
|
describe('getLDUserAgentString', () => {
|
|
123
|
-
it('uses platform user-agent and
|
|
123
|
+
it('uses platform user-agent and unknown version by default', () => {
|
|
124
124
|
const platform = stubPlatform.defaults();
|
|
125
125
|
platform.version = undefined;
|
|
126
126
|
const ua = getLDUserAgentString(platform);
|
|
127
|
-
expect(ua).toEqual('stubClient
|
|
127
|
+
expect(ua).toEqual('stubClient/?');
|
|
128
128
|
});
|
|
129
129
|
|
|
130
130
|
it('uses platform user-agent and platform version if provided', () => {
|
package/src/index.js
CHANGED
|
@@ -760,13 +760,10 @@ function initialize(env, user, specifiedOptions, platform, extraOptionDefs) {
|
|
|
760
760
|
};
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
-
const version = VERSION;
|
|
764
|
-
|
|
765
763
|
module.exports = {
|
|
766
764
|
initialize,
|
|
767
765
|
commonBasicLogger,
|
|
768
766
|
errors,
|
|
769
767
|
messages,
|
|
770
768
|
utils,
|
|
771
|
-
version,
|
|
772
769
|
};
|
package/src/utils.js
CHANGED
|
@@ -146,7 +146,7 @@ function chunkUserEventsForUrl(maxLength, events) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
function getLDUserAgentString(platform) {
|
|
149
|
-
const version = platform.version ||
|
|
149
|
+
const version = platform.version || '?';
|
|
150
150
|
return platform.userAgent + '/' + version;
|
|
151
151
|
}
|
|
152
152
|
|
package/test-types.ts
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as ld from 'launchdarkly-js-sdk-common';
|
|
6
6
|
|
|
7
|
-
var ver: string = ld.version;
|
|
8
|
-
|
|
9
7
|
var userWithKeyOnly: ld.LDUser = { key: 'user' };
|
|
10
8
|
var anonUserWithNoKey: ld.LDUser = { anonymous: true };
|
|
11
9
|
var anonUserWithKey: ld.LDUser = { key: 'anon-user', anonymous: true };
|
package/typings.d.ts
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
* Basic LaunchDarkly JavaScript client interfaces, shared between the browser SDK and the Electron SDK.
|
|
3
3
|
*/
|
|
4
4
|
declare module 'launchdarkly-js-sdk-common' {
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* The current version string of the SDK.
|
|
8
|
-
*/
|
|
9
|
-
export const version: string;
|
|
10
|
-
|
|
11
5
|
/**
|
|
12
6
|
* The types of values a feature flag can have.
|
|
13
7
|
*
|