Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated testing for transpile issues in worker modules #133

Open
lojjic opened this issue Jun 2, 2021 · 0 comments
Open

Automated testing for transpile issues in worker modules #133

lojjic opened this issue Jun 2, 2021 · 0 comments

Comments

@lojjic
Copy link
Collaborator

lojjic commented Jun 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant