Skip to content

Commit

Permalink
entry point: remove unused code
Browse files Browse the repository at this point in the history
Summary: Removes code that is no longer used

Reviewed By: matryoshcow

Differential Revision: D4021932

fbshipit-source-id: d73dc8450478288afd71eab451a30a505e7de945
  • Loading branch information
davidaurelio authored and Facebook Github Bot committed Oct 18, 2016
1 parent 4d0b3e6 commit 7762f37
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions packager/react-packager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,53 +16,7 @@ var debug = require('debug');
var Activity = require('./src/Activity');

exports.createServer = createServer;
exports.middleware = function(options) {
var server = createServer(options);
return server.processRequest.bind(server);
};

exports.Activity = Activity;

// Renamed "package" to "bundle". But maintain backwards
// compat.
exports.buildPackage =
exports.buildBundle = function(options, bundleOptions) {
var server = createNonPersistentServer(options);
return server.buildBundle(bundleOptions)
.then(function(p) {
server.end();
return p;
});
};

exports.buildPrepackBundle = function(options, bundleOptions) {
var server = createNonPersistentServer(options);
return server.buildPrepackBundle(bundleOptions)
.then(function(p) {
server.end();
return p;
});
};

exports.buildPackageFromUrl =
exports.buildBundleFromUrl = function(options, reqUrl) {
var server = createNonPersistentServer(options);
return server.buildBundleFromUrl(reqUrl)
.then(function(p) {
server.end();
return p;
});
};

exports.getDependencies = function(options, bundleOptions) {
var server = createNonPersistentServer(options);
return server.getDependencies(bundleOptions)
.then(function(r) {
server.end();
return r.dependencies;
});
};

exports.getOrderedDependencyPaths = function(options, bundleOptions) {
var server = createNonPersistentServer(options);
return server.getOrderedDependencyPaths(bundleOptions)
Expand Down

7 comments on commit 7762f37

@akaila
Copy link

@akaila akaila commented on 7762f37 Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there,

I am wondering why these methods were removed from packager. This is a public API documented in react-packager that we were using and pruning them in this fashion is not the best engineering practice. Can this be restored / can I resubmit a revert for this?

Thanks
Ashish

@davidaurelio
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for breaking you. Could you tell me how you are using these functions? I didn’t even realise we have this sub-README lying around until now.

Packager will go through a lot of changes in the next months, and I need to be aware of what people are using.

@akaila
Copy link

@akaila akaila commented on 7762f37 Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there,

Thanks for quick reply. We have a gulpfile that creates packages based off our config and it goes through some custom logic that I cannot disclose. We then bind several scripts together using commonJS techniques at runtime. Providing an API for building bundles therefore is essential for our project.

Thanks
Ashish

@akaila
Copy link

@akaila akaila commented on 7762f37 Nov 16, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you list at high level changes we can expect in the packager thats in the pipeline.
Thanks

@davidaurelio
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are reorganising and rewriting a lot in the core – we can keep these APIs though if they are used. Are you using all of them, or only specific ones?

@akaila
Copy link

@akaila akaila commented on 7762f37 Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I am just using buildBundleFromUrl. However at the time I started it was the only method available. Diff above shows a whole lot of similar methods that is highly confusing. So if you can provide an equivalent of buildBundleFromUrl or buildPrepackBundle it would be sufficient.

@davidaurelio
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will do that

Please sign in to comment.