summaryrefslogtreecommitdiff
path: root/cli/cache/parsed_source.rs
AgeCommit message (Collapse)Author
2024-10-14feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": ↵David Sherret
"commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`).
2024-06-05fix: better handling of npm resolution occurring on workers (#24094)David Sherret
Closes https://github.com/denoland/deno/issues/24063
2024-05-21chore: add test to ensure parsing only happens once on first load (#23837)David Sherret
2024-04-14perf: do not clone swc `Program` when transpiling (#23365)David Sherret
2024-02-09fix: upgrade to deno_ast 0.33 (#22341)David Sherret
* Uses diagnostics from deno_ast * Real fix for https://github.com/denoland/deno/pull/22310 * Moves `deno lint --json` code here * Upgrades swc Closes #22117 Closes #22109 Closes #21927 Closes #20993
2024-02-06fix(publish): lazily parse sources (#22301)David Sherret
Closes #22290
2024-02-01refactor: load bytes in deno_graph (#22212)David Sherret
Upgrades deno_graph to 0.64 where deno_graph is now responsible for turning bytes into a string. This is in preparation for Wasm modules.
2024-01-09fix: update deno_lint and swc (#21718)Bartek Iwańczuk
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-10-25refactor: break out ModuleInfoCache from ParsedSourceCache (#20977)David Sherret
As title. This will help use the two independently from the other, which will help in an upcoming deno doc PR where I need to parse the source files with scope analysis.
2023-09-07feat: support import attributes (#20342)David Sherret
2023-07-10refactor(lsp): move config file related code to config.rs (#19790)David Sherret
Will make #19788 easier.
2023-06-14fix: reload config files on watcher restarts (#19487)David Sherret
Closes #19468
2023-04-14refactor: break up `ProcState` (#18707)David Sherret
1. Breaks up functionality within `ProcState` into several other structs to break out the responsibilities (`ProcState` is only a data struct now). 2. Moves towards being able to inject dependencies more easily and have functionality only require what it needs. 3. Exposes `Arc<T>` around the "service structs" instead of it being embedded within them. The idea behind embedding them was to reduce the verbosity of needing to pass around `Arc<...>`, but I don't think it was exactly working and as we move more of these structs to be more injectable I don't think the extra verbosity will be a big deal.
2023-03-27feat(core): initialize SQLite off-main-thread (#18401)Matt Mastracci
This gets SQLite off the flamegraph and reduces initialization time by somewhere between 0.2ms and 0.5ms. In addition, I took the opportunity to move all the cache management code to a single place and reduce duplication. While the PR has a net gain of lines, much of that is just being a bit more deliberate with how we're recovering from errors. The existing caches had various policies for dealing with cache corruption, so I've unified them and tried to isolate the decisions we make for recovery in a single place (see `open_connection` in `CacheDB`). The policy I chose was: 1. Retry twice to open on-disk caches 2. If that fails, try to delete the file and recreate it on-disk 3. If we fail to delete the file or re-create a new cache, use a fallback strategy that can be chosen per-cache: InMemory (temporary cache for the process run), BlackHole (ignore writes, return empty reads), or Error (fail on every operation). The caches all use the same general code now, and share the cache failure recovery policy. In addition, it cleans up a TODO in the `NodeAnalysisCache`.
2023-03-23refactor: make version and user_agent &'static str (#18400)Bartek Iwańczuk
These caused a bunch of unnecessary allocations on each startup.
2023-03-22perf: disable WAL for transpiled source cache (#18084)Bartek Iwańczuk
Disable Write-Ahead Log for the cached module source database. This brings SQLite connection cost on startup from 2.5% to 1.6%.
2023-03-21Revert "fix(cli) Better error messages on corrupt databases that aren… ↵Bartek Iwańczuk
(#18337) …'t automatically re-created (#18330)" This reverts commit 2ef8269fdb395b0736153ff5fbb9696cbb976e42. Printing these messages by default (instead of requiring `-L debug` flag) caused various tests to start printing it and mismatch in output assertions.
2023-03-21fix(cli) Better error messages on corrupt databases that aren't ↵Matt Mastracci
automatically re-created (#18330)
2023-02-22refactor: use deno_graph for npm specifiers (#17858)David Sherret
This changes npm specifiers to be handled by deno_graph and resolved to an npm package name and version when the specifier is encountered. It also slightly changes how npm specifier resolution occurs—previously it would collect all the npm specifiers and resolve them all at once, but now it resolves them on the fly as they are encountered in the module graph. https://github.com/denoland/deno_graph/pull/232 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-02-09perf: module info cache - avoid MediaType.to_string() allocation (#17699)David Sherret
Micro optimization because these allocations were coming up on a flame graph I was looking at (only 0.28% of total).
2023-02-03refactor: reland "preserve ProcState::file_fetcher between restarts" (#17636)Nayeem Rahman
Just some watcher init step that I thought would be "cloned over" but needs to be done again on reset.
2023-01-30Revert "fix(watch): preserve `ProcState::file_fetcher` between restarts ↵Bartek Iwańczuk
(#15466) (#17591) This reverts commit 3545bff678f20c3fdf17fe6b26f96cf1b74f917c.
2023-01-27chore(cli/cache): fewer string allocations (#17549)Geert-Jan Zwiers
2023-01-13chore: add `copyright_checker` tool and add the missing copyright (#17285)Yiyu Lin
2023-01-10fix(watch): preserve `ProcState::file_fetcher` between restarts (#15466)Nayeem Rahman
This commit changes "ProcState" to store "file_fetcher" field in an "Arc", allowing it to be preserved between restarts and thus keeping the state alive between the restarts. File watchers for "deno test" and "deno bench" now reset "ProcState" between restarts.
2022-11-23chore: more debug logging and avoid allocating strings in ts logging when ↵David Sherret
not debug (#16689)
2022-08-29fix(compile): panic when running with a populated dep analysis cache (#15672)David Sherret
Closes #15612
2022-08-22perf: cache swc dependency analysis and don't hold onto `ParsedSource`s in ↵David Sherret
memory (#15502)