-
Notifications
You must be signed in to change notification settings - Fork 10
Optionally use user-provided output streams #65
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
base: master
Are you sure you want to change the base?
Conversation
|
@eggyal cool! |
|
Can you rebase on master (so this can be merged) and add some tests (and some docs)? |
|
@joeybaker: Rebase, tests and docs all done. |
|
Hm. There is actually a small problem when using this together with #63, since then the same streams are provided on each Perhaps instead of passing in an array of streams we should pass in a stream generator function that atomify-js would then call on each rebundle? What do you think, @joeybaker? |
prevents intermittent failures.
The documentation for [`_.values(object)`](https://lodash.com/docs#values) gives an example: > _.values(new Foo); > // → [1, 2] (iteration order is not guaranteed) Since "iteration order is not guaranteed", the array of streams passed to factor-bundle may not be in the same order as the corresponding files in `entries`. Factor bundle [depends on this correlation](https://github.com/substack/factor-bundle/blob/master/index.js#L73) when building its pipeline. This commit ensures that there is never a mismatch.
The [documentation for `stream-buffers` states](https://github.com/samcday/node-stream-buffer#disclaimer): > # Disclaimer # > > Not supposed to be a speed demon, it's more for tests/debugging or weird edge cases. It works with an internal buffer that it copies contents to/from/around. Moreover, users may wish to stream the results anyway, so buffering and then converting to a string only then to stream therefrom is rather wasteful.
|
Now using a generator function as described above. |
|
@eggyal nifty! The generator function makes a ton sense. My only nit-pick at this point, is that it looks like the rebase pulled in some commits to master. I can fix that up for you if you prefer? |
The documentation for
stream-buffersstates:Moreover, users may wish to stream the results anyway, so buffering and then converting to a string only then to stream therefrom is rather wasteful.