gulpjs / vinyl

Virtual file format.
MIT License
1.28k stars 107 forks source link

Unique ID #131

Closed phated closed 7 years ago

phated commented 7 years ago

I was working on option resolution consolidation in vinyl-fs (https://github.com/gulpjs/vinyl-fs/pull/239) and found that it would be really helpful to have a unique ID on each vinyl object.

@contra @erikkemperman thoughts?

phated commented 7 years ago

Would this be a breaking change because someone might have been assigning an id property to the object already?

phated commented 7 years ago

I think it's probably just better for us to use a WeakMap shim (which attaches a unique key to the object) instead of making this change to the API.