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

feat 4571 Replace all Meteor.userId() with util function #4582

Merged
merged 10 commits into from
Aug 27, 2018

Conversation

impactmass
Copy link
Contributor

@impactmass impactmass commented Aug 27, 2018

Resolves #4571
Impact: minor
Type: chore

Issue

Goal: As a first step towards being able to replace Meteor's Accounts package, we want to wrap all existing calls to Meteor.userId in a function. Thus establishing an 'API' to retrieve logged in user ID that can be customized in the future.

Work

  • Added of a getUserId() function on the client and server exports of Reaction namespace. It returns the value of Meteor.userId().

  • Replaces all usage of Meteor.userId() with Reaction.getUserId()

  • Marked existing reaction/getUserId method as deprecated. Reaction.getUserId should be used instead

  • Extras

    • Removes an old getGuestLoginState function that was marked for removal in release 1.5.6. It was removed here as it uses the Meteor.userId method we're moving from.

Breaking changes

Core functionality of the app is untouched, but here's a potentially breaking update:

  • Removal of the deprecated getGuestLoginState. This is/was an internal function, but in case anyone has plugin(s) using it, please update. This logic in this function can be recreated with the Roles package if needed.

A note to Plugin maintainers:

  • With this update, take note that you should start moving away from calling Meteor.userId directly in your code. getUserId() should be used instead. Although this is not a breaking change as your existing plugins with Meteor.userId() will still work, this marks Reaction's initial set of steps to move away from Meteor accounts system. In coming releases, the internal setup of getUserId() will change. When that happens it will be listed as a breaking change for you to take note.

Testing

  • This does not add any specific feature, so the test here is to confirm that the app still works as usual, no regression!

@impactmass impactmass changed the title WIP - Feat 4571 impactmass user WIP - feat 4571 Replace all Meteor.userId() with util function Aug 27, 2018
@impactmass impactmass requested a review from nnnnat August 27, 2018 15:21
@impactmass impactmass changed the title WIP - feat 4571 Replace all Meteor.userId() with util function feat 4571 Replace all Meteor.userId() with util function Aug 27, 2018
@nnnnat nnnnat added this to the Little Bear milestone Aug 27, 2018
Copy link
Contributor

@nnnnat nnnnat left a comment

Choose a reason for hiding this comment

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

👍 Looks good!

@nnnnat nnnnat merged commit a1e7e72 into release-1.16.0 Aug 27, 2018
@nnnnat nnnnat deleted the feat-4571-impactmass-userId branch August 27, 2018 18:37
@spencern spencern mentioned this pull request Sep 5, 2018
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.

None yet

2 participants