The node implementation of `getDefaultTranslationsFactory` is inefficient
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 234
- Forks
- 92
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 6
Description
https://github.com/Shopify/liquid-language-server/blob/main/packages/node/src/index.ts#L67-L92
Even though the body and parsed JSON is cached, we're re-reading the file contents on every call to runChecks.
A smarter approach would be to start a file watcher (presumably with chokidar to avoid weird node.js macos/windows file watch issues) and invalidate the cached value on file system file change.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/node/src/index.ts lines 67-92 and trace getDefaultTranslationsFactory through runChecks. Review how the body and parsed JSON are cached, then determine how file changes should invalidate that cache without rereading the file on every call. Done means file changes refresh the cached value while repeated runChecks calls avoid unnecessary reads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- performance, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100