Skip to content

Commit

Permalink
feat: Support RxJS 7 (#43)
Browse files Browse the repository at this point in the history
* Upgrade Rxjs and TypeScript

* Make it build

* Keep it working with RxJS 6

* Add publish helper

* chore(release): v2.1.4-rxjs7.0

* Update yarn.lock
  • Loading branch information
goce-cz committed Jun 9, 2022
1 parent 7ef27b9 commit 17d299c
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 62 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.4-rxjs7.0](https://github.com/salsita/spicy-hooks/compare/v2.1.2...v2.1.4-rxjs7.0) (2022-06-06)

**Note:** Version bump only for package spicy-hooks
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.1.3",
"version": "2.1.4-rxjs7.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"react": "^17.0.2",
"rxjs": "^6.6.3"
"rxjs": "^7.5.5"
},
"devDependencies": {
"@testing-library/react-hooks": "^3.4.2",
Expand All @@ -36,7 +36,7 @@
"react-test-renderer": "^17.0.2",
"ts-jest": "^26.4.1",
"typedoc": "next",
"typescript": "^4.0.3"
"typescript": "^4.7.3"
},
"scripts": {
"preinstall": "git config core.hooksPath git-hooks",
Expand Down
8 changes: 8 additions & 0 deletions packages/bin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.4-rxjs7.0](https://github.com/salsita/spicy-hooks/compare/v2.1.2...v2.1.4-rxjs7.0) (2022-06-06)

**Note:** Version bump only for package @spicy-hooks/bin





## 2.1.1 (2021-09-14)

### Bug fixes
Expand Down
8 changes: 4 additions & 4 deletions packages/bin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spicy-hooks/bin",
"version": "2.1.3",
"version": "2.1.4-rxjs7.0",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -14,15 +14,15 @@
"dependencies": {
"@expo/spawn-async": "^1.5.0",
"@octokit/core": "^3.1.2",
"@spicy-hooks/utils": "^2.1.3",
"@spicy-hooks/utils": "^2.1.4-rxjs7.0",
"chalk": "^4.1.0",
"command-line-args": "^5.1.1",
"command-line-usage": "^6.1.0",
"dotenv": "^8.2.0",
"fs-extra": "^9.0.1",
"glob": "^7.1.6",
"lodash": "^4.17.20",
"tslib": "^2.0.1"
"tslib": "^2.4.0"
},
"devDependencies": {
"@types/command-line-args": "^5.0.0",
Expand All @@ -31,7 +31,7 @@
"@types/fs-extra": "^9.0.1",
"@types/glob": "^7.1.3",
"@types/lodash": "^4.14.161",
"typescript": "^4.0.3"
"typescript": "^4.7.3"
},
"bin": {
"spicy": "./lib/spicy.js"
Expand Down
10 changes: 9 additions & 1 deletion packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.4-rxjs7.0](https://github.com/salsita/spicy-hooks/compare/v2.1.2...v2.1.4-rxjs7.0) (2022-06-06)

**Note:** Version bump only for package @spicy-hooks/core





## 2.1.2 (2022-01-05)

### Bug fixes
Expand Down Expand Up @@ -48,4 +56,4 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline

### Bug fixes

- Group all compiled output in `lib` folder (#6) @goce-cz
- Group all compiled output in `lib` folder (#6) @goce-cz
8 changes: 4 additions & 4 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spicy-hooks/core",
"version": "2.1.3",
"version": "2.1.4-rxjs7.0",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -14,14 +14,14 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"dependencies": {
"@spicy-hooks/utils": "^2.1.3",
"tslib": "^2.0.1"
"@spicy-hooks/utils": "^2.1.4-rxjs7.0",
"tslib": "^2.4.0"
},
"peerDependencies": {
"react": ">=16.9.0"
},
"devDependencies": {
"@types/react": "^16.9.49",
"typescript": "^4.0.3"
"typescript": "^4.7.3"
}
}
8 changes: 8 additions & 0 deletions packages/observables/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.4-rxjs7.0](https://github.com/salsita/spicy-hooks/compare/v2.1.2...v2.1.4-rxjs7.0) (2022-06-06)

**Note:** Version bump only for package @spicy-hooks/observables





## 2.1.2 (2022-01-05)

### Bug fixes
Expand Down
12 changes: 6 additions & 6 deletions packages/observables/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spicy-hooks/observables",
"version": "2.1.3",
"version": "2.1.4-rxjs7.0",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -14,16 +14,16 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"dependencies": {
"@spicy-hooks/core": "^2.1.3",
"@spicy-hooks/utils": "^2.1.3",
"tslib": "^2.0.1"
"@spicy-hooks/core": "^2.1.4-rxjs7.0",
"@spicy-hooks/utils": "^2.1.4-rxjs7.0",
"tslib": "^2.4.0"
},
"peerDependencies": {
"react": ">=16.9.0",
"rxjs": "^6.6.2"
"rxjs": ">=6.6.3"
},
"devDependencies": {
"@types/react": "^16.9.49",
"typescript": "^4.0.3"
"typescript": "^4.7.3"
}
}
9 changes: 3 additions & 6 deletions packages/observables/src/internal/operators/cold-from.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Observable, ObservableInput, OperatorFunction } from 'rxjs'
import { subscribeTo } from 'rxjs/internal-compatibility'
import { Observable, ObservableInput, OperatorFunction, from } from 'rxjs'
import { map } from 'rxjs/operators'

/**
Expand All @@ -11,11 +10,9 @@ import { map } from 'rxjs/operators'
export function coldFrom<T> (): OperatorFunction<() => ObservableInput<T>, Observable<T>> {
return map(factory =>
new Observable<T>(subscriber => {
const subscription = subscribeTo(factory())(subscriber)
const subscription = from(factory()).subscribe(subscriber)
return () => {
if (subscription) {
subscription.unsubscribe()
}
subscription.unsubscribe()
}
})
)
Expand Down
2 changes: 1 addition & 1 deletion packages/observables/src/internal/testing/deferred-fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function deferredFn<T, Y extends any[]> (implementation?: (...args: Y) =>
const callSubject = new Subject<T>()
const mockFn = jest.fn((...args: Y) => {
const result = implementation?.(...args)
callSubject.next(result)
callSubject.next(result as T)
return result
}) as DeferredMock<T, Y>

Expand Down
8 changes: 8 additions & 0 deletions packages/utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.1.4-rxjs7.0](https://github.com/salsita/spicy-hooks/compare/v2.1.2...v2.1.4-rxjs7.0) (2022-06-06)

**Note:** Version bump only for package @spicy-hooks/utils





## 2.1.2 (2022-05-01)

### Bug fixes
Expand Down
6 changes: 3 additions & 3 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@spicy-hooks/utils",
"version": "2.1.3",
"version": "2.1.4-rxjs7.0",
"license": "MIT",
"repository": {
"type": "git",
Expand All @@ -14,9 +14,9 @@
"main": "lib/index.js",
"types": "lib/index.d.ts",
"dependencies": {
"tslib": "^2.0.1"
"tslib": "^2.4.0"
},
"devDependencies": {
"typescript": "^4.0.3"
"typescript": "^4.7.3"
}
}
6 changes: 6 additions & 0 deletions scripts/publish-prerelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if [ -z "$1" ]; then
echo "Please provide a prerelease tag. Example:"
echo " publish-prerelease.sh beta"
fi

lerna publish prerelease --preid "$1" --dist-tag "$1"
68 changes: 34 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1916,7 +1916,7 @@ __metadata:
dependencies:
"@expo/spawn-async": ^1.5.0
"@octokit/core": ^3.1.2
"@spicy-hooks/utils": ^2.1.3
"@spicy-hooks/utils": ^2.1.4-rxjs7.0
"@types/command-line-args": ^5.0.0
"@types/command-line-usage": ^5.0.1
"@types/dotenv": ^8.2.0
Expand All @@ -1930,21 +1930,21 @@ __metadata:
fs-extra: ^9.0.1
glob: ^7.1.6
lodash: ^4.17.20
tslib: ^2.0.1
typescript: ^4.0.3
tslib: ^2.4.0
typescript: ^4.7.3
bin:
spicy: ./lib/spicy.js
languageName: unknown
linkType: soft

"@spicy-hooks/core@^2.1.3, @spicy-hooks/core@workspace:packages/core":
"@spicy-hooks/core@^2.1.4-rxjs7.0, @spicy-hooks/core@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@spicy-hooks/core@workspace:packages/core"
dependencies:
"@spicy-hooks/utils": ^2.1.3
"@spicy-hooks/utils": ^2.1.4-rxjs7.0
"@types/react": ^16.9.49
tslib: ^2.0.1
typescript: ^4.0.3
tslib: ^2.4.0
typescript: ^4.7.3
peerDependencies:
react: ">=16.9.0"
languageName: unknown
Expand All @@ -1954,23 +1954,23 @@ __metadata:
version: 0.0.0-use.local
resolution: "@spicy-hooks/observables@workspace:packages/observables"
dependencies:
"@spicy-hooks/core": ^2.1.3
"@spicy-hooks/utils": ^2.1.3
"@spicy-hooks/core": ^2.1.4-rxjs7.0
"@spicy-hooks/utils": ^2.1.4-rxjs7.0
"@types/react": ^16.9.49
tslib: ^2.0.1
typescript: ^4.0.3
tslib: ^2.4.0
typescript: ^4.7.3
peerDependencies:
react: ">=16.9.0"
rxjs: ^6.6.2
rxjs: ">=6.6.3"
languageName: unknown
linkType: soft

"@spicy-hooks/utils@^2.1.3, @spicy-hooks/utils@workspace:packages/utils":
"@spicy-hooks/utils@^2.1.4-rxjs7.0, @spicy-hooks/utils@workspace:packages/utils":
version: 0.0.0-use.local
resolution: "@spicy-hooks/utils@workspace:packages/utils"
dependencies:
tslib: ^2.0.1
typescript: ^4.0.3
tslib: ^2.4.0
typescript: ^4.7.3
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -9272,12 +9272,12 @@ __metadata:
languageName: node
linkType: hard

"rxjs@npm:^6.6.3":
version: 6.6.3
resolution: "rxjs@npm:6.6.3"
"rxjs@npm:^7.5.5":
version: 7.5.5
resolution: "rxjs@npm:7.5.5"
dependencies:
tslib: ^1.9.0
checksum: c7206389f5a91f89c2248aa9ef5ce73f979524c676e557ec2088b10ec138d91fd653ebee6cdb65532b6c05278eb3c8364ccd6feb9a499092d67731318cf05977
tslib: ^2.1.0
checksum: e034f60805210cce756dd2f49664a8108780b117cf5d0e2281506e9e6387f7b4f1532d974a8c8b09314fa7a16dd2f6cff3462072a5789672b5dcb45c4173f3c6
languageName: node
linkType: hard

Expand Down Expand Up @@ -9728,10 +9728,10 @@ __metadata:
lerna: ^5.0.0
react: ^17.0.2
react-test-renderer: ^17.0.2
rxjs: ^6.6.3
rxjs: ^7.5.5
ts-jest: ^26.4.1
typedoc: next
typescript: ^4.0.3
typescript: ^4.7.3
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -10361,10 +10361,10 @@ __metadata:
languageName: node
linkType: hard

"tslib@npm:^2.0.1":
version: 2.0.1
resolution: "tslib@npm:2.0.1"
checksum: 507f32fc24a614c5097d414b622373b6cbb99e305413517e7fd49bef1e63570c0dd15b417ae68152088c3496218e82a5d8c7cd6b48c7a32dcee1a3f7191fff74
"tslib@npm:^2.1.0, tslib@npm:^2.4.0":
version: 2.4.0
resolution: "tslib@npm:2.4.0"
checksum: 8c4aa6a3c5a754bf76aefc38026134180c053b7bd2f81338cb5e5ebf96fefa0f417bff221592bf801077f5bf990562f6264fecbc42cd3309b33872cb6fc3b113
languageName: node
linkType: hard

Expand Down Expand Up @@ -10505,23 +10505,23 @@ typedoc@next:
languageName: node
linkType: hard

"typescript@npm:^4.0.3":
version: 4.0.3
resolution: "typescript@npm:4.0.3"
"typescript@npm:^4.7.3":
version: 4.7.3
resolution: "typescript@npm:4.7.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 94fc80cfbc9a1d1b77d90e536aef8460bdd87e41ebf18116ba77b63cbf18c703c6b761892fd41a3f900d4194c8a35b81aadfb7c89d69eab0eba5fb2556747c47
checksum: fd13a1ce53790a36bb8350e1f5e5e384b5f6cb9b0635114a6d01d49cb99916abdcfbc13c7521cdae2f2d3f6d8bc4a8ae7625edf645a04ee940588cd5e7597b2f
languageName: node
linkType: hard

"typescript@patch:typescript@^4.0.3#~builtin<compat/typescript>":
version: 4.0.3
resolution: "typescript@patch:typescript@npm%3A4.0.3#~builtin<compat/typescript>::version=4.0.3&hash=7ad353"
"typescript@patch:typescript@^4.7.3#~builtin<compat/typescript>":
version: 4.7.3
resolution: "typescript@patch:typescript@npm%3A4.7.3#~builtin<compat/typescript>::version=4.7.3&hash=7ad353"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: e9a1dd789450ce217aef4919de578515d3141d53c98f2eee889fdccb95946b083233f8391aba802aa395bae12a58d0710cd9538d993fd762fd8a7332127f8597
checksum: 137d18a77f52254a284960b16ab53d0619f57b69b5d585804b8413f798a1175ce3e774fb95e6a101868577aafe357d8fcfc9171f0dc9fc0c210e9ae59d107cc0
languageName: node
linkType: hard

Expand Down

0 comments on commit 17d299c

Please sign in to comment.