Skip to content

Commit

Permalink
chore(build): Build a umd bundle of rxjs-compat
Browse files Browse the repository at this point in the history
This introduces a build step for creating a umd bundle (and minified umd bundle)  of rxjs-compat.

This involved creating a new tsconfig for esm5 for rollup (no helpers), a new rollup build script for producing the bundle, and a closure build script for producing the minified bundle. Each was derived from their rxjs counterpart.

This also creates a `umd.ts` entrypoint in `rxjs-compat` which exposes `testing`, `operators`, etc. just like the rxjs umd entry.

Tested by using this bundle in place of the rxjs 5 bundle in [Nuclide](https://github.com/facebook/nuclide/)

Tested the performance impact of the unminified bundle by loading it in <=20ms with `for i in {1..5}; do node -p "s=Date.now();require('./dist-compat/global/rxjs-compat.umd');Date.now()-s"; done`. The commonjs entrypoint to `rxjs-compat` loaded in 130ms by comparison. Note this improvement over the [rxjs 5 bundle](#2064) which loads in 26ms -- I verified I could reproduce nearly @zertosh's exact values on the hardware I tested 6 on.

cc @zertosh @matthewwithanm @captbaritone
  • Loading branch information
wbinnssmith committed Jun 23, 2018
1 parent 01eefff commit 7cda94d
Show file tree
Hide file tree
Showing 6 changed files with 433 additions and 287 deletions.
22 changes: 22 additions & 0 deletions compat/umd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
NOTE: This is the global export file for rxjs v6 and higher.
*/

/* rxjs */
export * from './Rx';

/* rxjs.operators */
import * as _operators from 'rxjs/operators';
export const operators = _operators;

/* rxjs.testing */
import * as _testing from 'rxjs/testing';
export const testing = _testing;

/* rxjs.ajax */
import * as _ajax from 'rxjs/ajax';
export const ajax = _ajax;

/* rxjs.webSocket */
import * as _webSocket from 'rxjs/webSocket';
export const webSocket = _webSocket;
Loading

0 comments on commit 7cda94d

Please sign in to comment.