Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Move fh-js-sdk to use upstream sync client (#209)
Browse files Browse the repository at this point in the history
* Move fh-js-sdk to use upstream sync client
* Add sync handler
* Update version of the fh-sync-js-package
* Added basic unit tests for sync including new data handler
* Version bumps and shrinkwraps
* Add info to README about sync development
* Minor handler fix
  • Loading branch information
wtrocki authored Jun 20, 2017
1 parent 31cf690 commit 2291bc7
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 3,068 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ tmp/*
src/appforms/dist/
dist/
libs/generated/lawnchair.js
test/sync/testServer
src/modules-cov/*
src-cov/*
src/appforms/tests/feedhenry.js
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ module.exports = function(grunt) {
dest: './test/browser/browserified_tests.js',
options: {
external: [ './src/feedhenry.js' ],
ignore: ['../../src-cov/modules/ajax', '../../src-cov/modules/events', '../../src-cov/modules/queryMap', '../../src-cov/modules/sync-cli', '../../src-cov/feedhenry'],
ignore: ['../../src-cov/modules/ajax', '../../src-cov/modules/events', '../../src-cov/modules/queryMap', '../../src-cov/feedhenry'],
// Embed source map for tests
debug: true
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,7 @@ To publish doc, run the command:
npm run doc
```
Go to [gh-pages](https://github.com/feedhenry/fh-js-sdk/tree/gh-pages) and see recent commit for the publication.

### Sync client development

Sync client development should be done in [fh-sync-js repository] (https://github.com/feedhenry/fh-sync-js)
2 changes: 1 addition & 1 deletion fh-js-sdk.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ declare module FeedHenry {
* @param {Function} listener
*/
export function once(type: string, listener: Function);

/**
* Sync namespace
*
Expand Down
14 changes: 13 additions & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fh-js-sdk",
"version": "2.18.6",
"version": "2.19.0",
"description": "feedhenry js sdk",
"main": "dist/feedhenry.js",
"types": "./fh-js-sdk.d.ts",
Expand Down Expand Up @@ -62,6 +62,7 @@
"license": "Copyright (c) 2014 FeedHenry Ltd, All Rights Reserved.",
"gitHead": "251a1f88a39f59f2652552ae245893a833faee71",
"dependencies": {
"fh-sync-js": "1.0.3",
"browserify": "3.46.1",
"browserify-shim": "~3.3.2",
"loglevel": "~0.6.0",
Expand Down
8 changes: 6 additions & 2 deletions src/feedhenry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ var api_act = require("./modules/api_act");
var api_auth = require("./modules/api_auth");
var api_sec = require("./modules/api_sec");
var api_hash = require("./modules/api_hash");
var api_sync = require("./modules/sync-cli");
var api_mbaas = require("./modules/api_mbaas");
var api_cloud = require("./modules/api_cloud");
var api_push = require("./modules/api_push");
var fhparams = require("./modules/fhparams");
var appProps = require("./modules/appProps");
var device = require("./modules/device");
var syncCloudHandler = require("./modules/sync_cloud_handler");

var defaultFail = function(msg, error) {
logger.error(msg + ":" + JSON.stringify(error));
Expand Down Expand Up @@ -69,10 +69,14 @@ fh.auth = api_auth;
fh.cloud = api_cloud;
fh.sec = api_sec;
fh.hash = api_hash;
fh.sync = api_sync;
fh.push = api_push;
fh.ajax = fh.__ajax = ajax;
fh.mbaas = api_mbaas;

// Mount sync to fh namespace
fh.sync = require("fh-sync-js");
fh.sync.setCloudHandler(syncCloudHandler);

fh._getDeviceId = device.getDeviceId;
fh.fh_timeout = 60000; //keep backward compatible

Expand Down
Loading

0 comments on commit 2291bc7

Please sign in to comment.