-
-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constructor behavior when path and history are provided #95
Comments
@contra @darsain @Marak @erikkemperman any thoughts on this? |
I'm all for appending to history. Makes sense. |
It does sound very reasonable to append... But I notice that current behaviour does seem deliberate:
https://github.com/gulpjs/vinyl/blob/master/README.md#optionshistory |
@erikkemperman it would be a breaking change to be queued up for the 2.0 release. I can't see a reason for it to have no effect. |
Side notes: It looks like the original implementation in #24 had that behavior and then an issue for history cloning was noted in #35 (with the fix in d220c85). None of those mentioned or took into account what I am mentioning. But the docs for the feature were written in #48 which were just based on the behavior as implemented, as opposed to a conscious decision. |
Agreed, I think it makes a lot of sense. Just wanted to point out that the way it is now looked deliberate. |
@erikkemperman understandable, that's why I did the digging to see if it was. It doesn't seem to be. Maybe the path needs to be compared to the last history item before being set. If it is the same, don't add to history. |
The setter for |
Cool. I think there's a way to leverage that behavior in these changes then. |
I noticed in the PR (#94) that history is reset if a vinyl object is constructed with both a
path
andhistory
property; e.g.new Vinyl({ path: '/pets/cat', history: ['/pets/dog'] })
has['/pets/cat']
as the history.Shouldn't the constructor append the new path to the history if we specify both? In my example, it would result in
['/pets/dog', '/pets/cat']
as the history on the new object./cc @contra
The text was updated successfully, but these errors were encountered: