Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "emit" and "map" from deno info --json output #17703

Closed
dsherret opened this issue Feb 9, 2023 · 2 comments · Fixed by #25468
Closed

Remove "emit" and "map" from deno info --json output #17703

dsherret opened this issue Feb 9, 2023 · 2 comments · Fixed by #25468
Assignees
Labels
breaking change a change or feature that breaks existing semantics perf performance related suggestion suggestions for new features (yet to be agreed)
Milestone

Comments

@dsherret
Copy link
Member

dsherret commented Feb 9, 2023

We should remove both "emit" and "map" from the output of deno info --json.

{
      "dependencies": [
        // etc...
      ],
      "kind": "esm",
      "local": "C:\\Users\\david\\AppData\\Local\\deno\\deps\\https\\deno.land\\08d9a8e609cf8dd460c936bbd31868d54b9fce2740085096564b2fada923e719",
      "emit": "C:\\Users\\david\\AppData\\Local\\deno\\gen\\https\\deno.land\\08d9a8e609cf8dd460c936bbd31868d54b9fce2740085096564b2fada923e719.js",
      "map": null,
      "size": 14342,
      "mediaType": "TypeScript",
      "specifier": "https://deno.land/x/oak@v11.1.0/util.ts"
    }

Reason to remove "map"

It is not used at all. This is always null.

Reason to remove "emit"

  1. It is extremely unreliable to depend on the emit file and nobody should be doing this. It might be out of date from the source and be completely wrong. Instead, people should get the local file then use deno_emit to get the emit https://github.com/denoland/deno_emit
  2. How we store the emit should be private data only known to the CLI. This will allow us to make performance optimizations.

Getting the emit meta-data with cache could be a single file read instead of multiple for example:

image

@dsherret dsherret added the suggestion suggestions for new features (yet to be agreed) label Feb 9, 2023
@dsherret dsherret added this to the 2.0.0 milestone Feb 9, 2023
@dsherret dsherret added perf performance related breaking change a change or feature that breaks existing semantics labels Feb 10, 2023
@bartlomieju
Copy link
Member

Check with https://github.com/lucacasonato/esbuild_deno_loader which changes are needed

@ry
Copy link
Member

ry commented Mar 21, 2024

text output of deno info should be shell parsable instead of

DENO_DIR location: /Users/ry/Library/Caches/deno
Remote modules cache: /Users/ry/Library/Caches/deno/deps
npm modules cache: /Users/ry/Library/Caches/deno/npm
Emitted modules cache: /Users/ry/Library/Caches/deno/gen
Language server registries cache: /Users/ry/Library/Caches/deno/registries
Origin storage: /Users/ry/Library/Caches/deno/location_data

it should be

DENO_DIR="/Users/ry/Library/Caches/deno"
DENO_REMOTE_CACHE="/Users/ry/Library/Caches/deno/deps"
DENO_NPM_CACHE="/Users/ry/Library/Caches/deno/npm"
DENO_EMITTED_CACHE="/Users/ry/Library/Caches/deno/gen"
DENO_LSP_REGISTRIES_CACHE="Users/ry/Library/Caches/deno/registries"
DENO_ORIGIN_STORAGE="/Users/ry/Library/Caches/deno/location_data"

@iuioiua iuioiua self-assigned this Jun 18, 2024
@dsherret dsherret changed the title Remove "emit" and "map" from deno info --json output Remove "map" from deno info --json output Sep 3, 2024
@dsherret dsherret changed the title Remove "map" from deno info --json output Remove "emit" and "map" from deno info --json output Sep 3, 2024
dsherret added a commit that referenced this issue Sep 5, 2024
The map field has been empty for years now and we don't want the emit
file to be exposed so it allows us to iterate on making the cache
faster. Additionally, it's racy/unreliable to rely on this information.
Instead, people should emit the TS files themselves using tools like
deno_emit, typescript, esbuild, etc.

Closes #17703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change a change or feature that breaks existing semantics perf performance related suggestion suggestions for new features (yet to be agreed)
Projects
None yet
4 participants