From c6f20e7da2daa3f1bed71f12f3b11a0352d6f6f9 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Tue, 19 Sep 2023 20:18:19 +0000 Subject: [PATCH 1/6] Quality of life updates picked from #210 --- .devcontainer/devcontainer.json | 45 +++++++++++++-------------------- .gitignore | 1 + .vscode/settings.json | 6 +++-- README.md | 40 ++++++++++++++++++++++++++++- package.json | 1 + 5 files changed, 62 insertions(+), 31 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index a1385fdf..18e4a6cf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,35 +1,24 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node { "name": "React SDK", - - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye", - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "npm install -g npm && yarn install", - - // Configure tool-specific properties. + "customizations": { - "vscode": { - "extensions": [ - "dbaeumer.vscode-eslint", - "eamodio.gitlens", - "esbenp.prettier-vscode", - "Gruntfuggly.todo-tree", - "github.vscode-github-actions", - "Orta.vscode-jest", - "ms-vscode.test-adapter-converter" - ] + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "esbenp.prettier-vscode", + "Gruntfuggly.todo-tree", + "github.vscode-github-actions", + "Orta.vscode-jest", + "ms-vscode.test-adapter-converter" + ], + "settings": { + "files.eol": "\n" } + } } - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} + } \ No newline at end of file diff --git a/.gitignore b/.gitignore index b2eac095..98ffa792 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ lib dist/ build/ .rpt2_cache +.env diff --git a/.vscode/settings.json b/.vscode/settings.json index 43248688..23c4b25b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,5 +3,7 @@ "onStartup": [ "all-tests" ] - }, -} \ No newline at end of file + }, + "jest.jestCommandLine": "./node_modules/.bin/jest", + "jest.autoRevealOutput": "on-exec-error" +} diff --git a/README.md b/README.md index 9b072593..5fabb233 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,44 @@ const WrappedMyComponent = withOptimizely(MyComp); **_Note:_** The `optimizely` client object provided via `withOptimizely` is automatically associated with the `user` prop passed to the ancestor `OptimizelyProvider` - the `id` and `attributes` from that `user` object will be automatically forwarded to all appropriate SDK method calls. So, there is no need to pass the `userId` or `attributes` arguments when calling methods of the `optimizely` client object, unless you wish to use _different_ `userId` or `attributes` than those given to `OptimizelyProvider`. +## `useContext` + +Any component under the `` can access the Optimizely `ReactSDKClient` via the `OptimizelyContext` with `useContext`. + +_arguments_ +- `OptimizelyContext : React.Context` The Optimizely context initialized in a parent component (or App). + +_returns_ +- Wrapped object: + - `optimizely : ReactSDKClient` The client object which was passed to the `OptimizelyProvider` + - `isServerSide : boolean` Value that was passed to the `OptimizelyProvider` + - `timeout : number | undefined` The timeout which was passed to the `OptimizelyProvider` + +### Example + +```jsx +import React, { useContext } from 'react'; +import { OptimizelyContext } from '@optimizely/react-sdk'; + +function MyComponent() { + const { optimizely, isServerSide, timeout } = useContext(OptimizelyContext); + const decision = optimizely.decide('my-feature'); + const onClick = () => { + optimizely.track('signup-clicked'); + // rest of your click handling code + }; + return ( + <> + { decision.enabled &&

My feature is enabled

} + { !decision.enabled &&

My feature is disabled

} + { decision.variationKey === 'control-variation' &&

Current Variation

} + { decision.variationKey === 'experimental-variation' &&

Better Variation

} + + + ); +} +``` + ### Tracking Use the `withOptimizely` HoC for tracking. @@ -521,4 +559,4 @@ First-party code subject to copyrights held by Optimizely, Inc. and its contribu - Ruby - https://github.com/optimizely/ruby-sdk -- Swift - https://github.com/optimizely/swift-sdk +- Swift - https://github.com/optimizely/swift-sdk \ No newline at end of file diff --git a/package.json b/package.json index 4c1ff386..9afe3b6a 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "2.9.2", "description": "React SDK for Optimizely Feature Experimentation, Optimizely Full Stack (legacy), and Optimizely Rollouts", "homepage": "https://github.com/optimizely/react-sdk", + "repository": "https://github.com/optimizely/react-sdk", "license": "Apache-2.0", "module": "dist/react-sdk.es.js", "types": "dist/index.d.ts", From 90cb2b196acf9d77aeec01f16891c132a1535634 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Tue, 19 Sep 2023 20:25:57 +0000 Subject: [PATCH 2/6] Add extra EOF lf --- .devcontainer/devcontainer.json | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 18e4a6cf..7af92ed6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,4 +21,5 @@ } } } - } \ No newline at end of file + } + \ No newline at end of file diff --git a/README.md b/README.md index 5fabb233..78f3f523 100644 --- a/README.md +++ b/README.md @@ -559,4 +559,4 @@ First-party code subject to copyrights held by Optimizely, Inc. and its contribu - Ruby - https://github.com/optimizely/ruby-sdk -- Swift - https://github.com/optimizely/swift-sdk \ No newline at end of file +- Swift - https://github.com/optimizely/swift-sdk From c4f9e9ee30e2ad4ec8b04e9ef83de839c5c27cb2 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 21 Sep 2023 12:31:44 +0000 Subject: [PATCH 3/6] Correct dep versions --- package.json | 2 +- yarn.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 9afe3b6a..525b8df2 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "access": "public" }, "dependencies": { - "@optimizely/optimizely-sdk": "^5.0.0-beta2", + "@optimizely/optimizely-sdk": "5.0.0-beta2", "hoist-non-react-statics": "^3.3.0", "prop-types": "^15.6.2", "utility-types": "^2.1.0 || ^3.0.0" diff --git a/yarn.lock b/yarn.lock index 1f7eaa37..19dc5c0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -546,22 +546,22 @@ "@optimizely/js-sdk-logging@^0.3.1": version "0.3.1" - resolved "https://registry.npmjs.org/@optimizely/js-sdk-logging/-/js-sdk-logging-0.3.1.tgz" + resolved "https://registry.yarnpkg.com/@optimizely/js-sdk-logging/-/js-sdk-logging-0.3.1.tgz#358b48f4ce2ce22b1969d9e3e929caac1e6e6351" integrity sha512-K71Jf283FP0E4oXehcXTTM3gvgHZHr7FUrIsw//0mdJlotHJT4Nss4hE0CWPbBxO7LJAtwNnO+VIA/YOcO4vHg== dependencies: "@optimizely/js-sdk-utils" "^0.4.0" "@optimizely/js-sdk-utils@^0.4.0": version "0.4.0" - resolved "https://registry.npmjs.org/@optimizely/js-sdk-utils/-/js-sdk-utils-0.4.0.tgz" + resolved "https://registry.yarnpkg.com/@optimizely/js-sdk-utils/-/js-sdk-utils-0.4.0.tgz#835b88bc7b5365a5c4a3d073c01c3a55d9f93a8f" integrity sha512-QG2oytnITW+VKTJK+l0RxjaS5VrA6W+AZMzpeg4LCB4Rn4BEKtF+EcW/5S1fBDLAviGq/0TLpkjM3DlFkJ9/Gw== dependencies: uuid "^3.3.2" -"@optimizely/optimizely-sdk@^5.0.0-beta": - version "5.0.0-beta" - resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-5.0.0-beta.tgz#3290713524707d6328ec2c00a4ec1490410d3bcd" - integrity sha512-WgiZDAJcdRyRPbJlZ96cuVVAF+6IuwK4hzGT6XBPdfRrBm6jLb9oQ3qUhGJMxNBoUFHlaNVnvm/T4lKS/gcy9Q== +"@optimizely/optimizely-sdk@5.0.0-beta2": + version "5.0.0-beta2" + resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-5.0.0-beta2.tgz#83eb7ea3fb94ad6e75263c1493f219d3cfff0595" + integrity sha512-UnA5Nk1ZbmpsJoHt2uizJ+Rb0qx6Jrt2+g9rPguzbkr1HMFDiK1apod8+9NVzB98SroXSA+dHTlBc+OAVp7m4w== dependencies: "@optimizely/js-sdk-datafile-manager" "^0.9.5" decompress-response "^4.2.1" @@ -4745,7 +4745,7 @@ use@^3.1.0: uuid@^3.3.2: version "3.4.0" - resolved "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== uuid@^8.3.0, uuid@^8.3.2: From 58e64871e08d517049853f5407290679279aa8f7 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 21 Sep 2023 12:38:01 +0000 Subject: [PATCH 4/6] Lint fixes --- .devcontainer/devcontainer.json | 45 ++++++++------- .vscode/settings.json | 12 ++-- scripts/build.js | 41 +++++++------- scripts/config.js | 47 ++++++++-------- scripts/winbuild.js | 97 +++++++++++++++++---------------- 5 files changed, 122 insertions(+), 120 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7af92ed6..80d0fa17 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,25 +1,24 @@ { - "name": "React SDK", - - "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye", - - "postCreateCommand": "npm install -g npm && yarn install", - - "customizations": { - "vscode": { - "extensions": [ - "dbaeumer.vscode-eslint", - "eamodio.gitlens", - "esbenp.prettier-vscode", - "Gruntfuggly.todo-tree", - "github.vscode-github-actions", - "Orta.vscode-jest", - "ms-vscode.test-adapter-converter" - ], - "settings": { - "files.eol": "\n" - } - } - } + "name": "React SDK", + + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-18-bullseye", + + "postCreateCommand": "npm install -g npm && yarn install", + + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "eamodio.gitlens", + "esbenp.prettier-vscode", + "Gruntfuggly.todo-tree", + "github.vscode-github-actions", + "Orta.vscode-jest", + "ms-vscode.test-adapter-converter" + ], + "settings": { + "files.eol": "\n" + } + } } - \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 23c4b25b..ac3a8856 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,7 @@ { - "jest.autoRun": { - "onStartup": [ - "all-tests" - ] - }, - "jest.jestCommandLine": "./node_modules/.bin/jest", - "jest.autoRevealOutput": "on-exec-error" + "jest.autoRun": { + "onStartup": ["all-tests"] + }, + "jest.jestCommandLine": "./node_modules/.bin/jest", + "jest.autoRevealOutput": "on-exec-error" } diff --git a/scripts/build.js b/scripts/build.js index b20a5aee..11e68596 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -1,11 +1,11 @@ /** - * Copyright 2019, Optimizely + * Copyright 2019, 2023 Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,34 +14,35 @@ * limitations under the License. */ -const fs = require("fs"); -const path = require("path"); -const execSync = require("child_process").execSync; +const path = require('path'); +const execSync = require('child_process').execSync; -process.chdir(path.resolve(__dirname, "..")); +process.chdir(path.resolve(__dirname, '..')); function exec(command, extraEnv) { return execSync(command, { - stdio: "inherit", - env: Object.assign({}, process.env, extraEnv) + stdio: 'inherit', + env: Object.assign({}, process.env, extraEnv), }); } const packageName = 'react-sdk'; -const umdName = 'optimizelyReactSdk' - -console.log("\nBuilding ES modules..."); +const umdName = 'optimizelyReactSdk'; +console.log('\nBuilding ES modules...'); exec(`./node_modules/.bin/rollup -c scripts/config.js -f es -o dist/${packageName}.es.js`); -console.log("\nBuilding CommonJS modules..."); - +console.log('\nBuilding CommonJS modules...'); exec(`./node_modules/.bin/rollup -c scripts/config.js -f cjs -o dist/${packageName}.js`); -console.log("\nBuilding UMD modules..."); - -exec(`./node_modules/.bin/rollup -c scripts/config.js -f umd -o dist/${packageName}.umd.js --name ${umdName}`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); - -console.log("\nBuilding SystemJS modules..."); - -exec(`./node_modules/.bin/rollup -c scripts/config.js -f system -o dist/${packageName}.system.js`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); +console.log('\nBuilding UMD modules...'); +exec(`./node_modules/.bin/rollup -c scripts/config.js -f umd -o dist/${packageName}.umd.js --name ${umdName}`, { + EXTERNALS: 'forBrowsers', + BUILD_ENV: 'production', +}); + +console.log('\nBuilding SystemJS modules...'); +exec(`./node_modules/.bin/rollup -c scripts/config.js -f system -o dist/${packageName}.system.js`, { + EXTERNALS: 'forBrowsers', + BUILD_ENV: 'production', +}); diff --git a/scripts/config.js b/scripts/config.js index c7b26b72..56ef5077 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -1,11 +1,11 @@ /** - * Copyright 2019, Optimizely + * Copyright 2019, 2023 Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,23 +14,22 @@ * limitations under the License. */ -const typescript = require('rollup-plugin-typescript2') -const commonjs = require('@rollup/plugin-commonjs') -const replace = require('@rollup/plugin-replace') -const { nodeResolve } = require('@rollup/plugin-node-resolve') -const { uglify } = require('rollup-plugin-uglify') +const typescript = require('rollup-plugin-typescript2'); +const commonjs = require('@rollup/plugin-commonjs'); +const replace = require('@rollup/plugin-replace'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const { uglify } = require('rollup-plugin-uglify'); -const packageDeps = require('../package.json').dependencies || {} -const packagePeers = require('../package.json').peerDependencies || {} +const packageDeps = require('../package.json').dependencies || {}; +const packagePeers = require('../package.json').peerDependencies || {}; function getExternals(externals) { let externalLibs; - if(externals === 'forBrowsers') { - externalLibs = ['react'] + if (externals === 'forBrowsers') { + externalLibs = ['react']; } else { - externalLibs = (externals === 'peers') - ? Object.keys(packagePeers) - : Object.keys(packageDeps).concat(Object.keys(packagePeers)) + externalLibs = + externals === 'peers' ? Object.keys(packagePeers) : Object.keys(packageDeps).concat(Object.keys(packagePeers)); } externalLibs.push('crypto'); return externalLibs; @@ -40,28 +39,28 @@ function getPlugins(env, externals) { const plugins = [ nodeResolve({ browser: externals === 'forBrowsers', - preferBuiltins: externals !== 'forBrowsers' + preferBuiltins: externals !== 'forBrowsers', }), commonjs({ include: /node_modules/, }), - ] + ]; if (env) { plugins.push( replace({ 'process.env.NODE_ENV': JSON.stringify(env), - }), - ) + }) + ); } - plugins.push(typescript()) + plugins.push(typescript()); if (env === 'production') { - plugins.push(uglify()) + plugins.push(uglify()); } - return plugins + return plugins; } const config = { @@ -69,11 +68,11 @@ const config = { output: { globals: { react: 'React', - crypto: 'crypto' + crypto: 'crypto', }, }, external: getExternals(process.env.EXTERNALS), plugins: getPlugins(process.env.BUILD_ENV, process.env.EXTERNALS), -} +}; -module.exports = config +module.exports = config; diff --git a/scripts/winbuild.js b/scripts/winbuild.js index 37fcd26b..25bbdd8d 100644 --- a/scripts/winbuild.js +++ b/scripts/winbuild.js @@ -1,46 +1,51 @@ -/** - * Copyright 2023, Optimizely - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const fs = require("fs"); -const path = require("path"); -const execSync = require("child_process").execSync; - -process.chdir(path.resolve(__dirname, "..")); - -function exec(command, extraEnv) { - return execSync(command, { - stdio: "inherit", - env: Object.assign({}, process.env, extraEnv) - }); -} - -const packageName = 'react-sdk'; -const umdName = 'optimizelyReactSdk' - -console.log("\nBuilding ES modules..."); -exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f es -o dist\\${packageName}.es.js`); - -console.log("\nBuilding CommonJS modules..."); - -exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f cjs -o dist\\${packageName}.js`); - -console.log("\nBuilding UMD modules..."); - -exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f umd -o dist\\${packageName}.umd.js --name ${umdName}`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); - -console.log("\nBuilding SystemJS modules..."); - -exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f system -o dist\\${packageName}.system.js`, {EXTERNALS: 'forBrowsers', BUILD_ENV: 'production' }); +/** + * Copyright 2023, Optimizely + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const path = require('path'); +const execSync = require('child_process').execSync; + +process.chdir(path.resolve(__dirname, '..')); + +function exec(command, extraEnv) { + return execSync(command, { + stdio: 'inherit', + env: Object.assign({}, process.env, extraEnv), + }); +} + +const packageName = 'react-sdk'; +const umdName = 'optimizelyReactSdk'; + +console.log('\nBuilding ES modules...'); +exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f es -o dist\\${packageName}.es.js`); + +console.log('\nBuilding CommonJS modules...'); + +exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f cjs -o dist\\${packageName}.js`); + +console.log('\nBuilding UMD modules...'); + +exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f umd -o dist\\${packageName}.umd.js --name ${umdName}`, { + EXTERNALS: 'forBrowsers', + BUILD_ENV: 'production', +}); + +console.log('\nBuilding SystemJS modules...'); + +exec(`.\\node_modules\\.bin\\rollup -c scripts\\config.js -f system -o dist\\${packageName}.system.js`, { + EXTERNALS: 'forBrowsers', + BUILD_ENV: 'production', +}); From 287ffd1b8cd5aa2c365b816abf553fe84648852c Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 21 Sep 2023 12:45:00 +0000 Subject: [PATCH 5/6] Upgrade tough-cookie for CVE fix --- package.json | 1 + yarn.lock | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/package.json b/package.json index 525b8df2..9e642fa6 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "@optimizely/optimizely-sdk": "5.0.0-beta2", "hoist-non-react-statics": "^3.3.0", "prop-types": "^15.6.2", + "tough-cookie": "4.1.3", "utility-types": "^2.1.0 || ^3.0.0" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 19dc5c0e..42607051 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3853,6 +3853,11 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + react-dom@^18.2.0: version "18.2.0" resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz" @@ -3962,6 +3967,11 @@ require-main-filename@^2.0.0: resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" @@ -4581,6 +4591,16 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" +tough-cookie@4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz" @@ -4705,6 +4725,11 @@ universalify@^0.1.0, universalify@^0.1.2: resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + unset-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" @@ -4733,6 +4758,14 @@ urix@^0.1.0: resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + use@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz" From 4192e5214b37e953ad83ff8e4cf4b9867e7c0858 Mon Sep 17 00:00:00 2001 From: Mike Chu Date: Thu, 21 Sep 2023 13:37:01 +0000 Subject: [PATCH 6/6] Remove direct dep tough-cookie@4.1.3 --- package.json | 1 - yarn.lock | 33 --------------------------------- 2 files changed, 34 deletions(-) diff --git a/package.json b/package.json index 9e642fa6..525b8df2 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "@optimizely/optimizely-sdk": "5.0.0-beta2", "hoist-non-react-statics": "^3.3.0", "prop-types": "^15.6.2", - "tough-cookie": "4.1.3", "utility-types": "^2.1.0 || ^3.0.0" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index 42607051..19dc5c0e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3853,11 +3853,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -querystringify@^2.1.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" - integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== - react-dom@^18.2.0: version "18.2.0" resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz" @@ -3967,11 +3962,6 @@ require-main-filename@^2.0.0: resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz" integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== - resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz" @@ -4591,16 +4581,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -tough-cookie@4.1.3: - version "4.1.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" - integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== - dependencies: - psl "^1.1.33" - punycode "^2.1.1" - universalify "^0.2.0" - url-parse "^1.5.3" - tough-cookie@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz" @@ -4725,11 +4705,6 @@ universalify@^0.1.0, universalify@^0.1.2: resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -universalify@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" - integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== - unset-value@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz" @@ -4758,14 +4733,6 @@ urix@^0.1.0: resolved "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz" integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== -url-parse@^1.5.3: - version "1.5.10" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" - integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - use@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/use/-/use-3.1.1.tgz"