-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Description
Feature request
What is the expected behavior?
Promise new promise syntax (promised based dynamic remotes) gives excellent flexibility in defining remotes. However, the build output of this is too verbose, showing the entire body of the function in the build output.
What is motivation or use case for adding/changing the behavior?
Promise based dynamic remotes give great flexibility. But, the build output is hard to read, particularly when more than 1 promised based dynamic remote is specified. Other details of the build output can be obscured by the volume of the promised based dynamic remote output.
How should this be implemented in your opinion?
It looks like this output comes from the readableIdentifier function in ExternalModule.js. readableIdentifier appears to be part of the Module class, and is implemented differently for different module types. For external modules, it looks like this:
/**
* @param {RequestShortener} requestShortener the request shortener
* @returns {string} a user readable identifier of the module
*/
readableIdentifier(requestShortener) {
return "external " + JSON.stringify(this.request);
}
One possibly naive revision would be to truncate the stringified output to some maximum length. For example, change ExternalModule.js' method to look like this:
/**
* @param {RequestShortener} requestShortener the request shortener
* @returns {string} a user readable identifier of the module
*/
readableIdentifier(requestShortener) {
const maxLength = 80;
const stringifiedRequest = JSON.stringify(this.request);
return "external " + (stringifiedRequest.length > maxLength ? stringifiedRequest.substring(0, maxLength) + '...': stringifiedRequest)
}
Are you willing to work on this yourself?
yes, although someone else likely has a better understanding. I'd be happy to test and otherwise assist