Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add react-native section to package.json #528

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# jsonld ChangeLog

## 8.3.3 -

### Added
- Add `"react-native"` section to `package.json` and instructions on using
React Native in the README.

## 8.3.2 - 2023-12-06

### Fixed
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,17 @@ The `safe` options flag set to `true` enables this behavior:
const expanded = await jsonld.expand(data, {safe: true});
```

### Using with React Native

Using this library with React Native requires a polyfill such as
[`data-integrity-rn`](https://github.com/digitalcredentials/data-integrity-rn)
dlongley marked this conversation as resolved.
Show resolved Hide resolved
to be imported before this library:

```js
import '@digitalcredentials/data-integrity-rn';
import * as jsonld from 'jsonld';
```

Tests
-----

Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@
},
"license": "BSD-3-Clause",
"main": "lib/index.js",
"types": "types/index.d.ts",
"files": [
"dist/*.js",
"dist/*.js.map",
"lib/*.js",
"lib/**/*.js"
],
"dependencies": {
"@digitalbazaar/http-client": "^3.4.1",
"@digitalbazaar/http-client": "^4.1.0",
"canonicalize": "^1.0.1",
"lru-cache": "^6.0.0",
"rdf-canonize": "^3.4.0"
"rdf-canonize": "^4.0.1"
},
"devDependencies": {
"@babel/core": "^7.21.8",
Expand Down Expand Up @@ -122,5 +123,15 @@
"request": false,
"url": false,
"util": false
},
"react-native": {
"./lib/index.js": "./lib/jsonld.js",
"./lib/platform.js": "./lib/platform-browser.js",
"crypto": false,
"http": false,
"jsonld-request": false,
"request": false,
"url": false,
"util": false
}
}
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'jsonld';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is as complicated as this file gets, it seems fine to me (shouldn't really be any maintenance).