Skip to content

Commit de7e992

Browse files
mikechu-optimizelyMike Chu
and
Mike Chu
authored
[FSSDK-9494] Update references to old sub modules js-sdk-* (#213)
* Upgrade to latest JS SDK version * Update refs to js-sdk-logging --------- Co-authored-by: Mike Chu <mike.chu@optimizely.com>
1 parent 434b4e5 commit de7e992

7 files changed

+44
-52
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"access": "public"
3535
},
3636
"dependencies": {
37-
"@optimizely/optimizely-sdk": "5.0.0-beta2",
37+
"@optimizely/optimizely-sdk": "^5.0.0-beta5",
3838
"hoist-non-react-statics": "^3.3.0",
3939
"prop-types": "^15.6.2",
4040
"utility-types": "^2.1.0 || ^3.0.0"

src/Provider.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Copyright 2022, Optimizely
2+
* Copyright 2022-2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,8 +15,9 @@
1515
*/
1616
import * as React from 'react';
1717
import { UserAttributes } from '@optimizely/optimizely-sdk';
18-
import { getLogger } from '@optimizely/js-sdk-logging';
18+
import { getLogger } from '@optimizely/optimizely-sdk';
1919

20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2021
import { OptimizelyContextProvider } from './Context';
2122
import { ReactSDKClient } from './client';
2223
import { areUsersEqual, UserInfo } from './utils';

src/autoUpdate.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Copyright 2020, Optimizely
2+
* Copyright 2020, 2023 Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,9 +14,8 @@
1414
* limitations under the License.
1515
*/
1616
import { enums } from '@optimizely/optimizely-sdk';
17-
import { LoggerFacade } from '@optimizely/js-sdk-logging';
18-
1917
import { ReactSDKClient } from './client';
18+
import { LoggerFacade } from '@optimizely/optimizely-sdk/dist/modules/logging';
2019

2120
interface AutoUpdate {
2221
(

src/hooks.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018-2019, 2022, Optimizely
2+
* Copyright 2018-2019, 2022-2023, Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,10 +14,9 @@
1414
* limitations under the License.
1515
*/
1616
import { useCallback, useContext, useEffect, useState, useRef } from 'react';
17-
1817
import { UserAttributes, OptimizelyDecideOption } from '@optimizely/optimizely-sdk';
19-
import { getLogger, LoggerFacade } from '@optimizely/js-sdk-logging';
20-
18+
import { getLogger } from '@optimizely/optimizely-sdk';
19+
import { LoggerFacade } from '@optimizely/optimizely-sdk/dist/modules/logging';
2120
import { setupAutoUpdateListeners } from './autoUpdate';
2221
import { ReactSDKClient, VariableValuesObject, OnReadyResult } from './client';
2322
import { notifier } from './notifier';

src/logOnlyEventDispatcher.spec.ts

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
jest.mock('@optimizely/js-sdk-logging', () => ({
1+
/**
2+
* Copyright 2023, Optimizely
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
jest.mock('@optimizely/optimizely-sdk', () => ({
218
getLogger: jest.fn().mockReturnValue({ debug: jest.fn() }),
319
}));
420

521
import logOnlyEventDispatcher from './logOnlyEventDispatcher';
6-
import * as logging from '@optimizely/js-sdk-logging';
22+
import { getLogger } from '@optimizely/optimizely-sdk';
723

8-
const logger = logging.getLogger('ReactSDK');
24+
const logger = getLogger('ReactSDK');
925

1026
describe('logOnlyEventDispatcher', () => {
1127
it('logs a message', () => {

src/logOnlyEventDispatcher.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/**
2-
* Copyright 2019, Optimizely
2+
* Copyright 2019, 2023 Optimizely
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,9 +15,9 @@
1515
*/
1616

1717
import * as optimizely from '@optimizely/optimizely-sdk';
18-
import * as logging from '@optimizely/js-sdk-logging';
18+
import { getLogger } from '@optimizely/optimizely-sdk';
1919

20-
const logger = logging.getLogger('ReactSDK');
20+
const logger = getLogger('ReactSDK');
2121

2222
/**
2323
* logOnlyEventDispatcher only logs a message at the debug level, and does not

yarn.lock

+10-33
Original file line numberDiff line numberDiff line change
@@ -535,38 +535,15 @@
535535
"@jridgewell/resolve-uri" "^3.0.3"
536536
"@jridgewell/sourcemap-codec" "^1.4.10"
537537

538-
"@optimizely/js-sdk-datafile-manager@^0.9.5":
539-
version "0.9.5"
540-
resolved "https://registry.yarnpkg.com/@optimizely/js-sdk-datafile-manager/-/js-sdk-datafile-manager-0.9.5.tgz#c1fa25a4bbdabe97929c72895ca2a48e28047a34"
541-
integrity sha512-O4ujr1nBBAQBtx8YoKNpzzaEZgsE+aU4dxubT17ePqv/YVUWE+JOY21tSRrqZy/BlbbyzL+ElT8hrGB5ZzVoIQ==
538+
"@optimizely/optimizely-sdk@^5.0.0-beta5":
539+
version "5.0.0-beta5"
540+
resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-5.0.0-beta5.tgz#67ac961be3d1269d2774ec758659d42a3e763e38"
541+
integrity sha512-xQ1Lv306d9xQoK/vr0o4Wpn53gJNVUeJVi8N90NinDYjtFPsXasdWEFNXNN+qH678VmdpBsPPKLg/5olLoFrKg==
542542
dependencies:
543-
"@optimizely/js-sdk-logging" "^0.3.1"
544-
"@optimizely/js-sdk-utils" "^0.4.0"
545-
decompress-response "^4.2.1"
546-
547-
"@optimizely/js-sdk-logging@^0.3.1":
548-
version "0.3.1"
549-
resolved "https://registry.yarnpkg.com/@optimizely/js-sdk-logging/-/js-sdk-logging-0.3.1.tgz#358b48f4ce2ce22b1969d9e3e929caac1e6e6351"
550-
integrity sha512-K71Jf283FP0E4oXehcXTTM3gvgHZHr7FUrIsw//0mdJlotHJT4Nss4hE0CWPbBxO7LJAtwNnO+VIA/YOcO4vHg==
551-
dependencies:
552-
"@optimizely/js-sdk-utils" "^0.4.0"
553-
554-
"@optimizely/js-sdk-utils@^0.4.0":
555-
version "0.4.0"
556-
resolved "https://registry.yarnpkg.com/@optimizely/js-sdk-utils/-/js-sdk-utils-0.4.0.tgz#835b88bc7b5365a5c4a3d073c01c3a55d9f93a8f"
557-
integrity sha512-QG2oytnITW+VKTJK+l0RxjaS5VrA6W+AZMzpeg4LCB4Rn4BEKtF+EcW/5S1fBDLAviGq/0TLpkjM3DlFkJ9/Gw==
558-
dependencies:
559-
uuid "^3.3.2"
560-
561-
"@optimizely/optimizely-sdk@5.0.0-beta2":
562-
version "5.0.0-beta2"
563-
resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-5.0.0-beta2.tgz#83eb7ea3fb94ad6e75263c1493f219d3cfff0595"
564-
integrity sha512-UnA5Nk1ZbmpsJoHt2uizJ+Rb0qx6Jrt2+g9rPguzbkr1HMFDiK1apod8+9NVzB98SroXSA+dHTlBc+OAVp7m4w==
565-
dependencies:
566-
"@optimizely/js-sdk-datafile-manager" "^0.9.5"
567543
decompress-response "^4.2.1"
568544
json-schema "^0.4.0"
569545
murmurhash "^2.0.1"
546+
ua-parser-js "^1.0.35"
570547
uuid "^8.3.2"
571548

572549
"@rollup/plugin-commonjs@^16.0.0":
@@ -4675,6 +4652,11 @@ typescript@^4.7.4:
46754652
resolved "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz"
46764653
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
46774654

4655+
ua-parser-js@^1.0.35:
4656+
version "1.0.36"
4657+
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.36.tgz#a9ab6b9bd3a8efb90bb0816674b412717b7c428c"
4658+
integrity sha512-znuyCIXzl8ciS3+y3fHJI/2OhQIXbXw9MWC/o3qwyR+RGppjZHrM27CGFSKCJXi2Kctiz537iOu2KnXs1lMQhw==
4659+
46784660
uglify-js@^3.4.9:
46794661
version "3.16.3"
46804662
resolved "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.3.tgz"
@@ -4743,11 +4725,6 @@ use@^3.1.0:
47434725
resolved "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz"
47444726
integrity sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==
47454727

4746-
uuid@^3.3.2:
4747-
version "3.4.0"
4748-
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
4749-
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
4750-
47514728
uuid@^8.3.0, uuid@^8.3.2:
47524729
version "8.3.2"
47534730
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"

0 commit comments

Comments
 (0)