From b9e0b30685908927e930a248d058358c9341d1d8 Mon Sep 17 00:00:00 2001 From: Matt Carroll Date: Thu, 30 Apr 2020 15:19:35 -0700 Subject: [PATCH] chore: Prepare for 2.0.0 release (#48) Prepare for 2.0.0 release --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ package.json | 4 ++-- src/client.spec.ts | 2 +- src/client.ts | 2 +- yarn.lock | 8 ++++---- 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4edff71..1cc53ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [2.0.0] - April 30th, 2020 + +Upgrade `@optimizely/optimizely-sdk` to 4.0.0. See [@optimizely/optimizely-sdk Release 4.0.0](https://github.com/optimizely/javascript-sdk/releases/tag/v4.0.0) for more details. + +### Breaking Changes + +- Changed supported React version to 16.8+ + +- @optimizely/optimizely-sdk no longer adds `Promise` polyfill in its browser entry point + +- Dropped support for Node.js version <8 + +### New Features + +- Refactored `` to a functional component that uses the `useFeature` hook under the hood. See [#32](https://github.com/optimizely/react-sdk/pull/32) for more details. + +- Refactored `` to a functional component that uses the `useExperiment` hook under the hood. See [#36](https://github.com/optimizely/react-sdk/pull/36) for more details. + +- Added `useExperiment` hook + + - Can be used to retrieve the variation for an experiment. See [#36](https://github.com/optimizely/react-sdk/pull/36) for more details. + +- Added `useFeature` hook + - Can be used to retrieve the status of a feature flag and its variables. See [#28](https://github.com/optimizely/react-sdk/pull/28) for more details. + +- Removed lodash dependency + +### Enhancements + +- Exposed the entire context object used by ``. + - Enables support for using APIs which require passing reference to a context object, like `useContext`. [#27](https://github.com/optimizely/react-sdk/pull/27) for more details. + + ## [2.0.0-rc.2] - April 24th, 2020 ### Bug Fixes diff --git a/package.json b/package.json index 50f36794..6c2c35c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@optimizely/react-sdk", - "version": "2.0.0-rc.2", + "version": "2.0.0", "description": "React SDK for Optimizely Full Stack and Optimizely Rollouts", "homepage": "https://github.com/optimizely/react-sdk", "license": "Apache-2.0", @@ -29,7 +29,7 @@ }, "dependencies": { "@optimizely/js-sdk-logging": "^0.1.0", - "@optimizely/optimizely-sdk": "4.0.0-rc.2", + "@optimizely/optimizely-sdk": "4.0.0", "hoist-non-react-statics": "^3.3.0", "prop-types": "^15.6.2", "utility-types": "^2.1.0" diff --git a/src/client.spec.ts b/src/client.spec.ts index ea0ad05e..371bda51 100644 --- a/src/client.spec.ts +++ b/src/client.spec.ts @@ -86,7 +86,7 @@ describe('ReactSDKClient', () => { expect(createInstanceSpy).toBeCalledWith({ ...config, clientEngine: 'react-sdk', - clientVersion: '2.0.0-rc.2', + clientVersion: '2.0.0', }); }); diff --git a/src/client.ts b/src/client.ts index a4198e69..16831c54 100644 --- a/src/client.ts +++ b/src/client.ts @@ -34,7 +34,7 @@ export type OnReadyResult = { }; const REACT_SDK_CLIENT_ENGINE = 'react-sdk'; -const REACT_SDK_CLIENT_VERSION = '2.0.0-rc.2'; +const REACT_SDK_CLIENT_VERSION = '2.0.0'; export interface ReactSDKClient extends optimizely.Client { user: UserContext; diff --git a/yarn.lock b/yarn.lock index 6a9d9ff1..a57d38df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -64,10 +64,10 @@ dependencies: uuid "^3.3.2" -"@optimizely/optimizely-sdk@4.0.0-rc.2": - version "4.0.0-rc.2" - resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-4.0.0-rc.2.tgz#e6b6580f09f05eb1356f9986dc5f503b4f5ef45a" - integrity sha512-5sYzg3lB3URK4szRapBOqsrNsyrss3UXoTDhocYMiUrp6Yc3Lst5TcNhy2nlc8jhIUoGSDvcvsOrSm/T6xr9BQ== +"@optimizely/optimizely-sdk@4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@optimizely/optimizely-sdk/-/optimizely-sdk-4.0.0.tgz#0e63fb3fdd70e95481029025b2c633e9bd93f88d" + integrity sha512-ufwndTjg6wPXnJmbW/3SK2F3Dt7E1S1VQZ5oCoYrsLZ2oFrhES/urbWWTzC1t83gAokbqzSEZDuc/OBdZ6c9SA== dependencies: "@optimizely/js-sdk-datafile-manager" "^0.5.0" "@optimizely/js-sdk-event-processor" "^0.4.0"