You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the fact that worker module functions must be entirely self-contained without any closure references, it's sometimes possible for transpilers like Babel to break them by injecting helper functions, e.g. for class creation or array destructuring.
Other than being careful about which ES6+ features I use in worker code, I'd like to have an automated way to detect issues prior to releasing.
In bidi-js I added an automated test phase that transpiles using babel before running the test suite, which should catch any injected references to external helpers. It may be possible to adapt this approach to both the troika-worker-utils tests plus any usages of createWorkerModule elsewhere in troika like in the text and ui packages.
This would also make me feel much safer about removing the Buble transpile from the UMD build files entirely and letting downstream bundlers perform their own transpilation as needed.
The text was updated successfully, but these errors were encountered:
Due to the fact that worker module functions must be entirely self-contained without any closure references, it's sometimes possible for transpilers like Babel to break them by injecting helper functions, e.g. for
class
creation or array destructuring.Other than being careful about which ES6+ features I use in worker code, I'd like to have an automated way to detect issues prior to releasing.
In bidi-js I added an automated test phase that transpiles using babel before running the test suite, which should catch any injected references to external helpers. It may be possible to adapt this approach to both the
troika-worker-utils
tests plus any usages of createWorkerModule elsewhere in troika like in the text and ui packages.This would also make me feel much safer about removing the Buble transpile from the UMD build files entirely and letting downstream bundlers perform their own transpilation as needed.
The text was updated successfully, but these errors were encountered: