apollo-link-dedup
Advanced tools
Comparing version 0.4.1-beta.1 to 0.4.1-beta.3
{ | ||
"name": "apollo-link-dedup", | ||
"version": "0.4.1-beta.1", | ||
"version": "0.4.1-beta.3", | ||
"description": "Deduplicates queries that are currently on the wire", | ||
@@ -13,6 +13,6 @@ "author": "Evans Hauser <evanshauser@gmail.com>", | ||
"license": "MIT", | ||
"main": "./dist/src/bundle.umd.js", | ||
"module": "./dist/src/dedupLink.js", | ||
"jsnext:main": "./dist/src/dedupLink.js", | ||
"typings": "./dist/src/dedupLink.d.ts", | ||
"main": "./lib/bundle.umd.js", | ||
"module": "./lib/dedupLink.js", | ||
"jsnext:main": "./lib/dedupLink.js", | ||
"typings": "./lib/dedupLink.d.ts", | ||
"repository": { | ||
@@ -27,55 +27,46 @@ "type": "git", | ||
"scripts": { | ||
"pretest": "npm run build-test", | ||
"test": "npm run test-only --", | ||
"posttest": "npm run lint", | ||
"test-only": "mocha --reporter spec --full-trace dist/tests/tests.js", | ||
"test-watch": | ||
"mocha --reporter spec --full-trace dist/tests/tests.js --watch", | ||
"coverage": | ||
"istanbul cover ./node_modules/mocha/bin/_mocha -- --reporter dot --full-trace dist/tests/tests.js", | ||
"postcoverage": | ||
"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info", | ||
"build:browser": | ||
"browserify ./lib/bundle.umd.js -o=./lib/bundle.js --i apollo-link && npm run minify:browser", | ||
"build": "tsc -p .", | ||
"bundle": "rollup -c", | ||
"clean": "rimraf lib/* && rimraf coverage/*", | ||
"filesize": "npm run build && npm run build:browser", | ||
"lint": | ||
"tslint --type-check -p tsconfig.test.json src/*.ts && tslint --type-check -p tsconfig.test.json tests/*.ts", | ||
"prebuild": "npm run clean:dist", | ||
"build": "tsc -p .", | ||
"build-test": "tsc -p tsconfig.test.json", | ||
"tslint --type-check -p tsconfig.json -c ../../tslint.json src/*.ts", | ||
"minify:browser": | ||
"uglifyjs -c -m -o ./lib/bundle.min.js -- ./lib/bundle.js", | ||
"postbuild": "npm run bundle", | ||
"postbuild-test": "npm run bundle", | ||
"bundle": "rollup -c", | ||
"watch": "tsc -w -p .", | ||
"clean": "npm run clean:dist && npm run clean:coverage", | ||
"clean:dist": "rimraf dist/*", | ||
"clean:coverage": "rimraf coverage/*", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
"prebuild": "npm run clean", | ||
"prepublishOnly": "npm run clean && npm run build", | ||
"test": "jest", | ||
"watch": "tsc -w -p ." | ||
}, | ||
"dependencies": { | ||
"apollo-fetch": "^0.6.0", | ||
"graphql": "^0.10.5" | ||
}, | ||
"peerDependencies": { | ||
"apollo-link": "^0.6.1-beta.1" | ||
"apollo-link": "^0.6.1-beta.3" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "4.0.4", | ||
"@types/chai-as-promised": "0.0.31", | ||
"@types/graphql": "0.10.2", | ||
"@types/mocha": "2.2.42", | ||
"@types/sinon": "2.3.3", | ||
"apollo-link": "^0.6.1-beta.1", | ||
"chai": "4.1.1", | ||
"chai-as-promised": "7.1.1", | ||
"fetch-mock": "5.12.2", | ||
"@types/jest": "^20.0.8", | ||
"apollo-link": "^0.6.1-beta.3", | ||
"browserify": "^14.4.0", | ||
"graphql": "^0.11.3", | ||
"graphql-tag": "2.4.2", | ||
"istanbul": "0.4.5", | ||
"lodash": "4.17.4", | ||
"mocha": "3.5.0", | ||
"remap-istanbul": "0.9.5", | ||
"jest": "^21.1.0", | ||
"rimraf": "2.6.1", | ||
"rollup": "^0.45.2", | ||
"sinon": "3.2.0", | ||
"source-map-support": "0.4.16", | ||
"ts-jest": "^21.0.1", | ||
"tslint": "5.7.0", | ||
"typescript": "2.5.1" | ||
"typescript": "2.5.1", | ||
"uglify-js": "^3.1.1" | ||
}, | ||
"jest": { | ||
"transform": { | ||
".(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js" | ||
}, | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx|js)$", | ||
"moduleFileExtensions": ["ts", "tsx", "js", "json"] | ||
} | ||
} |
export default { | ||
entry: 'dist/src/dedupLink.js', | ||
dest: 'dist/src/bundle.umd.js', | ||
entry: 'lib/dedupLink.js', | ||
dest: 'lib/bundle.umd.js', | ||
format: 'umd', | ||
@@ -8,10 +8,7 @@ sourceMap: true, | ||
exports: 'named', | ||
onwarn | ||
onwarn, | ||
}; | ||
function onwarn(message) { | ||
const suppressed = [ | ||
'UNRESOLVED_IMPORT', | ||
'THIS_IS_UNDEFINED' | ||
]; | ||
const suppressed = ['UNRESOLVED_IMPORT', 'THIS_IS_UNDEFINED']; | ||
@@ -18,0 +15,0 @@ if (!suppressed.find(code => message.code === code)) { |
@@ -9,4 +9,2 @@ import { | ||
import { print } from 'graphql/language/printer'; | ||
/* | ||
@@ -30,7 +28,7 @@ * Expects context to contain the forceFetch field if no dedup | ||
// sometimes we might not want to deduplicate a request, for example when we want to force fetch it. | ||
if (operation.context.forceFetch) { | ||
if (operation.getContext().forceFetch) { | ||
return forward(operation); | ||
} | ||
const key = this.getKey(operation); | ||
const key = operation.toKey(); | ||
if (!this.inFlightRequestObservables[key]) { | ||
@@ -53,5 +51,3 @@ this.inFlightRequestObservables[key] = forward(operation); | ||
return () => { | ||
if (subscription) { | ||
subscription.unsubscribe(); | ||
} | ||
if (subscription) subscription.unsubscribe(); | ||
delete this.inFlightRequestObservables[key]; | ||
@@ -61,10 +57,2 @@ }; | ||
} | ||
private getKey(operation: Operation) { | ||
// XXX we're assuming here that variables will be serialized in the same order. | ||
// that might not always be true | ||
return `${print(operation.query)}|${JSON.stringify( | ||
operation.variables, | ||
)}|${operation.operationName}`; | ||
} | ||
} |
{ | ||
"extends": "../../tsconfig", | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"rootDir": "." | ||
"rootDir": "./src", | ||
"outDir": "lib" | ||
}, | ||
"include": ["src/**/*.ts"] | ||
"include": ["src/**/*.ts"], | ||
"exclude": ["src/**/__tests__/*.ts"] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
20889
2
13
388
0
52
1
- Removedapollo-fetch@^0.6.0
- Removedapollo-fetch@0.6.0(transitive)
- Removedencoding@0.1.13(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedis-stream@1.1.0(transitive)
- Removedisomorphic-fetch@2.2.1(transitive)
- Removednode-fetch@1.7.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedwhatwg-fetch@3.6.20(transitive)