Repository navigation
feat: support for opt-in caching - #268
Conversation
|
Hi @mrmckeb, would you be able to review this? |
|
Hi @simon-paris, sorry for the long delay. I changed jobs and moved cities over the last few months and didn't get much free time for open source. I'll take a look at this with some other changes this weekend hopefully! :) |
|
hi @mrmckeb can you help review this one? |
|
dead repo, i guess |
|
Sorry, a lot has happened since this PR was raised and I haven't made many updates to this repo in a while. I've also been waiting to understand the plan for plugins with TypeScript 7, as that's currently incompatible with all TypeScript plugins - #301. However, I recognise there are some big QOL updates that I can make, so I'll block some time out to take a look at those. Keep in mind that I'm a sole maintainer, and that I work on this in my personal time. |
This adds caching, which is off by default and enabled using
{caching: "always"}. It works by mapping from snapshots provided by typescript to snapshots generated by the plugin using a WeakMap.The
cachingoption allows"always" | "never". I chose to use a union instead of a bool to 1) later support for a third "only when safe" or "only when supported" option, and 2) to help indicate that it might be too aggressive since "always" sounds stronger than true.Fixes #215
cc @jsliang