Skip to content

Commit

Permalink
Replace isomorphic-fetch with cross-fetch in node.js guide (#573)
Browse files Browse the repository at this point in the history
* replace isomorphic-fetch with cross-fetch in node.js guide

* docs(book): default to suggesting node-fetch for Node.js developers

AFFECTS PACKAGES:
@esri/arcgis-rest-feature-layer
@esri/arcgis-rest-geocoding
@esri/arcgis-rest-request
node-cli
batch-geocoder
@esri/arcgis-rest-demo-express
cli-item-management
sapper-webmap-checker

ISSUES CLOSED: #411

* promote cross-fetch instead
  • Loading branch information
pr3tori4n authored and patrickarlt committed Jun 1, 2019
1 parent f7a88f7 commit 4d2975a
Show file tree
Hide file tree
Showing 27 changed files with 206 additions and 261 deletions.
3 changes: 2 additions & 1 deletion demos/ago-node-cli/ago.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
require('isomorphic-fetch');
require('cross-fetch/polyfill');
require('isomorphic-form-data');

/**
* This demo uses the commander module, which streamlines the creation of command-line-applications
*/
Expand Down
60 changes: 16 additions & 44 deletions demos/ago-node-cli/package-lock.json

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

2 changes: 1 addition & 1 deletion demos/ago-node-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@esri/arcgis-rest-request": "^2.0.3",
"chalk": "^2.3.0",
"commander": "^2.12.2",
"isomorphic-fetch": "^2.2.1",
"cross-fetch": "^3.0.0",
"isomorphic-form-data": "^1.0.0",
"jsonfile": "^4.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions demos/batch-geocoder-node/batch-geocode.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require('isomorphic-fetch');
require('cross-fetch/polyfill');
require('isomorphic-form-data');
const fs = require('fs');
const Papa = require('papaparse');
const { ApplicationSession } = require('@esri/arcgis-rest-auth');
const { bulkGeocode } = require('@esri/arcgis-rest-geocoder');
const { bulkGeocode } = require('@esri/arcgis-rest-geocoding');
const config = require('./config');

// FUNCTIONS!
Expand Down
60 changes: 16 additions & 44 deletions demos/batch-geocoder-node/package-lock.json

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

2 changes: 1 addition & 1 deletion demos/batch-geocoder-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@esri/arcgis-rest-common": "^1.19.2",
"@esri/arcgis-rest-geocoding": "^2.0.3",
"@esri/arcgis-rest-request": "^2.0.3",
"isomorphic-fetch": "^2.2.1",
"cross-fetch": "^3.0.0",
"isomorphic-form-data": "^2.0.0",
"papaparse": "^4.6.0"
}
Expand Down
47 changes: 16 additions & 31 deletions demos/express/package-lock.json

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

2 changes: 1 addition & 1 deletion demos/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@esri/arcgis-rest-auth": "^2.0.3",
"@esri/arcgis-rest-request": "^2.0.3",
"express": "^4.16.3",
"isomorphic-fetch": "^2.2.1",
"cross-fetch": "^3.0.0",
"isomorphic-form-data": "^2.0.0"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions demos/express/server.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require("isomorphic-fetch");
require("cross-fetch/polyfill");
require("isomorphic-form-data");
const express = require("express");
const app = express();
Expand Down Expand Up @@ -29,5 +29,5 @@ app.get("/authenticate", function(req, res) {
});

app.listen(3000, function() {
console.log("Example app listening on port 3000!");
console.log("visit http://localhost:3000/authorize to test the application!");
});
3 changes: 2 additions & 1 deletion demos/node-cli-item-management/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require("isomorphic-fetch");
require('cross-fetch/polyfill');
require("isomorphic-form-data");
const prompts = require("prompts");
const chalk = require("chalk");
const { setDefaultRequestOptions } = require('@esri/arcgis-rest-request');
const { UserSession } = require("@esri/arcgis-rest-auth");
const {
searchItems,
Expand Down
Loading

0 comments on commit 4d2975a

Please sign in to comment.