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

48 commits

Author SHA1 Message Date
Bartek Iwańczuk
e1beebc71a
refactor: factor out check_unstable op helper (#7695) 2020-09-26 20:26:51 +02:00
Bartek Iwańczuk
92edc36442
refactor: use futures and serde_json from deno_core (#7614) 2020-09-21 18:36:37 +02:00
Bartek Iwańczuk
b657d743a2
refactor: remove CliState, use OpState, add CliModuleLoader (#7588)
- remove "CliState.workers" and "CliState.next_worker_id", instead
store them on "OpState" using type aliases.
- remove "CliState.global_timer" and "CliState.start_time", instead
store them on "OpState" using type aliases.
- remove "CliState.is_internal", instead pass it to Worker::new
- move "CliState::permissions" to "OpState"
- move "CliState::main_module" to "OpState"
- move "CliState::global_state" to "OpState"
- move "CliState::check_unstable()" to "GlobalState"
- change "cli_state()" to "global_state()"
- change "deno_core::ModuleLoader" trait to pass "OpState" to callbacks
- rename "CliState" to "CliModuleLoader"
2020-09-20 01:17:35 +02:00
Ryan Dahl
0cb64cef76 Remove unnecessary serde_derive dependency 2020-09-16 13:29:42 -04:00
Bert Belder
f5b40c918c
refactor: use the 'anyhow' crate instead of 'ErrBox' (#7476) 2020-09-15 01:50:52 +02:00
Ryan Dahl
7c2e7c6608
Use gotham-like state for ops (#7385)
Provides a concrete state type that can be dynamically added. This is necessary for op crates.
* renames BasicState to OpState
* async ops take `Rc<RefCell<OpState>>`
* sync ops take `&mut OpState`
* removes `OpRegistry`, `OpRouter` traits
* `get_error_class_fn` moved to OpState
* ResourceTable moved to OpState
2020-09-10 09:57:45 -04:00
Bert Belder
c821e8f2f1
Move JSON ops to deno_core (#7336) 2020-09-06 02:34:02 +02:00
Bartek Iwańczuk
7e946858a4
refactor: migrate ops to new dispatch wrapper (#7118) 2020-08-28 17:08:24 +02:00
Bert Belder
aead9dc91e
Remove some more unnecessary 'to_string()' calls (#7190) 2020-08-26 01:13:20 +02:00
Bert Belder
9bfb0df805
refactor: remove OpError, use ErrBox everywhere (#7187)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-08-26 00:22:15 +02:00
Bert Belder
27f4aeb924
Make Rc/Arc wrapper around State/GlobalState visible (#7104) 2020-08-19 02:01:48 +02:00
Valentin Anger
becbb56b19
feat(core): Ops can take several zero copy buffers (#4788) 2020-06-01 14:20:47 -04:00
Ryan Dahl
d4b05dd89e
refactor: Split isolate and state using safe get_slot() (#5929) 2020-05-29 17:41:39 -04:00
Yiyu Lin
0b9942da84
fix some unwrap() in Rust (#5485) 2020-05-16 09:41:32 -04:00
Bartek Iwańczuk
f7ab19b1b7
mark Deno.startTls as unstable (#4965) 2020-04-28 18:01:13 +02:00
Ryan Dahl
d8711155ca
Rename deno_core::Isolate to deno_core::CoreIsolate (#4851) 2020-04-23 11:51:07 +02:00
Ryan Dahl
cc1720132a
Move resource_table from deno::State to deno_core::Isolate (#4834) 2020-04-21 09:48:44 -04:00
EnokMan
47617e60d5
feat: startTLS (#4773) 2020-04-18 11:21:20 -04:00
Bartek Iwańczuk
41f836dc91
replace block_on in net interfaces (#4796) 2020-04-17 18:45:34 +02:00
Bartek Iwańczuk
aab26d226e
remove calls to futures::executor::block_on (#4760) 2020-04-15 23:14:28 -04:00
Kitson Kelly
f527407287
clippy (#4618) 2020-04-03 22:41:16 -04:00
João Souto
fb5c31416d
Add waker to StreamResource to fix hang on close bugs (#4293) 2020-03-11 18:19:24 -04:00
Nayeem Rahman
55119aaee2
refactor(cli/js/net): Cleanup iterable APIs (#4236)
Listener and UDPConn are AsyncIterables instead of AsyncIterators.
The [Symbol.asyncIterator]()s are defined as generators and the
next() methods are gone.

"Listener/Socket has been closed" errors are now BadResource.
2020-03-10 15:14:22 -04:00
Ryan Dahl
54a1688868
Allow BadResource errors to take a custom message (#4251) 2020-03-05 08:30:41 -05:00
Bartek Iwańczuk
fa5f3aa600
replace impl Future with poll_fn for net.rs, process.rs, tls.rs (#4158) 2020-02-27 21:08:21 +01:00
Ryan Dahl
91b606aaae
Clean up how we use opIds (#4118) 2020-02-25 09:14:27 -05:00
Bartek Iwańczuk
4e1abb4f3a
refactor: use OpError instead of ErrBox for errors in ops (#4058)
To better reflect changes in error types in JS from #3662 this PR changes 
default error type used in ops from "ErrBox" to "OpError".

"OpError" is a type that can be sent over to JSON; it has all 
information needed to construct error in JavaScript. That
made "GetErrorKind" trait useless and so it was removed altogether.

To provide compatibility with previous use of "ErrBox" an implementation of
"From<ErrBox> for OpError" was added, however, it is an escape hatch and
ops implementors should strive to use "OpError" directly.
2020-02-23 14:51:29 -05: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
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
Ryan Dahl
5e32c5ea44
s/PinnedBuf/ZeroCopyBuf (#3782) 2020-01-24 15:10:49 -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
Ry Dahl
76e44ddfd0
Rename crates: 'deno' to 'deno_core' and 'deno_cli' to 'deno' (#3600) 2020-01-05 11:56:18 -05:00
Ry Dahl
bfab4ed0df
Happy new year! (#3578) 2020-01-02 15:13:47 -05:00
Bartek Iwańczuk
46d76a7562
upgrade: Tokio 0.2 (#3418) 2019-12-30 14:57:17 +01:00
Bartek Iwańczuk
136b5e3da2 disable eager polling for ops (#3434) 2019-12-02 12:21:32 -08:00
Bartek Iwańczuk
8f9a942cb9 Use futures 0.3 API (#3358) 2019-11-16 19:17:47 -05:00
Bartek Iwańczuk
8b90b8e883 refactor: per-worker resource table, take 2 (#3342)
- removes global `RESOURCE_TABLE` - resource tables are now created per `Worker`
  in `State`
- renames `CliResource` to `StreamResource` and moves all logic related
  to it to `cli/ops/io.rs`
- removes `cli/resources.rs`
- adds `state` argument to `op_read` and `op_write` and consequently adds
  `stateful_minimal_op` to `State`
- IMPORTANT NOTE: workers don't have access to process stdio - this is
  caused by fact that dropping worker would close stdout for process
  (because it's constructed from raw handle, which closes underlying file
  descriptor on drop)
2019-11-14 12:10:25 -05:00
Ryan Dahl
fdf0ede2ac Revert "refactor: per-worker resource table (#3306)"
This patch does not work with the recent bundler changes (#3325).
Unfortunately I didn't merge master before landing this patch. It has
something to do with console.log not working inside the compiler worker.

This reverts commit fd62379eaf.
2019-11-13 23:42:35 -05:00
Bartek Iwańczuk
fd62379eaf refactor: per-worker resource table (#3306)
- removes global `RESOURCE_TABLE` - resource tables are now created per `Worker`
  in `State`
- renames `CliResource` to `StreamResource` and moves all logic related
  to it to `cli/ops/io.rs`
- removes `cli/resources.rs`
- adds `state` argument to `op_read` and `op_write` and consequently adds
  `stateful_minimal_op` to `State`
- IMPORTANT NOTE: workers don't have access to process stdio - this is
  caused by fact that dropping worker would close stdout for process
  (because it's constructed from raw handle, which closes underlying file
  descriptor on drop)
2019-11-13 22:16:57 -05:00
Bartek Iwańczuk
25c276055b refactor: remove cli::resources::Resource (#3285) 2019-11-07 11:11:15 -05:00
Bartek Iwańczuk
415d4c2e52 refactor: rewrite accept resources (#3271) 2019-11-07 09:59:02 -05:00
EnokMan
7c60ab4664 refactor DenoPermissions.check_net & resolve_addr (#3182) 2019-10-23 10:19:26 -04:00
Bartek Iwańczuk
6c5a981fd2 feat: Deno.listenTLS (#3152) 2019-10-21 14:38:28 -04:00
Yusuke Sakurai
6056595357 fix: [tls] op_dial_tls is not registerd and broken (#3121) 2019-10-13 10:37:37 -04:00
Jonathon Orsi
045e74bb39 feat: Add Deno.dialTLS()
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2019-09-23 15:12:42 -04:00