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

Different libs for worker and runtime? #1866

Closed
kitsonk opened this issue Mar 2, 2019 · 2 comments
Closed

Different libs for worker and runtime? #1866

kitsonk opened this issue Mar 2, 2019 · 2 comments

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Mar 2, 2019

Web worker support is on the roadmap (#1222). One consideration though is that instead of just including the worker lib for every transpiled TypeScript module, potentially leading to code that would cause runtime errors, we would only include the web worker lib when transpiling modules for a worker. It may not be suitable for an MVP, but in the longer term, it would provide a better experience.

Of course a counter argument is that there might be a desire to write isomorphic code that detects if it is running under a worker, which might raise errors if attempting to load in normal "userland".

@kitsonk
Copy link
Contributor Author

kitsonk commented Jun 3, 2019

@craigfay The Deno compiler currently checks all TypeScript code against an internal type library that includes all the non-DOM ES library information from TypeSCript (esnext). If the runtime APIs differ between the main user program and the worker program, the compiler should be able to enforce the consumption of those APIs in code too.

@bartlomieju
Copy link
Member

Done in #3728

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

2 participants