Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ The Microsoft Graph JavaScript client library is a lightweight wrapper around th

### Browser

Include [lib/graph-js-sdk-web.js](https://github.com/microsoftgraph/msgraph-sdk-javascript/raw/master/lib/graph-js-sdk-web.js) in your page.
The library comes with two varieties of options, you can pick one based on your use case

1. If your application has polyfills for **Fetch-API** and **ES6-Promise**, then can just include [lib/graph-js-sdk-core.js](https://github.com/microsoftgraph/msgraph-sdk-javascript/raw/master/lib/graph-js-sdk-core.js) in your page.
```html
<script type="text/javascript" src="graph-js-sdk-core.js"></script>
```

2. If your application does not have polyfills for **Fetch-API** and **ES6-Promise**, then you have to include [lib/graph-js-sdk-web.js](https://github.com/microsoftgraph/msgraph-sdk-javascript/raw/master/lib/graph-js-sdk-web.js) in your page.
```html
<script type="text/javascript" src="graph-js-sdk-web.js"></script>
```
Expand Down
6 changes: 6 additions & 0 deletions core-browserify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var browserify = require('browserify');
var b = browserify();
b.add('./browser-wrapper.js');
b.external("es6-promise");
b.external("isomorphic-fetch");
b.bundle().pipe(process.stdout);
1 change: 1 addition & 0 deletions lib/graph-js-sdk-core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/graph-js-sdk-web.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/src/GraphRequest.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/src/ResponseHandler.js.map

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

7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
"uglify-js": "^3.4.5"
},
"scripts": {
"build": "tsc && node node-browserify.js > lib/graph-js-sdk-web.js && uglifyjs ./lib/graph-js-sdk-web.js --output ./lib/graph-js-sdk-web.js",
"compile": "tsc",
"rollup-core": "node core-browserify.js > lib/graph-js-sdk-core.js && uglifyjs lib/graph-js-sdk-core.js --output lib/graph-js-sdk-core.js",
"rollup-with-vendor": "node node-browserify.js > lib/graph-js-sdk-web.js && uglifyjs ./lib/graph-js-sdk-web.js --output ./lib/graph-js-sdk-web.js",
"build-core": "npm run compile && npm run rollup-core",
"build-with-vendor": "npm run compile && npm run rollup-with-vendor",
"build": "npm run compile && npm run rollup-core && npm run rollup-with-vendor",
"test": "mocha lib/spec/core",
"test:types": "tsc --p spec/types && mocha spec/types"
},
Expand Down
2 changes: 1 addition & 1 deletion src/GraphRequest.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Promise } from 'es6-promise'
import 'isomorphic-fetch';

import { Options, URLComponents, GraphError, oDataQueryNames, GraphRequestCallback, PACKAGE_VERSION, DefaultRequestHeaders } from "./common"
import { Options, URLComponents, oDataQueryNames, GraphRequestCallback, PACKAGE_VERSION, DefaultRequestHeaders } from "./common"
import { ResponseHandler } from "./ResponseHandler"
import { RequestMethod } from './RequestMethod';
import { ResponseType } from "./ResponseType";
Expand Down
1 change: 0 additions & 1 deletion src/ResponseHandler.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {GraphRequest} from "./GraphRequest"
import {GraphRequestCallback, GraphError} from "./common"

export class ResponseHandler {
Expand Down