Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use server bundle for react native #363

Merged
merged 5 commits into from
Apr 20, 2020

Conversation

shuowu-okta
Copy link
Contributor

Expose server bundle for React Native platform as an Authentication SDK.

@@ -13,8 +13,10 @@
var AuthSdkError = require('./errors/AuthSdkError');
var tx = require('./tx');
var util = require('./util');
var SDK_VERSION = require('../package.json').version;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we require package.json during webpack we will end up with a lot of information in our webpack bundle which we don't want there. We should only require package.json if we are sure we are running server side. This file (builderUtil) is used by both webpack and server side code paths. Within webpack we have it set as a global variable. The node-side serverIndex could do something similar, read from package json and set as global variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, then I can pass SDK_VERSION as an argument in getUserAgent.

}

if (userAgent.template) {
return userAgent.template.replace('$OKTA_AUTH_JS', `okta-auth-js/${SDK_VERSION}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here there is a forward slash separating okta-auth-js from SDK_VERSION but the default implementation (server.js, line 32 has no slash)

@shuowu-okta shuowu-okta force-pushed the sw-set-server-bundle-for-react-native-OKTA-289380 branch from f483cf7 to dc3ccc0 Compare April 20, 2020 17:52
@shuowu-okta shuowu-okta merged commit a4a299c into master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants