Output cache: confirm the key covers every file the compile read, transitively

Open
#36 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
angular, typescript, vite
Domain
build-system

Research direction

Start by reading the NgpCompiler cache key implementation and tracing how its metadata is built from imports and component resources. Check whether the key accounts for files reached through barrels and re-exports, then compare that behavior with the transitive file set described in the issue. Done means documenting the key’s coverage or extending it so shared cache entries account for every file the compile reads.

Written by the indexing model from the issue text.

Description

documentation

Part of #27.

Question

NgpCompiler's key is [cacheIdentity, file, code, resources, stableJson(metadata)]. Does metadata cover every file whose metadata the compile read, transitively through barrels and re-exports, and every resource of the components it imports?

Why

To share entries across projects safely, we key each app module on itself, its templateUrl/styleUrl files and every workspace file it reaches through imports, transitively (a 230-line module in our helper). If ngp's key already covers that, our key isn't needed. If not, it would be worth documenting what the key covers, or extending it.

Part of the shared-cache work in #27.

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.