1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
Commit graph

5025 commits

Author SHA1 Message Date
Felipe Baltor
ab2627a014
fix(test): request cloning should throw if body stream is locked (#19990)
Follow-up from #19869.
2023-08-01 18:24:42 +00:00
David Sherret
b563746885
fix: deno diagnostic - clarify where to put triple-slash directive (#20009)
Some people might not know what "entrypoint" means or where to put the
triple-slash directive.
2023-08-01 15:27:25 +00:00
Bartek Iwańczuk
5df2b0b4dc
fix: retry module download once if server errored (#17252)
Closes https://github.com/denoland/deno/issues/17251
Closes #19970

This commits adds logic to retry failed module downloads once.
Both request and server errors are handled and the retry is done after
50 ms wait time.
2023-08-01 10:52:28 +02:00
Bartek Iwańczuk
a05e890d56
chore: make LSP test less prone to changes (#20003)
This test was getting changed often, I modified it a bit
so it's less sensitive to changes in declaration files.
2023-07-31 21:31:30 -04:00
Leo Kettmeir
aa8078b688
feat(node/os): implement getPriority, setPriority & userInfo (#19370)
Takes #4202 over
Closes #17850 

---------

Co-authored-by: ecyrbe <ecyrbe@gmail.com>
2023-07-31 22:29:09 +02:00
Luca Casonato
78ceeec6be
perf: faster node globals access in cjs (#19997)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-31 19:45:32 +00:00
Nayeem Rahman
d5efdeeff1
refactor: update core extension api usage (#19952) 2023-07-31 18:19:15 +00:00
David Sherret
99daad0541
refactor: NodeCodeTranslator - optional source to translate_cjs_to_esm (#20000) 2023-07-31 17:46:58 +00:00
Matt Mastracci
43877f1209
chore(cli): Reduce port conflict in tests (#19988)
Ports are still occasionally causing CI flake -- allocate and separate
ports further for fetch/http tests.
2023-07-31 07:29:17 -06:00
Matt Mastracci
2fd87471e8
chore(cli): Fix test that locks up on some M2 macs (#19989)
I'm not sure why, but sending SIGABRT to Deno on my machine as part of
this test causes it to lock up very badly, leaving it in an unkillable
`UE+` state.

This showed up after #19333, but was not caused by it.
2023-07-31 07:29:00 -06:00
Nayeem Rahman
02865cb5a2
feat(bench): add BenchContext::start() and BenchContext::end() (#18734)
Closes #17589.
```ts
Deno.bench("foo", async (t) => {
  const resource = setup(); // not included in measurement
  t.start();
  measuredOperation(resource);
  t.end();
  resource.close(); // not included in measurement
});
```
2023-07-31 12:02:59 +02:00
Felipe Baltor
3cb260ed15
fix(Deno.serve): accessing .url on cloned request throws (#19869)
This PR fixes #19818. The problem was that the new InnerRequest class does not initialize the fields urlList and urlListProcessed that are used during a request clone. The solution aims to be straightforward by simply initializing the missing properties during the clone process. I also implemented a "cache" to the url getter of the new InnerRequest, avoiding the cost of calling op_http_get_request_method_and_url.
2023-07-30 09:13:28 -04:00
David Sherret
cfdef0c380
chore: remove println in DenoCompileBinaryWriter (#19976) 2023-07-29 14:06:47 +02:00
JasperVanEsveld
0ec4feaee7
feat(compile): Add --no-terminal to compile command (#17991) 2023-07-28 18:46:26 +03:00
Bartek Iwańczuk
a9951e360c
refactor(cli/tools): split bench into multiple modules (#19974)
I was asked to add "iter/s" to the benchmark output, before attempting
that I wanted to split this into multiple modules.
2023-07-28 11:27:10 -04:00
David Sherret
279030f2b8
fix(npm): improve declaration resolution for filename with different extensions (#19966)
postcss was importing `./index.js` from `./index.d.mts` where there also
existed a `./index.d.ts`.

Closes #19575
2023-07-28 11:24:22 -04:00
Divy Srivastava
bddf5acf89
chore: remove unused dependencies (#19962) 2023-07-28 15:10:13 +05:30
Leo Kettmeir
5cb1d18439
feat: Deno.createHttpClient allowHost (#19689)
This adds an option to allow using the host header in a fetch call.
Closes https://github.com/denoland/deno/issues/16840
Ref https://github.com/denoland/deno/issues/11017
2023-07-28 09:01:06 +02:00
David Sherret
fa52b5e733
fix: do not include jsx without @ts-check in tsc roots (#19964)
Closes #19928
2023-07-27 14:09:02 -04:00
Luca Casonato
7b29f1c934
chore: cleanup EmbeddedModuleLoader (#19911)
Source code is now not cloned anymore between eszip and deno_core, as
eszip now
returns `Arc<[u8]>`, that can be trivially casted into `Arc<str>`, which
`deno_core` can consume without copying.
2023-07-27 16:38:32 +00:00
David Sherret
02d6bbff2c
fix: error on invalid & unsupported jsx compiler options (#19954) 2023-07-27 12:15:39 -04:00
Bartek Iwańczuk
806137bb96
refactor(cli/test): move reporters to a separate directory (#19957)
Just a small cleanup that will make #19804 easier.
2023-07-27 02:16:12 +02:00
David Sherret
56e3daa19b
fix(lsp): handle import mapped node: specifier (#19956)
Closes https://github.com/denoland/vscode_deno/issues/805
2023-07-26 22:52:31 +00:00
Cooper Benson
0e4d6d41ad
feat(cli): Adding JUnit test reports (#19747)
This commit makes the following changes
- Created a `CompoundTestReporter` to allow us to use multiple reporters
- Implements `JUnitTestReporter` which writes JUnit XML to a path
- Added a CLI flag/option `--junit` that enables JUnit reporting. By
default this writes the report to `stdout` (and disables pretty
reporting). If a path is provided, it will write the JUnit report to
that file while the pretty reporter writes to stdout like normal

Output of `deno -- test --allow-all --unstable
--location=http://js-unit-tests/foo/bar --junit
cli/tests/unit/testing_test.ts `
```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="deno test" tests="7" failures="0" errors="0" time="0.176">
    <testsuite name="file:///Users/cooper/deno/deno/cli/tests/unit/testing_test.ts" tests="7" disabled="0" errors="0" failures="0">
        <testcase name="testWrongOverloads" time="0.012">
        </testcase>
        <testcase name="nameOfTestCaseCantBeEmpty" time="0.009">
        </testcase>
        <testcase name="invalidStepArguments" time="0.008">
        </testcase>
        <testcase name="nameOnTextContext" time="0.029">
            <properties>
                <property name="step[passed]" value="step ... nested step"/>
                <property name="step[passed]" value="step"/>
            </properties>
        </testcase>
        <testcase name="originOnTextContext" time="0.030">
            <properties>
                <property name="step[passed]" value="step ... nested step"/>
                <property name="step[passed]" value="step"/>
            </properties>
        </testcase>
        <testcase name="parentOnTextContext" time="0.030">
            <properties>
                <property name="step[passed]" value="step ... nested step"/>
                <property name="step[passed]" value="step"/>
            </properties>
        </testcase>
        <testcase name="explicit undefined for boolean options" time="0.009">
        </testcase>
    </testsuite>
</testsuites>
```
2023-07-27 00:12:35 +02:00
David Sherret
cf16df00d9
fix(check): should bust check cache when json module or npm resolution changes (#19941)
A small part of #19928.
2023-07-26 17:23:07 -04:00
denobot
89ba3f820c
1.35.3 (#19947)
Bumped versions for 1.35.3
Co-authored-by: mmastrac <mmastrac@users.noreply.github.com>
2023-07-26 10:18:02 -04:00
David Sherret
1d615b211e
fix(task): ensure quoted strings are maintained mid-word (#19944)
Closes #19942
2023-07-26 08:34:27 -04:00
Bartek Iwańczuk
67de67a106
chore: update chrono dependency (#19943)
Pulled from https://github.com/denoland/deno/pull/19747

Authored-by: Cooper Benson <skycoop@gmail.com>
2023-07-26 01:40:09 +00:00
Bartek Iwańczuk
06209f824c
perf: cache node resolution when accesing a global (#19930)
Reclaims some of the performance hit introduced by
https://github.com/denoland/deno/pull/19307.
2023-07-25 23:43:00 +02:00
Martin Fischer
5d8d1105a4
refactor: simplify signature of diagnose_resolution (#19753)
This commit makes the data flow in the
`diagnose_dependency` function more obvious.
2023-07-25 17:29:29 -04:00
Bartek Iwańczuk
88885d9c2b
fix(lint): allow to use --rules with --rules-tags (#19754) 2023-07-25 17:24:06 -04:00
Vedant Pandey
4a5aaceb26
fix: deno info should respect import map (#19781)
Closes #19742
2023-07-25 18:23:43 +02:00
Bartek Iwańczuk
bd79baea5e
fix(node): add writable and readable fields to FakeSocket (#19931)
Closes https://github.com/denoland/deno/issues/19927
2023-07-25 07:17:53 +00:00
Yoshiya Hinosawa
3d35900639
fix(ext/net): fix string port number handling in listen (#19921)
While string `port` is not allowed in typing, it seems we used to
support that and now it's broken. ref:
https://github.com/denoland/deno/issues/10064#issuecomment-1637427260

This PR restores the support of string port number in `listen` and
`listenTls`
2023-07-25 06:26:18 +00:00
李瑞丰
8053df2de6
fix(cli/test): fix clear screen behavior when run deno test --watch (#19888)
fix #19725
2023-07-25 06:07:54 +02:00
sitogi
b9765647de
fix(cli/init): update to assert/mod.ts (#19924) 2023-07-24 19:57:01 +00:00
David Sherret
40008c73bb
refactor(ext/node): CjsCodeAnalyzer - analyze_cjs optionally pass source text (#19896) 2023-07-24 15:35:13 -04:00
Jakub Jirutka
9b4a588d41
fix(cli): build script panics on musl due to glibc_version check (#19913)
musl supports dynamic list.

This patch comes from
cb58b125ad/dev-lang/deno/files/glibc.patch.

Resolves #17739

Note: This patch is already used in Alpine Linux’s
[deno](https://pkgs.alpinelinux.org/packages?name=deno) package.

Co-authored-by: 12101111 <w12101111@gmail.com>
2023-07-23 17:19:24 -06:00
Bartek Iwańczuk
a4e0f3ff88
chore: update deno_core to 0.196.0 (#19897)
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-07-23 13:42:41 +00:00
David Sherret
d6e086d681
fix(lsp): handle watched files events from symlinked config files (#19898)
Related to https://github.com/denoland/vscode_deno/issues/784
2023-07-21 09:12:26 -04:00
Leo Kettmeir
da709729e3
fix(node/http): add encrypted field to FakeSocket (#19886)
Fixes #19557
2023-07-21 02:18:07 +02:00
solach
5ff040bf59
fix(cli): output file handling in deno upgrade (#18994) 2023-07-20 19:51:02 +00:00
David Sherret
235fdc243f
fix(lsp): auto-discover deno.json in more cases (#19894)
We weren't auto-discovering the deno.json in two cases:

1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.

This now rediscovers it in both these cases.

Closes https://github.com/denoland/vscode_deno/issues/867
2023-07-20 14:05:52 -04:00
David Sherret
1ee6218e48
perf(lsp): format in a blocking task (#19883) 2023-07-20 15:28:40 +02:00
denobot
0c3bbf7acd
chore: forward v1.35.2 release commit to main (#19887)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-20 05:11:50 +02:00
Luca Casonato
e511022c74
feat(ext/node): properly segregate node globals (#19307)
Code run within Deno-mode and Node-mode should have access to a
slightly different set of globals. Previously this was done through a
compile time code-transform for Node-mode, but this is not ideal and has
many edge cases, for example Node's globalThis having a different
identity than Deno's globalThis.

This commit makes the `globalThis` of the entire runtime a semi-proxy.
This proxy returns a different set of globals depending on the caller's
mode. This is not a full proxy, because it is shadowed by "real"
properties on globalThis. This is done to avoid the overhead of a full
proxy for all globalThis operations.

The globals between Deno-mode and Node-mode are now properly segregated.
This means that code running in Deno-mode will not have access to Node's
globals, and vice versa. Deleting a managed global in Deno-mode will
NOT delete the corresponding global in Node-mode, and vice versa.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-07-19 10:30:04 +02:00
Leo Kettmeir
bf4e99cbd7
fix(node/http): call callback after request is sent (#19871)
Fixes #19762
2023-07-19 01:30:19 +02:00
sigmaSd
cfb9478a43
fix(runtime): print process name in case of spawn error (#19855)
Fix https://github.com/denoland/deno/issues/19400

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-07-19 01:24:30 +02:00
Leo Kettmeir
bab0294db6
fix(node/net): Server connection callback include socket value (#19779) 2023-07-19 00:33:43 +02:00
Bartek Iwańczuk
8a48fcc9d3
chore: disable rustls logging (#19859)
This commit disables internal logging coming from `rustls` crate.

So messages like:
```
TLS alert received: AlertMessagePayload {
    level: Fatal,
    description: UnknownCA,
}
```
will no longer appear unconditionally.
2023-07-17 16:49:03 -06:00