Output cache: an option for its directory, so every project in a workspace can share one

Aperta
#34 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
64/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
angular, typescript, vite

Direzione di ricerca

Start by locating OutputCache and the code that reads config.cacheDir; the issue does not name files or tests, so trace how the cache directory is configured and used. Add a cache directory option that lets separate projects share a workspace level directory, then check the existing cache tests and add coverage for the configured path and concurrent writes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature

Part of #27.

Why

In a monorepo most of what a project's specs compile isn't the project's own code: in a sample of 80 projects, 80% of ngp's compile time went to files another project had already compiled. With one cache shared by the projects on an agent, a full run's summed task time drops 62% and the cache on disk goes from 34.7 GB to 1.8 GB. Today we get there with cache: false, our own Vitest cache key and a patch on Vitest; this and the other cache sub-issues of #27 would let us delete all three.

Problem

The cache lives in config.cacheDir, which is per project when each project has its own package.json.

Proposed change

An option for the directory, for example cache: { dir }, so every project can point at one workspace-level directory. OutputCache already writes through a temp file and a rename, so concurrent processes are safe.

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).

Lingua principale
TypeScript
Stelle
7
Fork
0
Merge medio
12h 24m
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di push-based/vite-plugin-ngp

Tutte le issue di push-based/vite-plugin-ngp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.