Skip to content

Commit

Permalink
Merge pull request #40 from luisherranz/remove-preact-signal-dependen…
Browse files Browse the repository at this point in the history
…cies

Use `@preact/signals` dependencies as peer dependencies
  • Loading branch information
luisherranz committed Aug 4, 2023
2 parents 584cd88 + 6284cd6 commit 80ca42c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/rude-llamas-develop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"deepsignal": patch
---

Use `@preact/signals` dependencies as peer dependencies.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ The most important feature is that **it just works**. You don't need to do anyth

## Installation

### With Preact

```sh
npm install deepsignal
npm install deepsignal @preact/signals
```

If you are using `deepsignal` with Preact (`@preact/signals`), you should use the `deepsignal` import. You don't need to install or import `@preact/signals` anywhere in your code if you don't need it.
If you are using `deepsignal` with Preact (`@preact/signals`), you should use the `deepsignal` import. You also need to install `@preact/signals`.

```js
import { deepSignal } from "deepsignal";
Expand All @@ -73,7 +75,11 @@ const state = deepSignal({});

### With React

If you are using the library with React, you should use the `deepsignal/react` import. You don't need to install or import `@preact/signals-react` anywhere in your code if you don't need it.
```sh
npm install deepsignal @preact/signals-react
```

If you are using the library with React, you should use the `deepsignal/react` import. You also need to install `@preact/signals-react`.

```js
import { deepSignal } from "deepsignal/react";
Expand All @@ -83,7 +89,11 @@ const state = deepSignal({});

### Without Preact/React

If you are using the library just with `@preact/signals-core`, you should use the `deepsignal/core` import.
```sh
npm install deepsignal @preact/signals-core
```

If you are using the library just with `@preact/signals-core`, you should use the `deepsignal/core` import. You also need to install `@preact/signals-core`.

```js
import { deepSignal } from "deepsignal/core";
Expand Down
8 changes: 4 additions & 4 deletions packages/deepsignal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
"scripts": {
"prepublishOnly": "cp ../../README.md . && cd ../.. && pnpm build"
},
"dependencies": {
"peerDependencies": {
"@preact/signals-core": "^1.3.1",
"@preact/signals": "^1.1.4",
"@preact/signals-react": "^1.3.3"
},
"peerDependencies": {
"preact": "10.x"
},
"devDependencies": {
"preact": "10.9.0",
"preact-render-to-string": "^5.2.4",
"@preact/signals-core": "^1.3.1",
"@preact/signals": "^1.1.4",
"@preact/signals-react": "^1.3.3",
"@types/react": "^18.0.18",
"@types/react-dom": "^18.0.6",
"react": "^18.2.0",
Expand Down
15 changes: 9 additions & 6 deletions pnpm-lock.yaml

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

0 comments on commit 80ca42c

Please sign in to comment.