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

122 commits

Author SHA1 Message Date
Kitson Kelly
046bbb2691
Support loading additional TS lib files (#3863)
Fixes #3726

This PR provides support for referencing other lib files (like lib.dom.d.ts that are not
used by default in Deno.
2020-02-19 00:34:11 -05:00
Bartek Iwańczuk
3d5bed35e0
refactor: remove run_worker_loop (#4028)
* remove run_worker_loop, impl poll for WebWorker
* store JoinHandle to worker thread
2020-02-18 14:47:11 -05:00
Kevin (Kun) "Kassimo" Qian
08dcf6bff7
feat: Deno.makeTempFile (#4024) 2020-02-18 14:45:59 -05:00
Bartek Iwańczuk
302debebb3
refactor: cleanup cli/lib.rs (#4006)
* rename methods on Worker related to module loading
* reorganize cli/lib.rs
* remove cli/progress.rs and cli/shell.rs
2020-02-18 10:08:18 -05:00
geoFlux
2e7d449623
feat: add --cert flag for http client (#3972) 2020-02-17 11:59:51 -05:00
Ben Noordhuis
503d8bfef2
fix: skip non-UTF-8 dir entries in Deno.readDir() (#4004)
Example:

		$ python2 -c 'open("\x80\x7F", "w")'

		$ deno eval 'Deno.readDirSync(".")'
		thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', cli/ops/fs.rs:373:16
		note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
		fatal runtime error: failed to initiate panic, error 5
		Aborted (core dumped)

Before this commit they made deno panic, now they are silently skipped.
Not ideal but arguably better than panicking.

No test because what characters are and aren't allowed in filenames is
highly file system-dependent.

Closes #3950
2020-02-15 10:37:05 -05:00
Bartek Iwańczuk
a0f015b1a3
refactor: replace Arc<Box<..>> with Rc<..> (#3996) 2020-02-15 01:18:36 +01:00
Bartek Iwańczuk
e0bcecee60
refactor: Remove atomics from metrics (#3968)
* replace "AtomicUsize" with "u64" for field type on "Metrics"
* move "compiler_starts" field from "Metrics" to "GlobalState"
2020-02-11 17:23:40 +01:00
Bartek Iwańczuk
79b3bc05d6
workers: basic event loop (#3828)
* establish basic event loop for workers
* make "self.close()" inside worker
* remove "runWorkerMessageLoop() - instead manually call global function 
  in Rust when message arrives. This is done in preparation for structured clone
* refactor "WorkerChannel" and use distinct structs for internal 
  and external channels;  "WorkerChannelsInternal" and "WorkerHandle"
* move "State.worker_channels_internal" to "Worker.internal_channels"
* add "WorkerEvent" enum for child->host communication; 
  currently "Message(Buf)" and  "Error(ErrBox)" variants are supported
* add tests for nested workers
* add tests for worker throwing error on startup
2020-02-11 10:04:59 +01:00
Andy Finch
1abd408770
No longer require aligned buffer for shared queue (#3935)
Fixes: #3925
2020-02-09 10:54:16 -08:00
Bartek Iwańczuk
cdba5ab6fc refactor: rename ThreadSafeState, use RefCell for mutable state (#3931)
* rename ThreadSafeState to State
* State stores InnerState wrapped in Rc and RefCell
2020-02-08 20:34:31 +01:00
Bert Belder
25467aa7c7
Add blanket impl for the 'Resource' trait (#3903) 2020-02-07 17:18:28 -08:00
Ryan Dahl
724e39f13f
Enable thread pool for blocking ops (#3912) 2020-02-07 17:54:44 -05:00
Ryan Dahl
ed680552a2
fix: basic web worker message passing (#3893)
Removes OP_HOST_GET_WORKER_LOADED, OP_HOST_POLL_WORKER, 
OP_HOST_RESUME_WORKER and ready/messageBuffer in cli/js/workers.ts.
2020-02-05 17:16:07 -05:00
Ryan Dahl
55ea854671
Move create_channels into worker constructor (#3889) 2020-02-05 08:40:38 +01:00
Bartek Iwańczuk
184be99f5b
refactor: CLI subcommands and argv (#3886) 2020-02-04 20:24:33 +01:00
Ryan Dahl
161cf7cdfd
refactor: Use Tokio's single-threaded runtime (#3844)
This change simplifies how we execute V8. Previously V8 Isolates jumped
around threads every time they were woken up. This was overly complex and
potentially hurting performance in a myriad ways. Now isolates run on
their own dedicated thread and never move.

- blocking_json spawns a thread and does not use a thread pool
- op_host_poll_worker and op_host_resume_worker are non-operational
- removes Worker::get_message and Worker::post_message
- ThreadSafeState::workers table contains WorkerChannel entries instead
  of actual Worker instances.
- MainWorker and CompilerWorker are no longer Futures.
- The multi-threaded version of deno_core_http_bench was removed.
- AyncOps no longer need to be Send + Sync

This PR is very large and several tests were disabled to speed
integration:
- installer_test_local_module_run
- installer_test_remote_module_run
- _015_duplicate_parallel_import
- _026_workers
2020-02-03 18:08:44 -05:00
Rafael Vargas
55063dd8e8
fix: Deno.remove() to properly remove dangling symlinks (#3860)
For some reason, the unit tests for Deno.remove() were not being imported to 
unit_tests.ts and, consequently, not being executed. Thus, I imported them, 
refactored some existent ones and wrote new ones for the symlink removal case.

Since the creation of a symlink is not implemented for Windows yet, assertions
that consider this state were added when the tests are executed in this OS.
2020-02-03 08:20:15 -05:00
EnokMan
1c6c6c6d7f
Deno.makeTempDir() check permissions (#3810) 2020-01-29 23:21:41 -05:00
Bartek Iwańczuk
161adfc51b
workers: proper TS libs, more spec-compliant APIs (#3812)
* split lib.deno_main.d.ts into:
  - lib.deno.shared_globals.d.ts
  - lib.deno.window.d.ts
  - lib.deno.worker.d.ts
* remove no longer used libs:
  - lib.deno_main.d.ts
  - lib.deno_worker.d.ts
* change module loading to use proper TS library for compilation
* align to Worker API spec:
  - Worker.terminate()
  - self.close()
  - self.name
2020-01-29 18:54:23 +01:00
Bartek Iwańczuk
ac10d79d23 refactor: isomorphic snapshot for CLI (#3728) 2020-01-27 21:12:25 -05:00
Kitson Kelly
f604becaba Improve support of type definitions (#3755) 2020-01-26 13:59:41 -05:00
Bartek Iwańczuk
c824eb5817
refactor: Modules and Loader trait (#3791)
* move is_dyn_import argument from Loader::resolve to Loader::load - it was always kind of strange that resolve() checks permissions.
* change argument type from &str to &ModuleSpecifier where applicable
2020-01-25 18:53:16 +01:00
Bert Belder
37a7b01d5c
Refactor error tracking and scope juggling in deno_core (#3783) 2020-01-25 14:31:42 +01:00
Ryan Dahl
5e32c5ea44
s/PinnedBuf/ZeroCopyBuf (#3782) 2020-01-24 15:10:49 -05:00
Yoshiya Hinosawa
bc89f04cbf Add signal handlers (#3757) 2020-01-24 08:15:31 -05:00
Bartek Iwańczuk
bd9561f4de
Reland "Create an old program to be used in snapshot." (#3747)
* read CLI assets from disk during snapshotting
2020-01-22 20:18:01 +01:00
Ry Dahl
fa7f34eb8c
Revert "Create an old program to be used in snapshot. (#3644)"
Ref #3712. This change allowed the deno_typescript crate to reference
cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to
reintroduce a revised version of this patch later once "cargo
package" is working and tested.

This reverts commit 737ab94ea1.
2020-01-21 14:57:56 -05:00
Yoshiya Hinosawa
9de8178c9b feat: add AsyncUnref ops (#3721)
This is in order to support features like signal handlers, which
shouldn't prevent the program from exiting.
2020-01-21 12:01:10 -05:00
Bartek Iwańczuk
ecd1d3abb0
refactor: split cli::Worker (#3735)
* cli::Worker is base struct to create specialized workers
* add MainWorker
* add CompilerWorker
* refactor WebWorker to use Worker
2020-01-21 17:50:06 +01:00
Bartek Iwańczuk
5e2fd183ff
refactor: Rename JS entry functions (#3732) 2020-01-21 15:53:29 +01:00
Bartek Iwańczuk
0cd605515c
refactor: don't create new runtime for fs ops (#3730) 2020-01-21 14:26:11 +01:00
Michał Sabiniarz
21cc9cb7a7 Implemented alternative open mode in files (#3119)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-01-21 10:49:42 +01:00
Bartek Iwańczuk
7966bf14c0
refactor: split worker and worker host logic (#3722)
* split ops/worker.rs into ops/worker_host.rs and ops/web_worker.rs

* refactor js/workers.ts and factor out js/worker_main.ts - entry point for WebWorker runtime

* BREAKING CHANGE: remove support for blob: URL in Worker

* BREAKING CHANGE: remove Deno namespace support and noDenoNamespace option in Worker constructor

* introduce WebWorker struct which is a stripped down version of cli::Worker
2020-01-21 09:49:47 +01:00
Bartek Iwańczuk
c90036ab88 refactor: reduce number of ErrorKind variants (#3662) 2020-01-20 10:50:16 -05:00
Nayeem Rahman
7f80f9db3f refactor: Improve path handling in permission checks (#3714) 2020-01-20 09:45:44 -05:00
Bartek Iwańczuk
23e67eb515
stabilize net Addr (#3709)
Co-authored-by: xiaoxintang <15707971810@163.com>
2020-01-18 21:49:55 +01:00
Bartek Iwańczuk
34b99fec8e
rename dial to connect and dialTLS to connectTLS (#3710) 2020-01-18 18:35:12 +01:00
Bartek Iwańczuk
5fa056e53b workers: minimal error handling and async module loading (#3665) 2020-01-17 18:43:53 -05:00
Nayeem Rahman
f8d5f5b80e fix: Resolve read/write whitelists from CWD (#3684) 2020-01-16 14:47:02 -05:00
Bartek Iwańczuk
1de02b0643
perf: share http client in file fetcher (#3683) 2020-01-16 16:10:01 +01:00
Kevin (Kun) "Kassimo" Qian
91757f63fd feat(fs): add more unix-only fields to FileInfo (#3680) 2020-01-16 09:46:32 -05:00
Kitson Kelly
737ab94ea1 Create an old program to be used in snapshot. (#3644) 2020-01-12 12:20:33 +01:00
Bartek Iwańczuk
8fac8ab130
upgrade: tokio 0.2.9, reqwest 0.10.1 (#3653) 2020-01-12 10:21:53 +01:00
Ry Dahl
d492c5abe3
feat: Deno.args now does not include script (#3628)
Previously Deno.args was ["script.js", "arg1", "arg2"]
Now it is just ["arg1", "arg2"]
BREAKING CHANGE
2020-01-09 11:37:01 -07:00
Kitson Kelly
d325566a7e Runtime Compiler API (#3442)
Also restructures the compiler TypeScript files to make them easier to
manage and eventually integrate deno_typescript fully.
2020-01-08 09:17:44 -05:00
Ry Dahl
29df272133
error on warnings (#3612) 2020-01-06 11:38:56 -05:00
Ry Dahl
76e44ddfd0
Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600) 2020-01-05 11:56:18 -05:00
Gurwinder Singh
9f6bab6010 Use async at places, use &self instead of self: &Self (#3594) 2020-01-04 05:20:52 -05:00
Ry Dahl
bfab4ed0df
Happy new year! (#3578) 2020-01-02 15:13:47 -05:00