Skip to content
This repository has been archived by the owner. It is now read-only.

Hook up the new FxA JS client. #204

Merged
merged 2 commits into from Jan 9, 2014
Merged

Hook up the new FxA JS client. #204

merged 2 commits into from Jan 9, 2014

Conversation

@shane-tomlinson
Copy link
Member

@shane-tomlinson shane-tomlinson commented Jan 9, 2014

  • Update bower config to fetch the new FxA JS client.
  • In postinstall npm command, install the FxA JS client's dependencies and do a build so the client is available.
  • Create a light wrapper around the FxaJSClient to reduce boilerplate code.
  • Use the fxa-js-client from the bower install, get rid of picl-gherkin
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 9, 2014

@zaach - if you look here, I do what you suggest here to great success. Thanks for the hint!

r?

@shane-tomlinson shane-tomlinson mentioned this pull request Jan 9, 2014
2 of 3 tasks complete
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 9, 2014

fixes #204

@@ -4,7 +4,7 @@
"description": "Firefox Accounts Content Server",
"scripts": {
"start": "grunt server",
"postinstall": "bower install",
"postinstall": "bower install;cd app/bower_components/fxa-js-client;npm install;grunt build",

This comment has been minimized.

@vladikoff

vladikoff Jan 9, 2014
Contributor

I'm wondering if there is a better solution for this.
We don't want to commit library builds into fxa-js-client.
However we need a way to just get the latest version of the lib from some published source.
Maybe a release git branch (where the branch only has 2 library files)? or somehow grab the file from GitHub releases?

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

If we can automate that process, 👍.

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Jan 9, 2014
Author Member

I am all for checking out a release branch that contains the pre-built files, if as @zaach says, that process can be automated - installing the deps to generate the build on every checkin takes a significant amount of time on travis.

* Update bower config to fetch the new FxA JS client.
* In postinstall npm command, install the FxA JS client's dependencies and do a build so the client is available.
* Create a light wrapper around the FxaJSClient to reduce boilerplate code.
* Use the fxa-js-client from the bower install, get rid of picl-gherkin
@shane-tomlinson
Copy link
Member Author

@shane-tomlinson shane-tomlinson commented Jan 9, 2014

@zaach - How're you feeling about this one?

.then(function (client) {
Session.email = email;
Session.token = client.sessionToken;
var client = new FxaClient();

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

Don't we still need the server URL from the configuration?

This comment has been minimized.

@shane-tomlinson

shane-tomlinson Jan 9, 2014
Author Member

Nope, that's abstracted here to reduce boilerplate code.

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

Ah, cool. 👍

"intern-geezer": "1.3.2",
"jshint-stylish": "~0.1.4",
"grunt-preprocess": "~3.0.1"
"grunt-preprocess": "~3.0.1",
"xmlhttprequest": "~1.6.0"

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

I had to make a patch to xmlhttprequest to support xhr.onerror, so gherkin uses this line in package.json: "xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror",.

@@ -9,7 +9,7 @@ require.config({
jquery: '../bower_components/jquery/jquery',
backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore',
gherkin: '../bower_components/fxa-js-client-old/web/bundle',
gherkin: '../bower_components/fxa-js-client/build/fxa-client',

This comment has been minimized.

@zaach

zaach Jan 9, 2014
Contributor

We should replace references to gherkin with fxaClient. Sorry gherkin.

This comment has been minimized.

@ckarlof

ckarlof Jan 9, 2014
Contributor

Sorry gherkin.

Noooooooooo!

@zaach
Copy link
Contributor

@zaach zaach commented Jan 9, 2014

@shane-tomlinson I left a couple of comments, but this looks good!

* Rename gherkin to fxaClient
* Use the special xmlhttprequest that supports .onerror
* Rename the FxaClient wrapper to FxaClientWrapper internally
@zaach
Copy link
Contributor

@zaach zaach commented Jan 9, 2014

👍

zaach added a commit that referenced this pull request Jan 9, 2014
@zaach zaach merged commit 8c7f440 into develop Jan 9, 2014
@zaach zaach deleted the issue-203-new-js-client branch Jan 9, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants