Comparing version 5.0.0 to 5.1.0
# jsonld ChangeLog | ||
## 5.1.0 - 2021-04-07 | ||
### Changed | ||
- Use `globalThis` to set globals in browser contexts. | ||
- Split platform support out into Node.js and browser files. | ||
- Update `@digitalbazaar/http-client` dependency to address engine | ||
compatibility issues with newer Node.js versions. | ||
- Update dependencies. | ||
### Fixed | ||
- Browser override path style. | ||
## 5.0.0 - 2021-03-18 | ||
@@ -17,3 +29,3 @@ | ||
`request`. | ||
- **BREAKING** Only support Node.js >= 12. Remove related unneeded polyfills, | ||
- **BREAKING**: Only support Node.js >= 12. Remove related unneeded polyfills, | ||
tests, and `node6` output. Update dependencies that needed newer Node.js | ||
@@ -34,3 +46,3 @@ versions. | ||
- Use of deprecated library `request` in Node.js documentLoader. | ||
- **BREAKING** Parameter `request` has been removed from the Node.js | ||
- **BREAKING**: Parameter `request` has been removed from the Node.js | ||
documentLoader. | ||
@@ -37,0 +49,0 @@ - Node.js documentLoader should no longer be included in browser build. |
@@ -37,2 +37,3 @@ /** | ||
const canonize = require('rdf-canonize'); | ||
const platform = require('./platform'); | ||
const util = require('./util'); | ||
@@ -83,8 +84,2 @@ const ContextResolver = require('./ContextResolver'); | ||
// determine if in-browser or using Node.js | ||
const _nodejs = ( | ||
typeof process !== 'undefined' && process.versions && process.versions.node); | ||
const _browser = !_nodejs && | ||
(typeof window !== 'undefined' || typeof self !== 'undefined'); | ||
/* eslint-disable indent */ | ||
@@ -943,4 +938,2 @@ // attaches jsonld API to the given object | ||
jsonld.documentLoaders = {}; | ||
jsonld.documentLoaders.node = require('./documentLoaders/node'); | ||
jsonld.documentLoaders.xhr = require('./documentLoaders/xhr'); | ||
@@ -1011,21 +1004,5 @@ /** | ||
// setup browser global JsonLdProcessor | ||
if(_browser && typeof global.JsonLdProcessor === 'undefined') { | ||
Object.defineProperty(global, 'JsonLdProcessor', { | ||
writable: true, | ||
enumerable: false, | ||
configurable: true, | ||
value: jsonld.JsonLdProcessor | ||
}); | ||
} | ||
platform.setupGlobals(jsonld); | ||
platform.setupDocumentLoaders(jsonld); | ||
// set platform-specific defaults/APIs | ||
if(_nodejs) { | ||
// use node document loader by default | ||
jsonld.useDocumentLoader('node'); | ||
} else if(typeof XMLHttpRequest !== 'undefined') { | ||
// use xhr document loader by default | ||
jsonld.useDocumentLoader('xhr'); | ||
} | ||
function _setDefaults(options, { | ||
@@ -1032,0 +1009,0 @@ documentLoader = jsonld.documentLoader, |
{ | ||
"name": "jsonld", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "A JSON-LD Processor and API implementation in JavaScript.", | ||
@@ -32,3 +32,3 @@ "homepage": "https://github.com/digitalbazaar/jsonld.js", | ||
"dependencies": { | ||
"@digitalbazaar/http-client": "^1.0.0", | ||
"@digitalbazaar/http-client": "^1.1.0", | ||
"canonicalize": "^1.0.1", | ||
@@ -39,17 +39,17 @@ "lru-cache": "^6.0.0", | ||
"devDependencies": { | ||
"@babel/core": "^7.13.10", | ||
"@babel/core": "^7.13.14", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.13.8", | ||
"@babel/plugin-transform-modules-commonjs": "^7.13.8", | ||
"@babel/plugin-transform-runtime": "^7.13.10", | ||
"@babel/preset-env": "^7.13.10", | ||
"@babel/preset-env": "^7.13.12", | ||
"@babel/runtime": "^7.13.10", | ||
"babel-loader": "^8.0.6", | ||
"babel-loader": "^8.2.2", | ||
"benchmark": "^2.1.4", | ||
"browserify": "^17.0.0", | ||
"chai": "^4.3.4", | ||
"core-js": "^3.9.1", | ||
"core-js": "^3.10.0", | ||
"cors": "^2.7.1", | ||
"cross-env": "^7.0.3", | ||
"envify": "^4.1.0", | ||
"eslint": "^7.22.0", | ||
"eslint": "^7.23.0", | ||
"eslint-config-digitalbazaar": "^2.6.1", | ||
@@ -118,4 +118,4 @@ "esmify": "^2.1.1", | ||
"browser": { | ||
"lib/index.js": "./lib/jsonld.js", | ||
"lib/documentLoaders/node.js": false, | ||
"./lib/index.js": "./lib/jsonld.js", | ||
"./lib/platform.js": "./lib/platform-browser.js", | ||
"crypto": false, | ||
@@ -122,0 +122,0 @@ "http": false, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
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
2437672
35
17988