0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

8017 commits

Author SHA1 Message Date
David Sherret
f583a7ebf4
chore(npm): add test for esm npm binary package (#15609) 2022-08-26 09:17:48 -04:00
Gabriele Mastrapasqua
f35900eb5b
fix: typo in deno_ops README (#15606) 2022-08-26 11:02:16 +05:30
Bartek Iwańczuk
da10c9c8d1
fix(ext/flash): panic on AddrInUse (#15607) 2022-08-26 08:42:11 +05:30
David Sherret
376665d115
fix: avoid global declaration collisions in cjs (#15608)
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
2022-08-25 20:24:18 -04:00
David Sherret
0fe590bbcb
chore: fix publish for circular dependencies (#15598) 2022-08-25 17:01:02 -04:00
Bartek Iwańczuk
e92d7add38
fix(ext/node): add missing primordial (#15595) 2022-08-25 15:34:47 +02:00
Bartek Iwańczuk
8986e2ced4
v1.25.0 2022-08-25 00:20:07 +02:00
Bartek Iwańczuk
fb1c7b7dea
fix(unstable): finish HTTP response for 205 and 304 responses (#15584)
This commit fixes "Deno.serve()" API by making sure that
205 and 304 responses end with "\r\n\r\n".
2022-08-24 21:26:57 +02:00
David Sherret
348291f5ec
fix(npm): always require --unstable flag even for esm (#15583) 2022-08-24 13:44:38 -04:00
David Sherret
18fcef8b29
fix(npm): cjs export analysis should take into consideration exports with dashes (#15582) 2022-08-24 13:37:34 -04:00
Luca Casonato
33c4d45328
fix: resolve jsxImportSource relative to module (#15561)
Previously `jsxImportSource` was resolved relative to the config file
during graph building, and relative to the emitted module during
runtime.

This is now fixed so that the JSX import source is resolved relative to
the module both during graph building and at runtime.
2022-08-24 19:36:05 +02:00
Bartek Iwańczuk
6bb72a8086
feat(unstable): add more permission checks for ext/node/ (#15581) 2022-08-24 18:07:49 +02:00
David Sherret
684aabbc25
feat: support subpaths in npm package references (#15578) 2022-08-24 11:25:32 -04:00
Bartek Iwańczuk
a4cc09447e
fix(unstable): Deno.serve() can parse hostnames (#15579) 2022-08-24 16:38:51 +02:00
Bartek Iwańczuk
5268fa0e0f
fix(unstable): various resolution bugs for npm: specifiers (#15546)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-24 14:54:20 +02:00
Luca Casonato
f3bde1d53b
feat(ext/flash): split upgradeHttp into two APIs (#15557)
This commit splits `Deno.upgradeHttp` into two different APIs, because
the same API is currently overloaded with two different functions. Flash
requests upgrade immediately, with no need to return a `Response`
object. Instead you have to manually write the response to the socket.
Hyper requests only upgrade once a `Response` object has been sent.

These two behaviours are now split into `Deno.upgradeHttp` and
`Deno.upgradeHttpRaw`. The latter is flash only. The former only
supports hyper requests at the moment, but can be updated to support
flash in the future.

Additionally this removes `void | Promise<void>` as valid return types
for the handler function. If one wants to use `Deno.upgradeHttpRaw`,
they will have to type cast the handler signature - the signature is
meant for the 99.99%, and should not be complicated for the 0.01% that
use `Deno.upgradeHttpRaw()`.
2022-08-24 17:40:57 +05:30
David Sherret
452df99222
feat(npm): support packages with multiple command names (#15565) 2022-08-23 22:01:21 -04:00
Luca Casonato
4ef08a58df
feat: update Deno.serve function signature (#15563)
This commit changes the `Deno.serve` function signature to be more
versatile and easier to use. It is now a drop in replacement for
std/http's `serve`.

The input validation has also been reworked.
2022-08-24 00:08:56 +02:00
David Sherret
f0993f413b
fix: parse scoped npm specifiers with no version (#15564) 2022-08-23 13:08:37 -04:00
David Sherret
e7367044d9
feat: binary npm commands (#15542) 2022-08-23 10:39:19 -04:00
David Sherret
362af63c6f
fix(cache): do not attempt to emit non-emitable files (#15562) 2022-08-23 10:30:14 -04:00
Bartek Iwańczuk
86ef743c0f
chore: upgrade rusty_v8 to v0.49.0 (#15547) 2022-08-23 14:51:04 +02:00
Luca Casonato
24f7f3fda9
fix(ext/fetch): ignore user content-length header (#15555)
Previously if a user specified a content-length header for an POST
request without a body, the request would contain two `content-length`
headers. One added by us, and one added by the user.

This commit ignores all content-length headers coming from the user,
because we need to have the sole authority on the content-length because
we transmit the body.
2022-08-23 12:43:04 +02:00
Geert-Jan Zwiers
ecf3b51fd9
refactor(core/runtime): clean up extra type cast (#15539) 2022-08-23 09:24:17 +05:30
Divy Srivastava
e34260c5b0
BREAKING(ext/ffi): specialized buffer type (#15518) 2022-08-23 09:16:43 +05:30
Kitson Kelly
d0c5477731
docs: add permission tags to JSDocs (#15541)
Co-authored-by: Leo Kettmeir <crowlkats@toaxl.com>
2022-08-23 10:57:01 +10:00
Ikko Ashimine
cf80b0a202
chore: typo (#15536) 2022-08-22 12:42:03 -04:00
David Sherret
7a1a082876
perf: cache swc dependency analysis and don't hold onto ParsedSources in memory (#15502) 2022-08-22 12:14:59 -04:00
Bartek Iwańczuk
c66386dbd2
feat(unstable): Respect --cached-only flags for npm: specifiers (#15512)
This commit changes "npm:" specifier handling to respect "--cached-only" flags and adds "Download" messages for npm registry api calls.

Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-22 17:35:04 +02:00
Yoshiya Hinosawa
57d48134d1
fix(ext/flash): fix default onListen callback (#15533) 2022-08-22 17:01:43 +09:00
Bartek Iwańczuk
301f6c46ba
fix(unstable): better error for invalid hostname in Deno.serve() (#15529) 2022-08-21 21:15:52 +02:00
Giovanny Gutiérrez
5ea51702bd
fix: Free up JsRuntime state global handles before snapshot (#15491) 2022-08-21 21:03:56 +02:00
Nayeem Rahman
97954003cc
feat: queueMicrotask() error handling (#15522)
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158).
2022-08-21 20:16:42 +02:00
Mathias Lafeldt
e96933bc16
chore: use Rust 1.63.0 (#15464) 2022-08-21 19:31:14 +02:00
Yoshiya Hinosawa
fb2aeb79a1
fix(ext/flash): fix listening port (#15519) 2022-08-21 21:27:14 +09:00
Divy Srivastava
906aa78af3
feat(ops): V8 Fast Calls (#15291) 2022-08-21 17:37:53 +05:30
Nayeem Rahman
e39d4e3e7f
fix(core/runtime): always cancel termination in exception handling (#15514) 2022-08-21 13:57:10 +02:00
akmhmgc
3caec9721e
docs: Fix typo (#15507) 2022-08-21 01:37:24 +02:00
David Sherret
87f80ff6be
feat(unstable): initial support for npm specifiers (#15484)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 11:31:33 -04:00
Leo Kettmeir
1ffbd56164
feat: add "deno init" subcommand (#15469)
This adds an init subcommand to that creates a project starter similar to cargo init.

```
$ deno init my_project
Project initialized
Run these commands to get started:
  cd my_project
  deno run main.ts
  deno run main_test.ts
$ deno run main.ts
Add 2 + 3 5
$ cat main.ts
export function add(a: number, b: number): number {
  return a + b;
}
if (import.meta.main) {
  console.log("Add 2 + 3", add(2, 3));
}
$ cat main_test.ts
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts";
import { add } from "./main.ts";
Deno.test(function addTest() {
    assertEquals(add(2, 3), 5);
});
```

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 01:37:05 +02:00
Bartek Iwańczuk
5beec3f106
feat(unstable): change Deno.serve() API (#15498)
- Merge "Deno.serve()" and "Deno.serveTls()" API
- Remove first argument and use "fetch" field options instead
- Update type declarations
- Add more documentation
2022-08-19 14:36:01 +02:00
Mathias Lafeldt
1848c7e361
Fix: Honor linter rules in CI and locally (#15492)
RUSTFLAGS take precedence over `target.<triple>.rustflags`. Therefore,
setting the env var globally in CI would always override whatever linter
rules are allowed or denied in .cargo/config.toml.

With this change, we ensure that problems are detected both in CI and
locally, using either cargo clippy or lint.js.
2022-08-19 08:17:18 -04:00
Divy Srivastava
25a109d9ea
chore(bench): add flash router benchmarks (#15495) 2022-08-19 15:54:54 +05:30
Divy Srivastava
9e576dff7c
perf(runtime): optimize Deno.file open & stream (#15496) 2022-08-19 15:54:40 +05:30
Divy Srivastava
8bdcec1c84
fix(ext/flash): concurrent response streams (#15493) 2022-08-19 10:14:56 +05:30
Divy Srivastava
cd21cff299
feat(ext/flash): An optimized http/1.1 server (#15405)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-18 17:35:02 +05:30
Leo Kettmeir
0b0843e4a5
refactor(fetch/request): use callback for url and method (#15483) 2022-08-17 16:29:26 +02:00
Kitson Kelly
a2ab5eee01
docs: add category tag for built-in APIs (#15480) 2022-08-17 13:12:24 +10:00
David Sherret
868c7e38bf
feat(runtime): add pre_execute_module_cb (#15485) 2022-08-16 21:00:35 -04:00
Ryan Dahl
0b70c81f97
perf: improve performance.now (#15481) 2022-08-16 21:00:16 +05:30