Skip to content

Commit

Permalink
fix: remove the root operators.ts because it overshadows operators/pa…
Browse files Browse the repository at this point in the history
…ckage.json

This affects SystemJS compatibility because we now need to add packages configuration for all
entry-points but there seems to be no way to satify everyone.

The operators/package.json file is needed in order to make prod build resolution work, so we
prefer to keep this working and ask SystemJS users to add extra configuration.

The SystemJS config after this change should be:

System.config({
  map: { 'rxjs': '/some/root/path/to/rxjs/' },
  packages: {
    'rxjs': {main: 'index.js', defaultExtension: 'js' },
    'rxjs/ajax': {main: 'index.js', defaultExtension: 'js' },
    'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
    'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
    'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' }
  }
});
  • Loading branch information
IgorMinar committed Mar 12, 2018
1 parent 4c4d7b0 commit 184b6d4
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
12 changes: 9 additions & 3 deletions integration/systemjs/systemjs-compatibility-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ var System = require('systemjs');
var path = require('path');

System.config({
map: { 'rxjs': path.join(__dirname, '..', '..', 'dist', 'cjs', '/') },
packages: { 'rxjs': {main: 'index.js', defaultExtension: 'js' }}
map: { 'rxjs': path.join(__dirname, '..', '..', 'dist', 'package', '/') },
packages: {
'rxjs': {main: 'index.js', defaultExtension: 'js' },
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js' },
'rxjs/operators': {main: 'index.js', defaultExtension: 'js' },
'rxjs/testing': {main: 'index.js', defaultExtension: 'js' },
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js' }
}
});

Promise.all([
Expand All @@ -14,7 +20,7 @@ Promise.all([
System.import('rxjs/websocket'),
]).then(
function () { console.log('Successfully tested all entry-points with SystemJS!'); },
function () {
function (error) {
console.error('\n\nFailed to load an entry-points via SystemJS: \n\n', error.message);
process.exit(-1);
}
Expand Down
1 change: 0 additions & 1 deletion src/ajax.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/operators.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/testing.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/websocket.ts

This file was deleted.

15 changes: 9 additions & 6 deletions tsconfig/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
"noEmit": false
},
"files": [
"../dist/src/internal/Rx.ts",
"../dist/src/add/observable/of.ts",
// entry-points
"../dist/src/index.ts",
"../dist/src/operators.ts",
"../dist/src/ajax.ts",
"../dist/src/websocket.ts",
"../dist/src/testing.ts"
"../dist/src/ajax/index.ts",
"../dist/src/operators/index.ts",
"../dist/src/testing/index.ts",
"../dist/src/websocket/index.ts",

// legacy entry-points
"../dist/src/internal/Rx.ts",
"../dist/src/add/observable/of.ts"
]
}

0 comments on commit 184b6d4

Please sign in to comment.