8000 fix: Removed React Native client engine temporarily by zashraf1985 · Pull Request #466 · optimizely/javascript-sdk · GitHub
[go: up one dir, main page]

Skip to content

fix: Removed React Native client engine temporarily #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to o 8000 ur terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions packages/optimizely-sdk/lib/index.react_native.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var createInstance = function(config) {

config = fns.assign(
{
clientEngine: enums.REACT_NATIVE_JS_CLIENT_ENGINE,
clientEngine: enums.JAVASCRIPT_CLIENT_ENGINE,
eventBatchSize: DEFAULT_EVENT_BATCH_SIZE,
eventDispatcher: defaultEventDispatcher,
eventFlushInterval: DEFAULT_EVENT_FLUSH_INTERVAL,
Expand All @@ -91,11 +91,6 @@ var createInstance = function(config) {
}
);

// If client engine is react, convert it to react native
if (config.clientEngine === enums.REACT_CLIENT_ENGINE) {
config.clientEngine = enums.REACT_NATIVE_CLIENT_ENGINE
}

if (!eventProcessorConfigValidator.validateEventBatchSize(config.eventBatchSize)) {
logger.warn('Invalid eventBatchSize %s, defaulting to %s', config.eventBatchSize, DEFAULT_EVENT_BATCH_SIZE);
config.eventBatchSize = DEFAULT_EVENT_BATCH_SIZE;
Expand Down
8 changes: 4 additions & 4 deletions packages/optimizely-sdk/lib/index.react_native.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('javascript-sdk/react-native', function() {
assert.equal(optlyInstance.clientVersion, '4.0.0-rc.2');
});

it('should set the React Native JS client engine and javascript SDK version', function() {
it('should set the Javascript client engine and version', function() {
var optlyInstance = optimizelyFactory.createInstance({
datafile: {},
errorHandler: fakeErrorHandler,
Expand All @@ -101,11 +101,11 @@ describe('javascript-sdk/react-native', function() {
});
// Invalid datafile causes onReady Promise rejection - catch this error
optlyInstance.onReady().catch(function() {});
assert.equal('react-native-js-sdk', optlyInstance.clientEngine);
assert.equal('javascript-sdk', optlyInstance.clientEngine);
assert.equal(packageJSON.version, optlyInstance.clientVersion);
});

it('should allow passing of "react-sdk" as the clientEngine and convert it to "react-native-sdk"', function() {
it('should allow passing of "react-sdk" as the clientEngine', function() {
var optlyInstance = optimizelyFactory.createInstance({
clientEngine: 'react-sdk',
datafile: {},
Expand All @@ -115,7 +115,7 @@ describe('javascript-sdk/react-native', function() {
});
// Invalid datafile causes onReady Promise rejection - catch this error
optlyInstance.onReady().catch(function() {});
assert.equal('react-native-sdk', optlyInstance.clientEngine);
assert.equal('react-sdk', optlyInstance.clientEngine);
});

it('should activate with provided event dispatcher', function() {
Expand Down
6 changes: 0 additions & 6 deletions packages/optimizely-sdk/lib/utils/enums/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,12 @@ export var CONTROL_ATTRIBUTES = {
export var JAVASCRIPT_CLIENT_ENGINE = 'javascript-sdk';
export var NODE_CLIENT_ENGINE = 'node-sdk';
export var REACT_CLIENT_ENGINE = 'react-sdk';
export var REACT_NATIVE_CLIENT_ENGINE = 'react-native-sdk';
export var REACT_NATIVE_JS_CLIENT_ENGINE = 'react-native-js-sdk';
export var NODE_CLIENT_VERSION = '4.0.0-rc.2';

export var VALID_CLIENT_ENGINES = [
NODE_CLIENT_ENGINE,
REACT_CLIENT_ENGINE,
JAVASCRIPT_CLIENT_ENGINE,
REACT_NATIVE_CLIENT_ENGINE,
REACT_NATIVE_JS_CLIENT_ENGINE,
];

export var NOTIFICATION_TYPES = notificationTypesEnum;
Expand Down Expand Up @@ -233,8 +229,6 @@ export default {
JAVASCRIPT_CLIENT_ENGINE: JAVASCRIPT_CLIENT_ENGINE,
NODE_CLIENT_ENGINE: NODE_CLIENT_ENGINE,
REACT_CLIENT_ENGINE: REACT_CLIENT_ENGINE,
REACT_NATIVE_CLIENT_ENGINE: REACT_NATIVE_CLIENT_ENGINE,
REACT_NATIVE_JS_CLIENT_ENGINE: REACT_NATIVE_JS_CLIENT_ENGINE,
NODE_CLIENT_VERSION: NODE_CLIENT_VERSION,
VALID_CLIENT_ENGINES: VALID_CLIENT_ENGINES,
NOTIFICATION_TYPES: NOTIFICATION_TYPES,
Expand Down
0