salesforce / akita

🚀 State Management Tailored-Made for JS Applications
https://salesforce.github.io/akita/
Apache License 2.0
3.7k stars 342 forks source link

The wrong rxjs peerDependency for >=8 version #1059

Open petro-konopelko opened 1 year ago

petro-konopelko commented 1 year ago

Is this a regression?

No

Description

The latest 8.0.1 version has rxjs peerDependency as *

{
  "name": "@datorama/akita",
  "version": "8.0.1",
  "description": "A Reactive State Management Tailored-Made for JS Applications",
  "keywords": [
    "angular",
    "state management",
    "react",
    "vue",
    "typescript",
    "javascript",
    "rxjs",
    "angular store",
    "store",
    "observable data stores",
    "redux",
    "reactive"
  ],
  "homepage": "https://github.com/datorama/akita/tree/master/libs/akita#readme",
  "bugs": {
    "url": "https://github.com/datorama/akita/issues"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/datorama/akita",
    "directory": "libs/akita"
  },
  "license": "Apache-2.0",
  "author": "Netanel Basal",
  "peerDependencies": {
    "rxjs": "*",
    "tslib": "2.4.1"
  },
  "main": "./src/index.js",
  "types": "./src/index.d.ts",
  "dependencies": {}
}

However in the 8.0.0 commit there was a re-writing of importing rxjs operators, the operators are imported from 'rxjs' rather then 'rxjs/operators'. Such operators import(from rxjs) are actual since ^7.2.0. So I guess, the rxjs peerDependency should update to ^7.2.0 or so.

Currently if we use rxjs@6.6.7 with @datorama/akita@8.0.1 it fails on build with error

./node_modules/@datorama/akita/src/lib/persistState.js:112:102-105 - Error: export 'map' (imported as 'map') was not found in 'rxjs' (possible exports: ArgumentOutOfRangeError, AsyncSubject, BehaviorSubject, ConnectableObservable, EMPTY, EmptyError, GroupedObservable, NEVER, Notification, NotificationKind, ObjectUnsubscribedError, Observable, ReplaySubject, Scheduler, Subject, Subscriber, Subscription, TimeoutError, UnsubscriptionError, VirtualAction, VirtualTimeScheduler, animationFrame, animationFrameScheduler, asap, asapScheduler, async, asyncScheduler, bindCallback, bindNodeCallback, combineLatest, concat, config, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, identity, iif, interval, isObservable, merge, never, noop, observable, of, onErrorResumeNext, pairs, partition, pipe, queue, queueScheduler, race, range, scheduled, throwError, timer, using, zip)

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

./node_modules/@datorama/akita/src/lib/persistState.js:112:102-105 - Error: export 'map' (imported as 'map') was not found in 'rxjs' (possible exports: ArgumentOutOfRangeError, AsyncSubject, BehaviorSubject, ConnectableObservable, EMPTY, EmptyError, GroupedObservable, NEVER, Notification, NotificationKind, ObjectUnsubscribedError, Observable, ReplaySubject, Scheduler, Subject, Subscriber, Subscription, TimeoutError, UnsubscriptionError, VirtualAction, VirtualTimeScheduler, animationFrame, animationFrameScheduler, asap, asapScheduler, async, asyncScheduler, bindCallback, bindNodeCallback, combineLatest, concat, config, defer, empty, forkJoin, from, fromEvent, fromEventPattern, generate, identity, iif, interval, isObservable, merge, never, noop, observable, of, onErrorResumeNext, pairs, partition, pipe, queue, queueScheduler, race, range, scheduled, throwError, timer, using, zip)

Please provide the environment you discovered this bug in

rxjs@6.6.7
@datorama/akita@8.0.1

Anything else?

No response

Do you want to create a pull request?

No

OverPa1n commented 1 year ago

When it can be fixed? Faced with the same problem

PeterSimonis commented 1 year ago

Also experiencing the same problem here. Seems like a quick fix to make...