emberjs / ember-test-waiters

An Ember addon to allow @ember/test-helpers to manage asynchronous operations
MIT License
29 stars 15 forks source link

Look in to using `@embroider/macros` for better production stripping #484

Open NullVoxPopuli opened 2 months ago

NullVoxPopuli commented 2 months ago

macros use a babel plugin for dead code elimination, which is more reliable than assuming folks get their terser config correct (what test-waiters currently relies on)

NullVoxPopuli commented 2 months ago

Current approach is using DEBUG from @glimmer/env (which is also via babel plugin, but without the dead-code-elimination).

maybe we can have better stripping similar to this strategy:

export const registerWaiter = DEV ? _realRegisterWaiter : voidFunction;
export const waitForPromise = DEV ? _realWaitForPromise : identityFunction;
// etc