Deno: [Feature Request] Support partial reload

Created on 6 Sep 2019  路  2Comments  路  Source: denoland/deno

There is a simple project with only few of files, but huge number of dependences such as deno_std. Now, the project has updated. I need to update my local caches by running:

deno fetch -r https://my.project.host/app.js

The trouble is the deno will re-download all dependences.

If the --reload option support parameters for specifying which host or hosts need to update:

> deno fetch --reload=https://my.project.host https://my.project.host/app.js
> deno fetch \
  --reload=https://my.project.host \
  --reload=https://some-host.need-update.too \
  https://my.project.host/app.js

We can save lots of time.

Most helpful comment

currently working on it

All 2 comments

It is a good first issue in Rust.

Roughly what needs to be done:

  1. Configure reload CLI flag to match allow-read
    https://github.com/denoland/deno/blob/718c8c4360b5c42d1c0bcd97d7348908d915212e/cli/flags.rs#L57-L63
  2. Add new field to DenoFlags, eg. cache_blacklist, again look up example with read_whitelist
    https://github.com/denoland/deno/blob/718c8c4360b5c42d1c0bcd97d7348908d915212e/cli/flags.rs#L32
  3. Add this new cache_blacklist field to SourceFileFetcher and it's new method
    https://github.com/denoland/deno/blob/718c8c4360b5c42d1c0bcd97d7348908d915212e/cli/file_fetcher.rs#L69-L75
  4. Handle blacklist appropriately in SourceFileFetcher::get_source_file_async and SourceFileFetcher::fetch_remote_source_async - ie. add some URL pattern matching

This flag should support only remote files (http/https, because local files are always fetched from disk and not cached internally).

currently working on it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xueqingxiao picture xueqingxiao  路  3Comments

ry picture ry  路  3Comments

zugende picture zugende  路  3Comments

CruxCv picture CruxCv  路  3Comments

benjamingr picture benjamingr  路  3Comments