Skip to content

Commit

Permalink
[FSSDK-11090] remove unused plugins directory (#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
raju-opti authored Jan 27, 2025
1 parent ba28ba6 commit 281930a
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 415 deletions.
6 changes: 1 addition & 5 deletions lib/core/decision_service/index.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import Optimizely from '../../optimizely';
import OptimizelyUserContext from '../../optimizely_user_context';
import projectConfig, { createProjectConfig } from '../../project_config/project_config';
import AudienceEvaluator from '../audience_evaluator';
import errorHandler from '../../plugins/error_handler';
import eventDispatcher from '../../event_processor/event_dispatcher/default_dispatcher.browser';
import * as jsonSchemaValidator from '../../utils/json_schema_validator';
import { getMockProjectConfigManager } from '../../tests/mock/mock_project_config_manager';
Expand Down Expand Up @@ -1053,17 +1052,14 @@ describe('lib/core/decision_service', function() {
isValidInstance: true,
logger: createdLogger,
eventProcessor: getForwardingEventProcessor(eventDispatcher),
notificationCenter: createNotificationCenter(createdLogger, errorHandler),
errorHandler: errorHandler,
notificationCenter: createNotificationCenter(createdLogger),
});

sinon.stub(eventDispatcher, 'dispatchEvent');
sinon.stub(errorHandler, 'handleError');
});

afterEach(function() {
eventDispatcher.dispatchEvent.restore();
errorHandler.handleError.restore();
});

var testUserAttributes = {
Expand Down
3 changes: 0 additions & 3 deletions lib/index.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import configValidator from './utils/config_validator';
import defaultErrorHandler from './plugins/error_handler';
import defaultEventDispatcher from './event_processor/event_dispatcher/default_dispatcher.browser';
import sendBeaconEventDispatcher from './event_processor/event_dispatcher/send_beacon_dispatcher.browser';
import * as enums from './utils/enums';
Expand Down Expand Up @@ -97,7 +96,6 @@ const __internalResetRetryState = function(): void {
};

export {
defaultErrorHandler as errorHandler,
defaultEventDispatcher as eventDispatcher,
sendBeaconEventDispatcher,
enums,
Expand All @@ -119,7 +117,6 @@ export * from './common_exports';

export default {
...commonExports,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
sendBeaconEventDispatcher,
enums,
Expand Down
3 changes: 0 additions & 3 deletions lib/index.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import Optimizely from './optimizely';
import * as enums from './utils/enums';
import configValidator from './utils/config_validator';
import defaultErrorHandler from './plugins/error_handler';
import defaultEventDispatcher from './event_processor/event_dispatcher/default_dispatcher.node';
import { createNotificationCenter } from './notification_center';
import { OptimizelyDecideOption, Client, Config } from './shared_types';
Expand Down Expand Up @@ -73,7 +72,6 @@ const createInstance = function(config: Config): Client | null {
* Entry point into the Optimizely Node testing SDK
*/
export {
defaultErrorHandler as errorHandler,
defaultEventDispatcher as eventDispatcher,
enums,
createInstance,
Expand All @@ -91,7 +89,6 @@ export * from './common_exports';

export default {
...commonExports,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
enums,
createInstance,
Expand Down
1 change: 0 additions & 1 deletion lib/index.react_native.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ describe('javascript-sdk/react-native', () => {

describe('APIs', () => {
it('should expose logger, errorHandler, eventDispatcher and enums', () => {
expect(optimizelyFactory.errorHandler).toBeDefined();
expect(optimizelyFactory.eventDispatcher).toBeDefined();
expect(optimizelyFactory.enums).toBeDefined();
});
Expand Down
3 changes: 0 additions & 3 deletions lib/index.react_native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import * as enums from './utils/enums';
import Optimizely from './optimizely';
import configValidator from './utils/config_validator';
import defaultErrorHandler from './plugins/error_handler';
import defaultEventDispatcher from './event_processor/event_dispatcher/default_dispatcher.browser';
import { createNotificationCenter } from './notification_center';
import { OptimizelyDecideOption, Client, Config } from './shared_types';
Expand Down Expand Up @@ -80,7 +79,6 @@ const createInstance = function(config: Config): Client | null {
* Entry point into the Optimizely Javascript SDK for React Native
*/
export {
defaultErrorHandler as errorHandler,
defaultEventDispatcher as eventDispatcher,
enums,
createInstance,
Expand All @@ -98,7 +96,6 @@ export * from './common_exports';

export default {
...commonExports,
errorHandler: defaultErrorHandler,
eventDispatcher: defaultEventDispatcher,
enums,
createInstance,
Expand Down
7 changes: 1 addition & 6 deletions lib/notification_center/index.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ import { assert } from 'chai';

import { createNotificationCenter } from './';
import * as enums from '../utils/enums';
import errorHandler from '../plugins/error_handler';
import { NOTIFICATION_TYPES } from './type';
import { create } from 'lodash';

var LOG_LEVEL = enums.LOG_LEVEL;

Expand All @@ -35,20 +33,17 @@ var createLogger = () => ({
describe('lib/core/notification_center', function() {
describe('APIs', function() {
var mockLogger = createLogger({ logLevel: LOG_LEVEL.INFO });
var mockErrorHandler = errorHandler.handleError;
var mockLoggerStub;
var mockErrorHandlerStub;

var notificationCenterInstance;
var sandbox;

beforeEach(function() {
sandbox = sinon.sandbox.create();
mockLoggerStub = sandbox.stub(mockLogger, 'log');
mockErrorHandlerStub = sandbox.stub(mockErrorHandler, 'handleError');

notificationCenterInstance = createNotificationCenter({
logger: mockLoggerStub,
errorHandler: mockErrorHandlerStub,
});
});

Expand Down
Loading

0 comments on commit 281930a

Please sign in to comment.