1 thought on “web: inefficient shims for nextTick & setImmediate

  1. Hang on; no, this is backwards.

    • setImmediate should use the macrotask queue, which it does via the setimmediate shim, which is imported by timers-browserify, which webpack correctly uses. Note that this is still faster than setTimeout(func, 0). The OP was incorrect in saying that webpack uses setTimeout for setImmediate shimming; the current behavior is correct.
    • process.nextTick should use the microtask queue, (note this changed in Node 0.9 from macro -> micro), and is incorrectly shimmed by node-process to use setTimeout, when it should use something like next-tick which uses MutationObserver when available. This is the bug.

Comments are closed.