Skip to content

Commit

Permalink
feat(rxjs-compat): removed for v7 (#4839)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `rxjs/Rx` is no longer a valid import site.
BREAKING CHANGE: `rxjs-compat` is not published for v7 (yet)
  • Loading branch information
benlesh authored Jun 10, 2019
1 parent 9026a36 commit 79b1b95
Show file tree
Hide file tree
Showing 921 changed files with 71 additions and 7,659 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ typings/

# Generated
dist/
dist-compat/
tmp/
coverage/
img/
Expand All @@ -26,4 +25,4 @@ npm-debug.log

# The check-side-effects package generates and deletes this file.
# If the process is killed, it will be left behind.
check-side-effects.tmp-input.js
check-side-effects.tmp-input.js
50 changes: 0 additions & 50 deletions .make-compat-package.js

This file was deleted.

25 changes: 1 addition & 24 deletions .make-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,7 @@ function copySources(rootDir, packageDir, ignoreMissing) {
fs.copySync('./README.md', packageDir + 'README.md');
}

// Create a file that exports the importTargets object
function createImportTargets(importTargets, targetName, targetDirectory) {
const importMap = {};
for (const x in importTargets) {
importMap['rxjs/' + x] = ('rxjs-compat/' + targetName + importTargets[x]).replace(/\.js$/, '');
}

const outputData =
`
"use strict"
var path = require('path');
var dir = path.resolve(__dirname);
module.exports = function() {
return ${JSON.stringify(importMap, null, 4)};
}
`

fs.outputFileSync(targetDirectory + 'path-mapping.js', outputData);
}

module.exports = {
copySources,
createImportTargets,
cleanSourceMapRoot
}
}
45 changes: 0 additions & 45 deletions .make-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ let addLicenseToFile = licenseTool.addLicenseToFile;
let addLicenseTextToFile = licenseTool.addLicenseTextToFile;
let makePackages = require('./.make-helpers');
let copySources = makePackages.copySources;
let createImportTargets = makePackages.createImportTargets;
let cleanSourceMapRoot = makePackages.cleanSourceMapRoot;
let bo = null;
// Build Optimizer is not available on Node 4.x. Using a try/catch
Expand All @@ -27,9 +26,7 @@ const ESM5_ROOT = ROOT + 'esm5/';
const ESM2015_ROOT = ROOT + 'esm2015/';
const UMD_ROOT = ROOT + 'global/';
const ESM5_FOR_ROLLUP_ROOT = ROOT + 'esm5_for_rollup/';
const LEGACY_REEXPORT_ROOT = ROOT + 'legacy-reexport/';
const TYPE_ROOT = ROOT + 'typings/';
const MIGRATION_PKG = ROOT + 'migrations/';
const PKG_ROOT = ROOT + 'package/';
const CJS_PKG = PKG_ROOT + '';
const ESM5_PKG = PKG_ROOT + '_esm5/';
Expand Down Expand Up @@ -75,50 +72,13 @@ klawSync(ESM5_ROOT, {
return fileName;
});

/**
* Get a list of the file names. Sort in reverse order so re-export files
* such as "operators.js" are AFTER their more specfic exports, such as
* "operators/map.js". This is due to a Webpack bug for node-resolved imports
* (rxjs/operators resolves to rxjs/operators.js), Webpack's "alias"
* functionality requires that the most broad mapping (rxjs/operators) be at
* the end of the alias mapping object. Created Webpack issue:
* https://github.com/webpack/webpack/issues/5870
*
* This is only needed for items in legacy-reexport as others should be resolved
* through their package.json.
*/
const fileNames = klawSync(LEGACY_REEXPORT_ROOT, {
nodir: true,
filter: function(item) {
return item.path.endsWith('.js');
}
})
.map(item => item.path)
.map(path => path.slice((`${__dirname}/${LEGACY_REEXPORT_ROOT}`).length))
.sort().reverse();

// Create an object hash mapping imports to file names
const importTargets = fileNames.reduce((acc, fileName) => {
// Get the name of the file to be the new directory
const directory = fileName.slice(0, fileName.length - 3);

acc[directory] = fileName;
return acc;
}, {});

createImportTargets(importTargets, "_esm5/", ESM5_PKG);
createImportTargets(importTargets, "_esm2015/", ESM2015_PKG);

// Make the distribution folder
mkdirp.sync(PKG_ROOT);

// Copy over the sources
copySources('src/', SRC_ROOT_PKG);
// Copy legacy-reexport sources
copySources('legacy-reexport/', SRC_ROOT_PKG);

copySources(CJS_ROOT, CJS_PKG);
fs.copySync(LEGACY_REEXPORT_ROOT, CJS_PKG, {overwrite: false, errorOnExist: true});

// Clean up the source maps for CJS sources
cleanSourceMapRoot(PKG_ROOT, SRC_ROOT_PKG);
Expand All @@ -137,11 +97,6 @@ fs.copySync('src/operators/package.json', PKG_ROOT + '/operators/package.json');
fs.copySync('src/ajax/package.json', PKG_ROOT + '/ajax/package.json');
fs.copySync('src/webSocket/package.json', PKG_ROOT + '/webSocket/package.json');
fs.copySync('src/testing/package.json', PKG_ROOT + '/testing/package.json');
fs.copySync('src/internal-compatibility/package.json', PKG_ROOT + '/internal-compatibility/package.json');

// Copy over migrations
fs.copySync(MIGRATION_PKG, PKG_ROOT + 'migrations/');
fs.copySync('./migrations/collection.json', PKG_ROOT + 'migrations/collection.json');

if (fs.existsSync(UMD_ROOT)) {
fs.copySync(UMD_ROOT, UMD_PKG);
Expand Down
1 change: 0 additions & 1 deletion compat/AsyncSubject.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/BehaviorSubject.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/InnerSubscriber.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/Notification.ts

This file was deleted.

2 changes: 0 additions & 2 deletions compat/Observable.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/Observer.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/Operator.ts

This file was deleted.

1 change: 0 additions & 1 deletion compat/OuterSubscriber.ts

This file was deleted.

15 changes: 0 additions & 15 deletions compat/README.md

This file was deleted.

1 change: 0 additions & 1 deletion compat/ReplaySubject.ts

This file was deleted.

Loading

0 comments on commit 79b1b95

Please sign in to comment.