Output cache key misses the preprocessor's own code

Open Beginner friendly
#33 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
77/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
angular, typescript, vite

Research direction

Start in dist/output-cache.js and trace how pluginId() builds the output cache key. Check how it currently hashes dist/ and add the preprocessor JavaScript files under ngp/preprocessor/src to the inputs. Confirm that changing preprocessor code changes the key and that unchanged inputs keep it stable.

Written by the indexing model from the issue text.

Description

bug

Part of #27.

Problem

pluginId() hashes dist/, and toolchainId names the Angular commit, but neither covers ngp/preprocessor/src. A changed preprocessor (a patch, or a local build of ngp) keeps being served output it no longer produces.

Proposed change

Hash the preprocessor's .js files into pluginId() too (dist/output-cache.js), so the key covers every file that generates code.

Setup: ngp 0.3.0, @angular/compiler/compiler-cli 22.3.0-next.4, Vite 8, Vitest 5.1.0 (pool: 'forks'), a Nx monorepo with 1,035 Angular projects, one Vitest config each, specs written for TestBed under JIT (Analog).

Dominant language
TypeScript
Stars
7
Forks
1
Avg merge
12h 24m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from push-based/vite-plugin-ngp

All issues in push-based/vite-plugin-ngp

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.