Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

feat: Reuse typescript program in between parses #40

Merged
merged 3 commits into from
Apr 2, 2019
Merged

feat: Reuse typescript program in between parses #40

merged 3 commits into from
Apr 2, 2019

Conversation

denieler
Copy link
Contributor

Because we are not reusing the same Typescript instance while parsing ts files there are this issue styleguidist/react-docgen-typescript#112 and this issue #37.

So here I've created a code, which reuse the same program in between parses in the same way as in ts-loader it's done (https://github.com/TypeStrong/ts-loader/blob/master/src/servicesHost.ts)

@denieler
Copy link
Contributor Author

@strothj please review

src/loader.ts Outdated Show resolved Hide resolved
@strothj
Copy link
Owner

strothj commented Mar 30, 2019

Awesome. I'll have some time to review this in more detail later today (Sunday).

I think one of the original concerns I had when working on this issue was about potential issues that could occur when using a multi-threaded build (https://github.com/TypeStrong/ts-loader#parallelising-builds). I'm not sure that's a valid concern anyways since the ts-loader docs now mention there's less benefit to doing that.

@denieler
Copy link
Contributor Author

@strothj hey! :) how is it going? :) can we merge it?

@strothj strothj merged commit 261c505 into strothj:master Apr 2, 2019
@strothj
Copy link
Owner

strothj commented Apr 2, 2019

Thanks for the pull request! I've published this as version 3.1.0. Let me know if you have any issues and sorry for the delay.

@zoltanbedi
Copy link

zoltanbedi commented Apr 4, 2019

While it does speed up the build I noticed that it is not working with the latest typescript (3.4.1) 😔
false alarm. it has nothing to do with this package. the problem is in styled components. see: microsoft/TypeScript#30663

@strann
Copy link

strann commented Apr 15, 2019

@strothj can this change be reflected in the underyling react-docgen-typescript package itself? We are using it directly in a node script and are seeing some very slow compile times as our package grows.

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

Successfully merging this pull request may close these issues.

5 participants