Skip to content

Commit

Permalink
Revert "Enable bundle Id in Expo (#335)" (#337)
Browse files Browse the repository at this point in the history
This reverts commit d6d9987.
  • Loading branch information
Ethella authored Jul 27, 2022
1 parent 8c2442a commit c35aa1d
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 86 deletions.
1 change: 0 additions & 1 deletion packages/@magic-sdk/provider/src/core/sdk-environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export interface SDKEnvironment {
defaultEndpoint: string;
ViewController: ConstructorOf<ViewController>;
configureStorage: () => Promise<typeof localForage>;
bundleId?: string | null;
}

export const SDKEnvironment: SDKEnvironment = {} as any;
Expand Down
1 change: 0 additions & 1 deletion packages/@magic-sdk/provider/src/core/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ export class SDKBase {
version,
ext: isEmpty(extConfig) ? undefined : extConfig,
locale: options?.locale || 'en_US',
...(SDKEnvironment.bundleId ? { bundleId: SDKEnvironment.bundleId } : {}),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,36 +281,3 @@ test('Does not warn upon construction of `MagicSDK` instance if `endpoint` param
new Ctor(TEST_API_KEY);
expect(consoleWarnStub).not.toBeCalled();
});

test('Initialize `Magic RN SDK`', () => {
const bundleIdMock = 'link.magic.test';
const Ctor = createMagicSDKCtor({
sdkName: '@magic-sdk/react-native',
platform: 'react-native',
bundleId: bundleIdMock,
});
const magic = new Ctor(TEST_API_KEY);

expect(magic.apiKey).toBe(TEST_API_KEY);

expect(magic.endpoint).toBe(MAGIC_RELAYER_FULL_URL);

assertEncodedQueryParams(magic.parameters, { bundleId: bundleIdMock, sdk: 'magic-sdk-rn' });
assertModuleInstanceTypes(magic);
});

test('Initialize `Magic RN SDK without bundleId`', () => {
const Ctor = createMagicSDKCtor({
sdkName: '@magic-sdk/react-native',
platform: 'react-native',
bundleId: null,
});
const magic = new Ctor(TEST_API_KEY);

expect(magic.apiKey).toBe(TEST_API_KEY);

expect(magic.endpoint).toBe(MAGIC_RELAYER_FULL_URL);

assertEncodedQueryParams(magic.parameters, { sdk: 'magic-sdk-rn' });
assertModuleInstanceTypes(magic);
});
17 changes: 1 addition & 16 deletions packages/@magic-sdk/react-native/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,7 @@ const config: Config.InitialOptions = {
'^.+\\.(js|jsx)$': 'babel-jest',
'\\.(ts|tsx)$': 'ts-jest',
},
transformIgnorePatterns: [
"node_modules/(" +
"?!(jest-)?react-native" +
"|react-clone-referenced-element" +
"|@react-native-community" +
"|expo(nent)?" +
"|@expo(nent)?/.*" +
"|react-navigation" +
"|@react-navigation/.*" +
"|@unimodules/.*" +
"|unimodules" +
"|sentry-expo" +
"|native-base" +
"|@sentry/.*" +
"|native-base-*)"
],
transformIgnorePatterns: ['node_modules/(?!react-native|react-native-webview)'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};

Expand Down
3 changes: 0 additions & 3 deletions packages/@magic-sdk/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@react-native-async-storage/async-storage": "^1.15.5",
"@types/lodash": "^4.14.158",
"buffer": "~5.6.0",
"expo-application": "^4.1.0",
"localforage": "^1.7.4",
"localforage-driver-memory": "^1.0.5",
"lodash": "^4.17.19",
Expand All @@ -36,14 +35,12 @@
"@babel/core": "^7.15.0",
"@babel/plugin-transform-flow-strip-types": "^7.14.5",
"@babel/runtime": "~7.10.4",
"expo-modules-core": "0.9.2",
"metro-react-native-babel-preset": "^0.66.2",
"react": "^16.13.1",
"react-native": "^0.62.2",
"react-native-webview": "8.1.2"
},
"peerDependencies": {
"expo": "*",
"react": ">=16",
"react-native": ">=0.60",
"react-native-webview": ">=8"
Expand Down
2 changes: 0 additions & 2 deletions packages/@magic-sdk/react-native/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import localForage from 'localforage';
import { URL as URLPolyfill, URLSearchParams as URLSearchParamsPolyfill } from 'whatwg-url';
import { Buffer } from 'buffer';
import * as _ from 'lodash';
import * as Application from 'expo-application';
import { driverWithoutSerialization } from '@aveq-research/localforage-asyncstorage-driver';
import * as memoryDriver from 'localforage-driver-memory';
import { ReactNativeWebViewController } from './react-native-webview-controller';
Expand Down Expand Up @@ -48,7 +47,6 @@ export const Magic = createSDK(SDKBaseReactNative, {
platform: 'react-native',
sdkName: '@magic-sdk/react-native',
version: process.env.REACT_NATIVE_VERSION!,
bundleId: Application.applicationId,
defaultEndpoint: 'https://box.magic.link/',
ViewController: ReactNativeWebViewController,
configureStorage: /* istanbul ignore next */ async () => {
Expand Down
1 change: 0 additions & 1 deletion packages/@magic-sdk/types/src/core/query-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ export interface QueryParameters {
version?: string;
ext?: any;
locale?: string;
bundleId?: string;
}
29 changes: 0 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3369,8 +3369,6 @@ __metadata:
"@react-native-async-storage/async-storage": ^1.15.5
"@types/lodash": ^4.14.158
buffer: ~5.6.0
expo-application: ^4.1.0
expo-modules-core: 0.9.2
localforage: ^1.7.4
localforage-driver-memory: ^1.0.5
lodash: ^4.17.19
Expand All @@ -3382,7 +3380,6 @@ __metadata:
tslib: ^2.0.3
whatwg-url: ~8.1.0
peerDependencies:
expo: "*"
react: ">=16"
react-native: ">=0.60"
react-native-webview: ">=8"
Expand Down Expand Up @@ -6572,13 +6569,6 @@ __metadata:
languageName: node
linkType: hard

"compare-versions@npm:^3.4.0":
version: 3.6.0
resolution: "compare-versions@npm:3.6.0"
checksum: 7492a50cdaa2c27f5254eee7c4b38856e1c164991bab3d98d7fd067fe4b570d47123ecb92523b78338be86aa221668fd3868bfe8caa5587dc3ebbe1a03d52b5d
languageName: node
linkType: hard

"component-emitter@npm:^1.2.1":
version: 1.3.0
resolution: "component-emitter@npm:1.3.0"
Expand Down Expand Up @@ -8660,25 +8650,6 @@ __metadata:
languageName: node
linkType: hard

"expo-application@npm:^4.1.0":
version: 4.2.2
resolution: "expo-application@npm:4.2.2"
peerDependencies:
expo: "*"
checksum: c6088014fb0c89f8c04633c50fed4515c5ec67b582b9660824cbd9b30de849b0be0ac8a858d49b63da73b6bb2171d29048321f25d8bbc89effbe31717eb8ee99
languageName: node
linkType: hard

"expo-modules-core@npm:0.9.2":
version: 0.9.2
resolution: "expo-modules-core@npm:0.9.2"
dependencies:
compare-versions: ^3.4.0
invariant: ^2.2.4
checksum: cc7a5efa50cdd193f3240c824276eae2aad4bbae256607529df6f039c9db3cea5bd898002096fb152026abeca33fc46755d3ea68644c7b25dfdb913d9cef383e
languageName: node
linkType: hard

"expo-web-browser@npm:^8.3.1":
version: 8.6.0
resolution: "expo-web-browser@npm:8.6.0"
Expand Down

0 comments on commit c35aa1d

Please sign in to comment.