Allow multiple trees as input to Filter#175
Allow multiple trees as input to Filter#175SparshithNR wants to merge 3 commits intobroccolijs:masterfrom
Conversation
34be033 to
37f31d9
Compare
9f820b2 to
7ba9626
Compare
ca98c0d to
b760b22
Compare
chriseppstein
left a comment
There was a problem hiding this comment.
I didn't review everything, but I have enough questions to pause at this point.
d084c3e to
9e01bda
Compare
Using fs-merger 1. Allow filter developers to reduce mergeTree or funneling entire array of trees to one tree and then pass it to filter 2. Allows input array of trees as input. input/output : 1. Provides good ergonomics and avoids appending the this.outputPath Test: 1. Added additional tests to make sure that Filter can take more than one tree
9e01bda to
bbe5f19
Compare
|
|
||
| constructor(inputTree, options) { | ||
| super([inputTree], { | ||
| get fsMerger() { |
There was a problem hiding this comment.
as implemented fsMerger is still part of the public API for subclasses, this seems sorta strange given the above weakmap usage.
|
Input output facade is addressed in #187. |
| try { | ||
| let result; | ||
| let srcPath = srcDir + '/' + relativePath; | ||
| let srcDir = this.inputPaths[0]; // keeping this line to maintain the signature of the fn. |
There was a problem hiding this comment.
Using this.inputPaths[0] here is breaking encapsulation, post this.input and this.output migration it should be possible to use only the new APIs, what features are missing or different approaches are required to make this statement true.
| case 'mkdir': { | ||
| instrumentation.mkdir++; | ||
| return fs.mkdirSync(outputPath); | ||
| return this.output.mkdirSync(outputPath, { recursive: true }); |
|
|
||
| if (this.dependencyInvalidation && !this.dependencies) { | ||
| this.dependencies = this.processor.initialDependencies(srcDir); | ||
| this.dependencies = this.processor.initialDependencies(this.inputPaths); |
| loggerName += ' > [' + annotation + ']'; | ||
| } | ||
|
|
||
| FSMERGER.set(this, { |
There was a problem hiding this comment.
Currently I am worried, that this plugin does not use this.input, did we make a mistake with it? By not using this.input we are making it hard for future optimizations, as ensuring all plugins go through this.input this.output opens many doors when it comes to future optimizations.
There was a problem hiding this comment.
We may have to make changes to the fs-merger library to somehow match inputPaths and input to broccoli-persistent-filter where we expect input can be broccoli-node string or an object with prefix/getDestinationPath function.
|
Closing this as #188 is addressing this |
Example:
Since we are now allowing users to pass two paths/nodes. We avoid a uncessary merge/funnel.
Before to achive the above result we had to below sinppet.