Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add the root domain check method as a util method added for use mod… #6124
Add the root domain check method as a util method added for use mod… #6124
Changes from 2 commits
bebc77d
f32b599
0672f2b
18ebc36
47ec3b2
b0204b7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The plan for this function is to be used within pbjs? So, it won't be executed outside pbjs?
If that is the case then maybe we should not make this function accessible on
pbjs
namespace, but rather justexporting
the function and then just using it inside some module?If you decide to go that way (exporting instead of marking it available on
pbjs
) I suggest you move it inutils
package.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.
Good idea, I have done so
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.
Sorry for going back and forth, I didn't think this through, my bad. Now I see that
utils
may not be the best place to put this function.Now
utils
has dependency tostorageManager.js
, which should not happen.utils
should not depend onstorageManager
.Can you move this function to
userId/index.js
(again) and just leave it asexported
instead of attaching it onpbjs
namespace?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.
Hmm, yeah, I was on the fence about that so that's why I put it in the user module initially but now I'm not sure how my module will get access to it. The linter forbids me from importing directly from userId/index.js. Do you have any thoughts on that? What do you think about adding the root domain to the config object that gets passed into
getId
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.
Or maybe in userSync.js?
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.
I would choose
userSync.js
.@smenzer do you have any opinion on this one?
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.
I don't think we should add it to the config that gets passed to
getId
, because that is specifically the config for that module. we could add it as a new parameter, though. would need to get passed toextendId
as well.the only issue i have with moving it to
userSync.js
is that we aren't even using that module today within userId module, so seems odd to put it there just because it's somewhat related.since we can't use
utils
, which is where I would have expected to put this (but I understand the reason not to), and since putting it inuserId/index.js
won't work for using it within submodules...i think we're really left with two options:pbjs
namespaceif we pass the result of the function to all modules, then it means we're executing that code EVERY time, which isn't necessary since most modules aren't using it today. we could pass it as a function to be used if necessary, but not sure if that's a good idea or not. which leads us back to putting it in the
pbjs
namespace even though it may not be used outside ofpbjs
...not a real answer i know, but that's how i'm thinking about it. maybe we can get some other opinions in the slack group, too?
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.
Checking in to see if there is consensus on an approach that I should take, thanks!