Skip to content

Commit

Permalink
chore(compat): adjust compatibility imports so ESM resolution will work
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonaden committed Mar 15, 2018
1 parent 6e84e78 commit 6131529
Show file tree
Hide file tree
Showing 17 changed files with 141 additions and 127 deletions.
2 changes: 1 addition & 1 deletion compat/AsyncSubject.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {AsyncSubject} from 'rxjs/internal/AsyncSubject';
export {AsyncSubject} from 'rxjs';
2 changes: 1 addition & 1 deletion compat/InnerSubscriber.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {InnerSubscriber} from 'rxjs/internal/InnerSubscriber';
export {InnerSubscriber} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/Operator.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {Operator} from 'rxjs/internal/Operator';
export {Operator} from 'rxjs';
2 changes: 1 addition & 1 deletion compat/OuterSubscriber.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {OuterSubscriber} from 'rxjs/internal/OuterSubscriber';
export {OuterSubscriber} from 'rxjs/internal-compatibility';
4 changes: 1 addition & 3 deletions compat/Rx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ export { AjaxRequest, AjaxResponse, AjaxError, AjaxTimeoutError } from 'rxjs/aja

import { asapScheduler, asyncScheduler, queueScheduler, animationFrameScheduler, SchedulerLike } from 'rxjs';

import { rxSubscriber } from 'rxjs/internal/symbol/rxSubscriber';
import { iterator } from 'rxjs/internal/symbol/iterator';
import { observable } from 'rxjs/internal/symbol/observable';
import { iterator, observable, rxSubscriber } from 'rxjs/internal-compatibility';

import * as _operators from 'rxjs/operators';

Expand Down
2 changes: 1 addition & 1 deletion compat/Scheduler.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {Scheduler} from 'rxjs/internal/Scheduler';
export {Scheduler} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/SubjectSubscription.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {SubjectSubscription} from 'rxjs/internal/SubjectSubscription';
export {SubjectSubscription} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/Subscriber.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {Subscriber} from 'rxjs/internal/Subscriber';
export {Subscriber} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/add/observable/dom/ajax.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Observable } from 'rxjs';
import { ajax as staticAjax } from 'rxjs/ajax';
import { AjaxCreationMethod } from 'rxjs/internal/observable/dom/AjaxObservable';
import { AjaxCreationMethod } from 'rxjs/internal-compatibility';

Observable.ajax = staticAjax;

Expand Down
6 changes: 3 additions & 3 deletions compat/add/observable/fromPromise.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Observable } from 'rxjs';
import { fromPromise as staticFromPromise } from 'rxjs/internal/observable/fromPromise';
import { Observable, from } from 'rxjs';
import { fromPromise as staticFromPromise } from 'rxjs/internal-compatibility';

(Observable as any).fromPromise = staticFromPromise;
(Observable as any).fromPromise = from;

declare module 'rxjs/internal/Observable' {
namespace Observable {
Expand Down
3 changes: 1 addition & 2 deletions compat/add/observable/never.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Observable, interval } from 'rxjs';
import { NEVER } from 'rxjs/internal/observable/never';
import { Observable, interval, NEVER } from 'rxjs';

export function staticNever() {
return NEVER;
Expand Down
4 changes: 1 addition & 3 deletions compat/operators/combineLatest.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import { isArray } from 'rxjs/internal/util/isArray';
import { subscribeToResult } from 'rxjs/internal/util/subscribeToResult';
import { isArray, CombineLatestOperator } from 'rxjs/internal-compatibility';
import { Observable, ObservableInput, Operator, OperatorFunction, from } from 'rxjs';
import { CombineLatestOperator } from 'rxjs/internal/observable/combineLatest';

const none = {};

Expand Down
2 changes: 1 addition & 1 deletion compat/symbol/iterator.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from 'rxjs/internal/symbol/iterator';
export {iterator} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/symbol/observable.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from 'rxjs/internal/symbol/observable';
export {observable} from 'rxjs/internal-compatibility';
2 changes: 1 addition & 1 deletion compat/symbol/rxSubscriber.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from 'rxjs/internal/symbol/rxSubscriber';
export {rxSubscriber} from 'rxjs/internal-compatibility';
222 changes: 118 additions & 104 deletions src/internal-compatibility/index.ts
Original file line number Diff line number Diff line change
@@ -1,105 +1,119 @@
export {audit} from '../internal/patching/operator/audit';
export {auditTime} from '../internal/patching/operator/auditTime';
export {buffer} from '../internal/patching/operator/buffer';
export {bufferCount} from '../internal/patching/operator/bufferCount';
export {bufferTime} from '../internal/patching/operator/bufferTime';
export {bufferToggle} from '../internal/patching/operator/bufferToggle';
export {bufferWhen} from '../internal/patching/operator/bufferWhen';
export {_catch} from '../internal/patching/operator/catch';
export {combineAll} from '../internal/patching/operator/combineAll';
export {combineLatest} from '../internal/patching/operator/combineLatest';
export {concat} from '../internal/patching/operator/concat';
export {concatAll} from '../internal/patching/operator/concatAll';
export {concatMap} from '../internal/patching/operator/concatMap';
export {concatMapTo} from '../internal/patching/operator/concatMapTo';
export {count} from '../internal/patching/operator/count';
export {debounce} from '../internal/patching/operator/debounce';
export {debounceTime} from '../internal/patching/operator/debounceTime';
export {defaultIfEmpty} from '../internal/patching/operator/defaultIfEmpty';
export {delay} from '../internal/patching/operator/delay';
export {delayWhen} from '../internal/patching/operator/delayWhen';
export {dematerialize} from '../internal/patching/operator/dematerialize';
export {distinct} from '../internal/patching/operator/distinct';
export {distinctUntilChanged} from '../internal/patching/operator/distinctUntilChanged';
export {distinctUntilKeyChanged} from '../internal/patching/operator/distinctUntilKeyChanged';
export {_do} from '../internal/patching/operator/do';
export {elementAt} from '../internal/patching/operator/elementAt';
export {every} from '../internal/patching/operator/every';
export {exhaust} from '../internal/patching/operator/exhaust';
export {exhaustMap} from '../internal/patching/operator/exhaustMap';
export {expand} from '../internal/patching/operator/expand';
export {filter} from '../internal/patching/operator/filter';
export {_finally} from '../internal/patching/operator/finally';
export {find} from '../internal/patching/operator/find';
export {findIndex} from '../internal/patching/operator/findIndex';
export {first} from '../internal/patching/operator/first';
export {groupBy} from '../internal/patching/operator/groupBy';
export {ignoreElements} from '../internal/patching/operator/ignoreElements';
export {isEmpty} from '../internal/patching/operator/isEmpty';
export {last} from '../internal/patching/operator/last';
export {letProto} from '../internal/patching/operator/let';
export {map} from '../internal/patching/operator/map';
export {mapTo} from '../internal/patching/operator/mapTo';
export {materialize} from '../internal/patching/operator/materialize';
export {max} from '../internal/patching/operator/max';
export {merge} from '../internal/patching/operator/merge';
export {mergeAll} from '../internal/patching/operator/mergeAll';
export {mergeMap} from '../internal/patching/operator/mergeMap';
export {mergeMapTo} from '../internal/patching/operator/mergeMapTo';
export {mergeScan} from '../internal/patching/operator/mergeScan';
export {min} from '../internal/patching/operator/min';
export {multicast} from '../internal/patching/operator/multicast';
export {observeOn} from '../internal/patching/operator/observeOn';
export {onErrorResumeNext} from '../internal/patching/operator/onErrorResumeNext';
export {pairwise} from '../internal/patching/operator/pairwise';
export {partition} from '../internal/patching/operator/partition';
export {pluck} from '../internal/patching/operator/pluck';
export {publish} from '../internal/patching/operator/publish';
export {publishBehavior} from '../internal/patching/operator/publishBehavior';
export {publishLast} from '../internal/patching/operator/publishLast';
export {publishReplay} from '../internal/patching/operator/publishReplay';
export {race} from '../internal/patching/operator/race';
export {reduce} from '../internal/patching/operator/reduce';
export {repeat} from '../internal/patching/operator/repeat';
export {repeatWhen} from '../internal/patching/operator/repeatWhen';
export {retry} from '../internal/patching/operator/retry';
export {retryWhen} from '../internal/patching/operator/retryWhen';
export {sample} from '../internal/patching/operator/sample';
export {sampleTime} from '../internal/patching/operator/sampleTime';
export {scan} from '../internal/patching/operator/scan';
export {sequenceEqual} from '../internal/patching/operator/sequenceEqual';
export {share} from '../internal/patching/operator/share';
export {shareReplay} from '../internal/patching/operator/shareReplay';
export {single} from '../internal/patching/operator/single';
export {skip} from '../internal/patching/operator/skip';
export {skipLast} from '../internal/patching/operator/skipLast';
export {skipUntil} from '../internal/patching/operator/skipUntil';
export {skipWhile} from '../internal/patching/operator/skipWhile';
export {startWith} from '../internal/patching/operator/startWith';
export {subscribeOn} from '../internal/patching/operator/subscribeOn';
export {_switch} from '../internal/patching/operator/switch';
export {switchMap} from '../internal/patching/operator/switchMap';
export {switchMapTo} from '../internal/patching/operator/switchMapTo';
export {take} from '../internal/patching/operator/take';
export {takeLast} from '../internal/patching/operator/takeLast';
export {takeUntil} from '../internal/patching/operator/takeUntil';
export {takeWhile} from '../internal/patching/operator/takeWhile';
export {throttle} from '../internal/patching/operator/throttle';
export {throttleTime} from '../internal/patching/operator/throttleTime';
export {timeInterval} from '../internal/patching/operator/timeInterval';
export {timeout} from '../internal/patching/operator/timeout';
export {timeoutWith} from '../internal/patching/operator/timeoutWith';
export {timestamp} from '../internal/patching/operator/timestamp';
export {toArray} from '../internal/patching/operator/toArray';
export {toPromise} from '../internal/patching/operator/toPromise';
export {window} from '../internal/patching/operator/window';
export {windowCount} from '../internal/patching/operator/windowCount';
export {windowTime} from '../internal/patching/operator/windowTime';
export {windowToggle} from '../internal/patching/operator/windowToggle';
export {windowWhen} from '../internal/patching/operator/windowWhen';
export {withLatestFrom} from '../internal/patching/operator/withLatestFrom';
export {zipProto} from '../internal/patching/operator/zip';
export {zipAll} from '../internal/patching/operator/zipAll';
export { audit } from '../internal/patching/operator/audit';
export { auditTime } from '../internal/patching/operator/auditTime';
export { buffer } from '../internal/patching/operator/buffer';
export { bufferCount } from '../internal/patching/operator/bufferCount';
export { bufferTime } from '../internal/patching/operator/bufferTime';
export { bufferToggle } from '../internal/patching/operator/bufferToggle';
export { bufferWhen } from '../internal/patching/operator/bufferWhen';
export { _catch } from '../internal/patching/operator/catch';
export { combineAll } from '../internal/patching/operator/combineAll';
export { combineLatest } from '../internal/patching/operator/combineLatest';
export { concat } from '../internal/patching/operator/concat';
export { concatAll } from '../internal/patching/operator/concatAll';
export { concatMap } from '../internal/patching/operator/concatMap';
export { concatMapTo } from '../internal/patching/operator/concatMapTo';
export { count } from '../internal/patching/operator/count';
export { debounce } from '../internal/patching/operator/debounce';
export { debounceTime } from '../internal/patching/operator/debounceTime';
export { defaultIfEmpty } from '../internal/patching/operator/defaultIfEmpty';
export { delay } from '../internal/patching/operator/delay';
export { delayWhen } from '../internal/patching/operator/delayWhen';
export { dematerialize } from '../internal/patching/operator/dematerialize';
export { distinct } from '../internal/patching/operator/distinct';
export { distinctUntilChanged } from '../internal/patching/operator/distinctUntilChanged';
export { distinctUntilKeyChanged } from '../internal/patching/operator/distinctUntilKeyChanged';
export { _do } from '../internal/patching/operator/do';
export { elementAt } from '../internal/patching/operator/elementAt';
export { every } from '../internal/patching/operator/every';
export { exhaust } from '../internal/patching/operator/exhaust';
export { exhaustMap } from '../internal/patching/operator/exhaustMap';
export { expand } from '../internal/patching/operator/expand';
export { filter } from '../internal/patching/operator/filter';
export { _finally } from '../internal/patching/operator/finally';
export { find } from '../internal/patching/operator/find';
export { findIndex } from '../internal/patching/operator/findIndex';
export { first } from '../internal/patching/operator/first';
export { groupBy } from '../internal/patching/operator/groupBy';
export { ignoreElements } from '../internal/patching/operator/ignoreElements';
export { isEmpty } from '../internal/patching/operator/isEmpty';
export { last } from '../internal/patching/operator/last';
export { letProto } from '../internal/patching/operator/let';
export { map } from '../internal/patching/operator/map';
export { mapTo } from '../internal/patching/operator/mapTo';
export { materialize } from '../internal/patching/operator/materialize';
export { max } from '../internal/patching/operator/max';
export { merge } from '../internal/patching/operator/merge';
export { mergeAll } from '../internal/patching/operator/mergeAll';
export { mergeMap } from '../internal/patching/operator/mergeMap';
export { mergeMapTo } from '../internal/patching/operator/mergeMapTo';
export { mergeScan } from '../internal/patching/operator/mergeScan';
export { min } from '../internal/patching/operator/min';
export { multicast } from '../internal/patching/operator/multicast';
export { observeOn } from '../internal/patching/operator/observeOn';
export { onErrorResumeNext } from '../internal/patching/operator/onErrorResumeNext';
export { pairwise } from '../internal/patching/operator/pairwise';
export { partition } from '../internal/patching/operator/partition';
export { pluck } from '../internal/patching/operator/pluck';
export { publish } from '../internal/patching/operator/publish';
export { publishBehavior } from '../internal/patching/operator/publishBehavior';
export { publishLast } from '../internal/patching/operator/publishLast';
export { publishReplay } from '../internal/patching/operator/publishReplay';
export { race } from '../internal/patching/operator/race';
export { reduce } from '../internal/patching/operator/reduce';
export { repeat } from '../internal/patching/operator/repeat';
export { repeatWhen } from '../internal/patching/operator/repeatWhen';
export { retry } from '../internal/patching/operator/retry';
export { retryWhen } from '../internal/patching/operator/retryWhen';
export { sample } from '../internal/patching/operator/sample';
export { sampleTime } from '../internal/patching/operator/sampleTime';
export { scan } from '../internal/patching/operator/scan';
export { sequenceEqual } from '../internal/patching/operator/sequenceEqual';
export { share } from '../internal/patching/operator/share';
export { shareReplay } from '../internal/patching/operator/shareReplay';
export { single } from '../internal/patching/operator/single';
export { skip } from '../internal/patching/operator/skip';
export { skipLast } from '../internal/patching/operator/skipLast';
export { skipUntil } from '../internal/patching/operator/skipUntil';
export { skipWhile } from '../internal/patching/operator/skipWhile';
export { startWith } from '../internal/patching/operator/startWith';
export { subscribeOn } from '../internal/patching/operator/subscribeOn';
export { _switch } from '../internal/patching/operator/switch';
export { switchMap } from '../internal/patching/operator/switchMap';
export { switchMapTo } from '../internal/patching/operator/switchMapTo';
export { take } from '../internal/patching/operator/take';
export { takeLast } from '../internal/patching/operator/takeLast';
export { takeUntil } from '../internal/patching/operator/takeUntil';
export { takeWhile } from '../internal/patching/operator/takeWhile';
export { throttle } from '../internal/patching/operator/throttle';
export { throttleTime } from '../internal/patching/operator/throttleTime';
export { timeInterval } from '../internal/patching/operator/timeInterval';
export { timeout } from '../internal/patching/operator/timeout';
export { timeoutWith } from '../internal/patching/operator/timeoutWith';
export { timestamp } from '../internal/patching/operator/timestamp';
export { toArray } from '../internal/patching/operator/toArray';
export { toPromise } from '../internal/patching/operator/toPromise';
export { window } from '../internal/patching/operator/window';
export { windowCount } from '../internal/patching/operator/windowCount';
export { windowTime } from '../internal/patching/operator/windowTime';
export { windowToggle } from '../internal/patching/operator/windowToggle';
export { windowWhen } from '../internal/patching/operator/windowWhen';
export { withLatestFrom } from '../internal/patching/operator/withLatestFrom';
export { zipProto } from '../internal/patching/operator/zip';
export { zipAll } from '../internal/patching/operator/zipAll';

export {isArray} from '../internal/util/isArray';
export {subscribeToResult} from '../internal/util/subscribeToResult';
export { InnerSubscriber } from '../internal/InnerSubscriber';
export { OuterSubscriber } from '../internal/OuterSubscriber';
export { Scheduler } from '../internal/Scheduler';
export { SubjectSubscription } from '../internal/SubjectSubscription';
export { Subscriber } from '../internal/Subscriber';

export { fromPromise } from '../internal/observable/fromPromise';
export { AjaxCreationMethod } from '../internal/observable/dom/AjaxObservable';
export { CombineLatestOperator } from '../internal/observable/combineLatest';

export { rxSubscriber } from '../internal/symbol/rxSubscriber';
export { iterator } from '../internal/symbol/iterator';
export { observable } from '../internal/symbol/observable';

export { isArray } from '../internal/util/isArray';
export { subscribeToResult } from '../internal/util/subscribeToResult';
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
"rxjs": ["./src/index"],
"rxjs/*": ["./src/*"],
"rxjs/internal-compatibility": ["./src/internal-compatibility/index"],
"rxjs/ajax": ["./src/ajax/index"],
"rxjs/operators": ["./src/operators/index"],
"rxjs/testing": ["./src/testing/index"],
"rxjs/websocket": ["./src/websocket/index"],
"rxjs-compat": ["./compat/index"],
"rxjs-compat/*": ["./compat/*"]
}
}
},
"exclude": ["./dist", "./dist-compat"]
}

0 comments on commit 6131529

Please sign in to comment.