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
No shared code between compiler and runtime snapshots #6812
Comments
As I mentioned in other threads, I have started work on a stand alone compiler crate that would only have the code it needs to do TypeScript compiling, which would be a single file |
(It also incorporates the re-worked bundling that was in my PR for deno_typescript that moves the bundling out of TypeScript and emits valid source maps) |
This PR is intentionally ugly. It duplicates all of the code in cli/js2/ into cli/tsc/ ... because it's very important that we all understand that this code is unnecessarily duplicated in our binary. I hope this ugliness provides the motivation to clean it up. The typescript git submodule is removed, because it's a very large repo and contains all sorts of stuff we don't need. Instead the necessary files are copied directly into the deno repo. Hence +200k lines. COMPILER_SNAPSHOT.bin size ``` master 3448139 this branch 3320972 ``` Fixes #6812
Currently the runtime and compiler snapshot share a lot of code. Currently every function available in the runtime is available in the compiler snapshot:
fetch()
,setTimeout()
etc. However the compiler snapshot has no need for much of this code.The compiler and runtime have ultimately very different purposes. The runtime is exposed to users, the compiler is completely internal.
We want the compiler snapshot to be as small as possible.
Ref #6809
The text was updated successfully, but these errors were encountered: