Skip to content

Commit

Permalink
nail down rxjs so event grafana can’t break it
Browse files Browse the repository at this point in the history
@grafana/toolkit uses some webpack rules that enforce 'rxjs' to mean
some recent version — even for dependencies. With this brute
force approach we can ship a library that hangs on to its rxjs version
for dear life.

Without this change, “Observable.map is not a function” and nothing works.
  • Loading branch information
rkuhn committed Jul 25, 2021
1 parent f9465f4 commit 073f280
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion js/sdk/etc/sdk.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export type AqlEventMessage = {

// @beta
export type AqlFutureCompat = {
type: Exclude<'event', string>;
type: Exclude<'event' | 'offsets' | 'diagnostic', string>;
payload: unknown;
meta: Record<string, unknown>;
};
Expand Down
3 changes: 3 additions & 0 deletions js/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"utf-8-validate": "5.0.2",
"ws": "7.2.1"
},
"bundledDependencies": [
"rxjs"
],
"description": "Actyx SDK",
"devDependencies": {
"@microsoft/api-extractor": "^7.16.1",
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/event-fns-impl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2021 Actyx AG
*/
import { chunksOf } from 'fp-ts/lib/Array'
import { Subject } from 'rxjs'
import { Subject } from '../../node_modules/rxjs'
import {
ActyxEvent,
allEvents,
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/event-fns-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2021 Actyx AG
*/
import { contramap, getTupleOrd, gt, lt, ordNumber, ordString } from 'fp-ts/lib/Ord'
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import {
AutoCappedQuery,
EarliestQuery,
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/eventStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { EventsSortOrder, NodeId, OffsetMap, Where } from '../types'
import { mockEventStore } from './mockEventStore'
import { testEventStore, TestEventStore } from './testEventStore'
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/mockEventStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable, ReplaySubject } from 'rxjs'
import { Observable, ReplaySubject } from '../../node_modules/rxjs'
import { AppId, Lamport, NodeId, Offset, OffsetMap, Timestamp, toEventPredicate } from '../types'
import { DoPersistEvents, DoQuery, DoSubscribe, EventStore } from './eventStore'
import log from './log'
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/subscribe_monotonic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { fromNullable, Option } from 'fp-ts/lib/Option'
import { greaterThan } from 'fp-ts/lib/Ord'
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { SnapshotStore } from '../snapshotStore'
import {
EventKey,
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/testEventStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2021 Actyx AG
*/
import { fromNullable } from 'fp-ts/lib/Option'
import { Observable, ReplaySubject, Scheduler, Subject } from 'rxjs'
import { Observable, ReplaySubject, Scheduler, Subject } from '../../node_modules/rxjs'
import {
AppId,
EventKey,
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/webSocketWrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-explicit-any */

import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { MockWebSocket } from '../v2/multiplexedWebsocket.spec'
import { WebSocketWrapper } from './webSocketWrapper'

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/internal_common/webSocketWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { EventEmitter } from 'events'
import { Observable, ReplaySubject, Subject } from 'rxjs'
import { Observable, ReplaySubject, Subject } from '../../node_modules/rxjs'
import { isNode } from '../util'
import { root } from '../util/root'
import { decorateEConnRefused } from './errors'
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/snapshotStore/snapshotStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { EventKey, LocalSnapshot, OffsetMap } from '../types'
import { InMemSnapshotStore } from './inMemSnapshotStore'

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/types/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { Where } from './tags'
import { Metadata, PendingEmission } from './various'

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/observable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable, Scheduler } from 'rxjs'
import { Observable, Scheduler } from '../../node_modules/rxjs'
import { marbles } from 'rxjs-marbles'
import { takeWhileInclusive } from './observable'

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2021 Actyx AG
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Observable, Operator, Subscriber } from 'rxjs'
import { Observable, Operator, Subscriber } from '../../node_modules/rxjs'
import { MonoTypeOperatorFunction } from 'rxjs/interfaces'
import { TeardownLogic } from 'rxjs/Subscription'
import { CancelSubscription } from '../types'
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/reconnectStrategies.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any */

import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { marbles } from 'rxjs-marbles'
import reconnectStrategies from './reconnectStrategies'

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/reconnectStrategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
/* eslint-disable @typescript-eslint/no-explicit-any */

import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'

export type ReconnectStrategy = (x: Observable<any>) => Observable<any>

Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/runStats.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (C) 2021 Actyx AG
*/
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { RunStats } from './runStats'

describe('runStats', () => {
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/util/runStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import { none, Option, some } from 'fp-ts/lib/Option'
import * as t from 'io-ts'
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'

// Copypasta to avoid weird circular dependency issues
const lookup = <V>(m: { [k: string]: V }, k: string): V | undefined => m[k]
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/v1/multiplexedWebsocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* eslint-disable @typescript-eslint/no-explicit-any */
import * as t from 'io-ts'
import { Observable, Observer, Subscription } from 'rxjs'
import { Observable, Observer, Subscription } from '../../node_modules/rxjs'
import log from '../internal_common/log'
import { WsStoreConfig } from '../internal_common/types'
import { WebSocketWrapper } from '../internal_common/webSocketWrapper'
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/v1/websocketEventStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Copyright (C) 2020 Actyx AG
*/
import * as t from 'io-ts'
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import {
DoPersistEvents,
DoQuery,
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/v2/multiplexedWebsocket.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { fromNullable } from 'fp-ts/lib/Option'
import { range, takeWhile } from 'ramda'
import { Observable } from 'rxjs'
import { Observable } from '../../node_modules/rxjs'
import { OffsetsResponse } from '../internal_common/types'
import { validateOrThrow } from '../util'
import {
Expand Down
2 changes: 1 addition & 1 deletion js/sdk/src/v2/multiplexedWebsocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/* eslint-disable @typescript-eslint/no-explicit-any */
import * as t from 'io-ts'
import { Observable, Observer, Subscription } from 'rxjs'
import { Observable, Observer, Subscription } from '../../node_modules/rxjs'
import log from '../internal_common/log'
import { WsStoreConfig } from '../internal_common/types'
import { WebSocketWrapper } from '../internal_common/webSocketWrapper'
Expand Down

0 comments on commit 073f280

Please sign in to comment.