-
Notifications
You must be signed in to change notification settings - Fork 265
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
chore: use server bundle for react native #363
Conversation
@@ -13,8 +13,10 @@ | |||
var AuthSdkError = require('./errors/AuthSdkError'); | |||
var tx = require('./tx'); | |||
var util = require('./util'); | |||
var SDK_VERSION = require('../package.json').version; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}`); |
There was a problem hiding this comment.
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)
7c7a179
to
68bbf34
Compare
f483cf7
to
dc3ccc0
Compare
Expose server bundle for React Native platform as an Authentication SDK.