Age | Commit message (Collapse) | Author |
|
|
|
for a directory, and TS files from JS extensions (#21464)
Adds an `--unstable-sloppy-imports` flag which supports the
following for `file:` specifiers:
* Allows writing `./mod` in a specifier to do extension probing.
- ex. `import { Example } from "./example"` instead of `import { Example
} from "./example.ts"`
* Allows writing `./routes` to do directory extension probing for files
like `./routes/index.ts`
* Allows writing `./mod.js` for *mod.ts* files.
This functionality is **NOT RECOMMENDED** for general use with Deno:
1. It's not as optimal for perf:
https://marvinh.dev/blog/speeding-up-javascript-ecosystem-part-2/
1. It makes tooling in the ecosystem more complex in order to have to
understand this.
1. The "Deno way" is to be explicit about what you're doing. It's better
in the long run.
1. It doesn't work if published to the Deno registry because doing stuff
like extension probing with remote specifiers would be incredibly slow.
This is instead only recommended to help with migrating existing
projects to Deno. For example, it's very useful for getting CJS projects
written with import/export declaration working in Deno without modifying
module specifiers and for supporting TS ESM projects written with
`./mod.js` specifiers.
This feature will output warnings to guide the user towards correcting
their specifiers. Additionally, quick fixes are provided in the LSP to
update these specifiers:
|
|
|
|
Re-attempt at #21284. I was more thorough this time.
---------
Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
|
|
This commit changes LSP log names by prefixing them, we now have these
prefixes:
- `lsp.*` - requests coming from the client
- `tsc.request.*` - requests coming from clients that are routed to TSC
- `tsc.op.*` - ops called by the TS host
- `tsc.host.*` - requests that call JavaScript runtime that runs
TypeScript compiler host
Additionall `Performance::mark` was split into `Performance::mark` and
`Performance::mark_with_args` to reduce verbosity of code and logs.
|
|
|
|
closes #20566
|
|
managed `CliNpmResolver` (#20777)
Part of https://github.com/denoland/deno/issues/18967
|
|
This makes `CliNpmResolver` a trait. The terminology used is:
- **managed** - Deno manages the node_modules folder and does an
auto-install (ex. `ManagedCliNpmResolver`)
- **byonm** - "Bring your own node_modules" (ex. `ByonmCliNpmResolver`,
which is in this PR, but unimplemented at the moment)
Part of #18967
|
|
This is required from BYONM (bring your own node_modules).
Part of #18967
|
|
|
|
|
|
|
|
|
|
|
|
LSP testing APIs now obey the various file inclusion settings:
- Modules shown in the text explorer now respect the `exclude`,
`test.exclude` and `test.include` fields in `deno.json`, as well as
`deno.enablePaths` in VSCode settings.
- Modules with testing code lens now respect the `"exclude"`,
`test.exclude` and `test.include` fields in `deno.json`. Code lens
already respects `deno.enablePaths`.
|
|
|
|
This reverts commit 4a11603c76b13ecf92ce3141ec317a42ae9f8d1d.
|
|
Previously we pre-computed enabled paths into `Config::enabled_paths`,
and had to keep updating it. Now we determine enabled paths directly
from `Config::settings` on demand as a single source of truth.
Removes `Config::root_uri`. If `InitializeParams::rootUri` is given, and
it doesn't correspond to a folder in
`InitializeParams::workspaceFolders`, prepend it to
`Config::workspace_folders` as a mocked folder.
Includes groundwork for
https://github.com/denoland/vscode_deno/issues/908. In a minor version
cycle or two we can fix that in vscode_deno, and it won't break for Deno
versions post this patch due to the corrected deserialization logic for
`enablePaths`.
|
|
|
|
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
|
|
|
|
This reverts commit c0dcf6a3571ee04b4826c52d1329804e7c2b02c4.
CC @nayeemrmn
|
|
With https://github.com/denoland/vscode_deno/pull/902 for
https://github.com/denoland/vscode_deno/issues/880.
For multi-folder workspaces, note that this only scans the first one and
applies the result to all. That means users would have to still have to
specify `"deno.enable": true/false` for their secondary folders if the
preference is different for those.
|
|
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
Uses https://github.com/denoland/deno_cache/pull/26
|
|
Closes #20015
Closes https://github.com/denoland/vscode_deno/issues/850 (only for
deno_modules, but I don't think this will be possible for the global
cache)
|
|
Closes #15633
|
|
This commit makes the data flow in the
`diagnose_dependency` function more obvious.
|
|
Closes https://github.com/denoland/vscode_deno/issues/835
|
|
Part of https://github.com/denoland/vscode_deno/issues/835
|
|
messages (#19794)
|
|
This improves the HttpCache to make it being stored on the file system
an implementation detail.
|
|
Relands #18261 now that
https://github.com/lucacasonato/esbuild_deno_loader/pull/54 is landed
and used by fresh.
Fixes #18260.
|
|
This adds a new `PathRef` struct to test_util for making it easier to
work with paths in test code. I'm going to expand on this more in the
future.
|
|
Rather than disallowing `ext:` resolution, clear the module map after
initializing extensions so extension modules are anonymized. This
operation is explicitly called in `deno_runtime`. Re-inject `node:`
specifiers into the module map after doing this.
Fixes #17717.
|
|
Merge on approval as it fixes the flaky test.
|
|
This reverts commit 89026abe395c22eb2ace4ea5f948189daa1dadf1.
This change caused LSP benchmarks to fail on `main`.
|
|
Fixes the flaky lsp test by having better synchronization of diagnostics
between the client and server for testing purposes.
|
|
This adds support for the lockfile and node_modules directory to the
lsp.
In the case of the node_modules directory, it is only enabled when
explicitly opted into via `"nodeModulesDir": true` in the configuration
file. This is to reduce the language server automatically modifying the
node_modules directory when the user doesn't want it to.
Closes #16510
Closes #16373
|
|
(#19056)
Partially supersedes #19016.
This migrates `spawn` and `spawn_blocking` to `deno_core`, and removes
the requirement for `spawn` tasks to be `Send` given our single-threaded
executor.
While we don't need to technically do anything w/`spawn_blocking`, this
allows us to have a single `JoinHandle` type that works for both cases,
and allows us to more easily experiment with alternative
`spawn_blocking` implementations that do not require tokio (ie: rayon).
Async ops (+~35%):
Before:
```
time 1310 ms rate 763358
time 1267 ms rate 789265
time 1259 ms rate 794281
time 1266 ms rate 789889
```
After:
```
time 956 ms rate 1046025
time 954 ms rate 1048218
time 924 ms rate 1082251
time 920 ms rate 1086956
```
HTTP serve (+~4.4%):
Before:
```
Running 10s test @ http://localhost:4500
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 68.78us 19.77us 1.43ms 86.84%
Req/Sec 68.78k 5.00k 73.84k 91.58%
1381833 requests in 10.10s, 167.36MB read
Requests/sec: 136823.29
Transfer/sec: 16.57MB
```
After:
```
Running 10s test @ http://localhost:4500
2 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 63.12us 17.43us 1.11ms 85.13%
Req/Sec 71.82k 3.71k 77.02k 79.21%
1443195 requests in 10.10s, 174.79MB read
Requests/sec: 142921.99
Transfer/sec: 17.31MB
```
Suggested-By: alice@ryhl.io
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
Adds a `deno.preloadLimit` option (ex. `"deno.preloadLimit": 2000`)
which specifies how many file entries to traverse on the file system
when the lsp loads or its configuration changes.
Closes #18955
|
|
|
|
This is just a straight refactor and I didn't do any cleanup in
ext/node. After this PR we can start to clean it up and make things
private that don't need to be public anymore.
|
|
|
|
This was an oversight because the repl uses the language server under
the hood. Also, never preloads from a root directory.
Part of #18538
|
|
I think this makes things clearer at the call sites.
|
|
This upgrades TypeScript to 5.0.2, but does not have ES decorator
support because swc does not support that yet.
|