Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix race condition where last format transform overrides previous ones #1149
The transform function resolved by
This meant the last transform would override all of the previous ones,
Importing individual tests files in test/test would sometimes cause the whole test suite not to run if any of the tests failed; also sometimes the test suite finishes early for no apparent reason. This approach is meant to fix these issues. Providing glob patterns to the CLI is not practical in this case since the test folders holds code that is not meant to be run my mocha directly.
The transform function resolved by `transformInput` was handling the bundle concatenation to the event loop too early, causing future transforms (sharing the same graph) to reset the activeSourceKeys object where the result of transpiled graphs are kept, before the bundle was concatenated. This meant, the last transform would override all of the previous ones, instead of doing `return Promise.resolve().then(concatenateBundle)`, this commit creates a new promise that runs "concatenateBundle" right away instead of waiting for the next tick (and opening the window from future transforms to mutate the graph). Closes #1139