build(TreeDiffer): don't assume that rootPaths to dirty check are imm…#2053
build(TreeDiffer): don't assume that rootPaths to dirty check are imm…#2053IgorMinar wants to merge 1 commit intoangular:masterfrom
Conversation
|
this PR is still throwing exceptions in some cases, it needs more work... |
There was a problem hiding this comment.
So, if I understand this, broccoli sometimes changes the inputPath for us, and we need to be able to propagate that change to the TreeDiffer, and we do that here by passing it in here, right?
But, (some) plugins still think they need to use the old inputPath, they don't have any idea that it changed
There was a problem hiding this comment.
looks like it to me. my patch is failing in some cases so I need to investigate it further. initial explorations showed that the output path for certain plugins like replace and mergeTrees was not immutable.
There was a problem hiding this comment.
Have you thought about something like this?
class DiffingPluginWrapper {
get inputPath() { return this._inputPath; }
set inputPath(path) {
this._inputPath = path;
// propagate the change to wrapped plugin
if (this.initialized) this.wrappedPlugin.inputPath = path;
}
// etc
}https://github.com/IgorMinar/angular/pull/1/files working example (tested with test.unit.tools and test.unit.cjs)
There was a problem hiding this comment.
I did think about that, but it is simply wrong that the input path changes. The plugin should be the owner of the inputPath state and nobody else should change it, otherwise the whole system is unstable and it's easy to make assumptions that the input path doesn't change and cache absolute paths somewhere.
I have a different PR in works that stabilizes the input path.
There was a problem hiding this comment.
The contracts for these properties are pseudo-documented in the broccolijs codebase, but it's not clear how strong those contracts are.
There was a problem hiding this comment.
There's a problem here: fingerprints still contain old absolute paths, so fingerprints basically need a reset (or alternatively, the fingerprints object keys need to be the relative path rather than absolute)
There was a problem hiding this comment.
it should be a relative path
There was a problem hiding this comment.
For posteriority: I must have had a subtle error when trying the relativePath stuff before, it seems to work correctly now (so virtualPath is not needed) --- updating the pr
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…utable
Closes #2051