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

Accounts-facebook reorganize #7728

Merged
merged 18 commits into from Nov 8, 2016

Conversation

Projects
None yet
5 participants
@laosb
Collaborator

laosb commented Aug 29, 2016

#7715

This PR should fix the facebook one. I'm not familiar with the version number based on releases, so the versioning may break though.

@stubailo

This comment has been minimized.

Contributor

stubailo commented Aug 29, 2016

This looks pretty good to me! Waiting on @tmeasday to review and confirm.

@laosb

This comment has been minimized.

Collaborator

laosb commented Aug 29, 2016

Note that version numbers was bumped (minor) but I don't know what to do to keep them works together; it might broken. Guessing this must be released in a Meteor release instead of just publishing these packages?

Also, we may need some docs update, since after this PR, you'll need to add an extra blaze-accounts-ui-config-facebook to get the configuration UI.

@stubailo

This comment has been minimized.

Contributor

stubailo commented Aug 29, 2016

@laosb thinking about that, would it be bad to have accounts-ui include all of the Blaze config packages directly? It feels like they are super small, and it would avoid making the setup experience more complex.

@laosb

This comment has been minimized.

Collaborator

laosb commented Aug 30, 2016

@stubailo I guess that won't make someone who only use accounts-password happy. It's small but still too much for someone don't use it. Actually I'm using accounts-ui in production with our own styles.

I would suggest printing a message when accounts-{provider} find accounts-ui to tell users add the small ui package. In fact even they do use accounts-ui and accounts-{provider}, many of them will still configure it through environment variables or something like that, for it's easier in production.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Aug 30, 2016

@laosb this is great but I think we'll end up doing it slightly differently. Let's take the discussion back to the issue?

@laosb

This comment has been minimized.

Collaborator

laosb commented Aug 31, 2016

That's OK

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Sep 6, 2016

I'm going to close this, we can always re-open if we want to use this code for the ultimate solution.

@tmeasday tmeasday closed this Sep 6, 2016

@laosb laosb reopened this Sep 10, 2016

@laosb

This comment has been minimized.

Collaborator

laosb commented Sep 16, 2016

@tmeasday

Thanks for this @laosb but it doesn't currently work, let's iterate a little.

@@ -11,13 +11,11 @@ Package.onUse(function(api) {
api.use('underscore', 'server');

This comment has been minimized.

@tmeasday

tmeasday Sep 20, 2016

Contributor

Can we get rid of all these api.uses in this package now it is empty?

api.use('http', ['server']);
api.use('underscore', 'server');
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);

This comment has been minimized.

@tmeasday

tmeasday Sep 20, 2016

Contributor

I don't think this package should depend on service-configuration, this should be in the config ui package.

This comment has been minimized.

@tmeasday

tmeasday Sep 27, 2016

Contributor

@laosb we need to remove this, otherwise this package ends up depending on accounts-base which is not what we want.

Package.onUse(function(api) {
api.use('templating@1.2.13', 'client');
api.use('accounts-facebook@1.1.0');

This comment has been minimized.

@tmeasday

tmeasday Sep 20, 2016

Contributor

I'm not sure this package should depend on accounts facebook.

a) it leads to a circular dependency
b) the facebook package didn't previously
c) in theory you could have the config ui w/o accounts ?

This comment has been minimized.

@laosb

laosb Sep 21, 2016

Collaborator

Ah, yes, my fault.

@@ -0,0 +1,5 @@
if (Package['accounts-ui'] && (typeof Package['facebook-config-ui'] === undefined)) {
console.info("You're using accounts-ui and accounts-facebook, but didn't",

This comment has been minimized.

@tmeasday

tmeasday Sep 20, 2016

Contributor

I don't see this message in my testing.

This comment has been minimized.

@laosb

laosb Sep 21, 2016

Collaborator

I didn't do much test on it yet. Will do this weekend

This comment has been minimized.

@laosb

laosb Sep 25, 2016

Collaborator

All done!

@laosb laosb force-pushed the accounts-facebook-reorganize branch from 7329f7d to 447f472 Sep 24, 2016

@laosb

This comment has been minimized.

Collaborator

laosb commented Sep 24, 2016

Rebased.

@laosb

This comment has been minimized.

Collaborator

laosb commented Sep 24, 2016

image

@laosb

This comment has been minimized.

Collaborator

laosb commented Sep 24, 2016

@tmeasday I guess it's working now.

@tmeasday

Looking good, just a few minor tweaks now!

@@ -1,23 +1,13 @@
Package.describe({
summary: "Facebook OAuth flow",
version: "1.2.10-beta.5"
summary: "DEPRECATED - Facebook OAuth flow",

This comment has been minimized.

@tmeasday

tmeasday Sep 27, 2016

Contributor

Can we put "use facebook-oauth instead" in here somehow?

if (Package['accounts-ui'] && (Package['facebook-config-ui'] === undefined)) {
console.info("You're using accounts-ui and accounts-facebook, but didn't",
"install the configuration UI for Facebook OAuth. You can do it by",
"adding facebook-config-ui.");

This comment has been minimized.

@tmeasday

tmeasday Sep 27, 2016

Contributor

Can we make this

console.info("You're using accounts-ui and accounts-facebook, but didn't",
 +        "install the configuration UI for Facebook OAuth.");
console.info("You can install it with `meteor add facebook-config-ui`.");
** Deprecated **

This comment has been minimized.

@tmeasday

tmeasday Sep 27, 2016

Contributor

Again, can we note what people should use instead please?

This comment has been minimized.

@laosb

laosb Sep 30, 2016

Collaborator

Sure!

@abernix abernix force-pushed the accounts-facebook-reorganize branch from 7a29717 to 7ed415f Sep 30, 2016

@abernix

This comment has been minimized.

Member

abernix commented Sep 30, 2016

Rebased to get dd3fe9a, to hopefully fix the test which failed last.

@laosb

This comment has been minimized.

Collaborator

laosb commented Oct 2, 2016

@tmeasday Done!

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Oct 4, 2016

Looks good! Thank you @laosb, great stuff.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Oct 5, 2016

Ok a few more changes were needed, specifically the Accounts UI if you were in the "in between" use case.

Hopefully this should cover all the other oauth packages if people want to similarly change them in the future.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Oct 5, 2016

Those interested (@queso / @mitar / @MeKarina ) it would be great to get some more people playing around with various combinations of accounts-X packages and checking it all makes sense.

@laosb

This comment has been minimized.

Collaborator

laosb commented Oct 6, 2016

Having examinations in school... Will help cover other oauth packages!

@laosb

This comment has been minimized.

Collaborator

laosb commented Oct 11, 2016

So are we waiting for more users to try it out? PRs get outdated quickly.

@benjamn benjamn self-assigned this Oct 11, 2016

@abernix

I went through and tested, I think thoroughly, but I don't know React very well.

Using the simple-todos-react demo with these changes I was able to get it working and definitively not load blaze on the client while still allowing Meteor.loginWithFacebook() to work properly. I don't think there are actually -ui components that I can test the configuration part with, but ServiceConfiguration works.

Blaze simple-todos almost worked (no changes to it, itself), but did require a change below with service-configuration (explained below).

api.use('http', ['server']);
api.use('underscore', 'server');
api.use('random', 'client');
api.use('service-configuration', 'client');

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

I believe service-configuration needs to be ['server',client']here otherwise if you don't haveservice-configurationin your.meteor/packages` it will fail when you try to login after the configuration:

  1. Click Configure Facebook Login

    image

  2. Fill in then Save Configuration

    image

  3. It appears to save, and button changes to login

    image

  4. But when you click it, you get Internal Server Error

    image

I tested with server and it worked properly.

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

Oh, forgot to include the error:

W20161013-20:04:59.628(3) (oauth_server.js:398) Error in OAuth Server: ServiceConfiguration is not defined
I20161013-20:04:59.893(3)? Exception while invoking method 'login' ReferenceError: ServiceConfiguration is not defined
I20161013-20:04:59.894(3)?     at getTokenResponse (packages/facebook-oauth/facebook_server.js:49:1)
I20161013-20:04:59.895(3)?     at Object.handleOauthRequest (packages/facebook-oauth/facebook_server.js:28:1)
I20161013-20:04:59.895(3)?     at OAuth._requestHandlers.(anonymous function) (packages/oauth2/oauth2_server.js:8:1)
I20161013-20:04:59.895(3)?     at middleware (packages/oauth/oauth_server.js:173:1)
I20161013-20:04:59.896(3)?     at packages/oauth/oauth_server.js:146:1

This comment has been minimized.

@laosb

laosb Oct 16, 2016

Collaborator

My fault. I did test the deprecation notice and roughly use a code-configured service to test the ui.

if (Package['accounts-ui'] && (Package['facebook-config-ui'] === undefined)) {
console.info("You're using accounts-ui and accounts-facebook, but didn't",
"install the configuration UI for Facebook OAuth.");
console.info("You can install it with `meteor add facebook-config-ui`.");

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

Personally I'd make these .warn, just like the deprecation warning below. I think it looks nicer.

@@ -0,0 +1,18 @@
Package.describe({
summary: "Facebook OAuth flow",

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

name?

This comment has been minimized.

@tmeasday

tmeasday Oct 21, 2016

Contributor

We don't seem to do this for core packages, so I won't break the rule here.

@@ -0,0 +1,3 @@
# facebook-oauth
An implementation of the Facebook OAuth flow. See the [project page](https://www.meteor.com/accounts) on Meteor Accounts for more details. XXX link

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

This is still XXX link.

This comment has been minimized.

@laosb

laosb Oct 16, 2016

Collaborator

Not very sure about what link is needed.

This comment has been minimized.

@abernix

abernix Oct 17, 2016

Member

I think the current link is fine. Maybe just remove XXX link? 😄

@@ -0,0 +1 @@
.build*

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

What's with this?

This comment has been minimized.

@tmeasday

tmeasday Oct 14, 2016

Contributor

Isn't this put here automatically?

This comment has been minimized.

@abernix

abernix Oct 17, 2016

Member

I didn't see anything that would create it automatically but upon further inspection, I guess it's desired per 8dbee56 and 8bf2e0e. I still don't quite understand, but it doesn't matter/I was just curious.

@@ -0,0 +1,13 @@
Package.describe({
summary: "Blaze configuration templates for Facebook OAuth.",

This comment has been minimized.

@abernix

abernix Oct 13, 2016

Member

I guess it's not necessary, but do these need name? Downsides? Upsides? :shrug:

This comment has been minimized.

@tmeasday

tmeasday Oct 14, 2016

Contributor

Yeah defaulting to using the directory name is kind of ughh.

This comment has been minimized.

@laosb

laosb Oct 16, 2016

Collaborator

I'm just copying the existing package.js. It does work and if we add name, we should add it in other packages too.

@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Oct 14, 2016

I'll try to fix these problems up monday

@laosb laosb force-pushed the accounts-facebook-reorganize branch from 94b9778 to a4dad54 Nov 6, 2016

@laosb

This comment has been minimized.

Collaborator

laosb commented Nov 6, 2016

Solved the conflict @tmeasday

@abernix

This comment has been minimized.

Member

abernix commented Nov 7, 2016

@laosb The answer is probably yes, but they probably won't merge this until work is being done on 1.4.3 instead of 1.4.2.1. This isn't appropriate for 1.4.2.1 (a bug-fix release).

@laosb

This comment has been minimized.

Collaborator

laosb commented Nov 7, 2016

Yep, should be in 1.4.3.

@tmeasday tmeasday merged commit ef64f7a into devel Nov 8, 2016

4 checks passed

CLA Author has signed the Meteor CLA.
Details
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@tmeasday

This comment has been minimized.

Contributor

tmeasday commented Nov 8, 2016

Finally merged! Thanks all!

@laosb laosb referenced this pull request Jan 21, 2017

Merged

Accounts-google reorganize #8275

@laosb laosb referenced this pull request Jan 31, 2017

Merged

Accounts-weibo reorganize #8302

abernix added a commit that referenced this pull request Feb 10, 2017

Add an upgrader which modifies `accounts-*` packages automatically.
 The transformations to be made here are:
   * Existence of `accounts-<service>` **adds** `<service>-config-ui`
   * Existence of `<service>` **changes to** `<service>-oauth`
 #7715 (comment)

 Relates to:

  * facebook: #7728
  * github: #8303
  * google: #8275
  * meetup: #8231
  * meteor-developer: #8305
  * twitter: #8283
  * weibo: #8302

abernix added a commit to abernix/meteor that referenced this pull request Feb 10, 2017

Add an upgrader which modifies `accounts-*` packages automatically.
 The transformations to be made here are:
   * Existence of `accounts-<service>` **adds** `<service>-config-ui`
   * Existence of `<service>` **changes to** `<service>-oauth`
 meteor#7715 (comment)

 Relates to:

  * facebook: meteor#7728
  * github: meteor#8303
  * google: meteor#8275
  * meetup: meteor#8231
  * meteor-developer: meteor#8305
  * twitter: meteor#8283
  * weibo: meteor#8302

abernix added a commit that referenced this pull request Feb 10, 2017

Add an upgrader which modifies `accounts-*` packages automatically.
 The transformations to be made here are:
   * Existence of `accounts-<service>` **adds** `<service>-config-ui`
   * Existence of `<service>` **changes to** `<service>-oauth`
 #7715 (comment)

 Relates to:

  * facebook: #7728
  * github: #8303
  * google: #8275
  * meetup: #8231
  * meteor-developer: #8305
  * twitter: #8283
  * weibo: #8302

@abernix abernix deleted the accounts-facebook-reorganize branch Apr 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment