go-typescript
go-typescript copied to clipboard
Optimize memory usage
This PR optimizes memory usage by doing a few things:
- Removes the default registry, this way if you register your own version, you're not stuck also loading the latest version.
- The registry lazily compiles by compiling Typescript only when a version is retrieved, not when it's registered.
- A new registry
ExpiringRegistryhas been added which can cache a compiled Typescript transpiler for a configurable amount of time before freeing.