Add test for usage of trumpet inside element writable stream #32

wants to merge 2 commits into


None yet
2 participants

I am working on stream-based template rendering engine and I've found that some artifacts may appear with steps described below:

  • Create trumpet instance (T1)
  • Select by ID any HTML element using trumpet (T1) and create writable stream for it (W1)
  • Subscribe on 'drain' event of created element writable stream (W1)
  • When W1 'drain' event raises then create another trumpet (T2) instance inside event handler and create writable stream for another HTML element ID (W2) using this new instance of trumpet (T2)
  • Pipe any content or file through T2 to W2 (file.pipe(T2).pipe(W2))
  • And if we pipe to T1 any content with elements which ids were selected we have artifacts on output

Artifacts like character repeats or remove of character etc.
Here is unit test for found issue.
I need this for recursive template rendering, please help.


substack commented Jun 28, 2014

'drain' events were very rarely correctly supported in streams1 and not necessary in streams2, which is what trumpet currently uses internally since 1.6.4. 1.6.4 should fix the issues with character repeats and artifacts.

substack closed this Jun 28, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment