summaryrefslogtreecommitdiff
path: root/cli/ops
AgeCommit message (Collapse)Author
2020-02-27replace impl Future with poll_fn for net.rs, process.rs, tls.rs (#4158)Bartek Iwańczuk
2020-02-26rewrite normalize_path (#4143)Bartek Iwańczuk
Rewrite "normalize_path()" to remove all intermediate components from the path, ie. "./" and "../". It's very similar in functionality to fs::canonicalize(), however "normalize_path() doesn't resolve symlinks.
2020-02-26remove Read/Write futures, use poll_fn instead (#4150)Bartek Iwańczuk
2020-02-26tty: Deno.setRaw(rid, mode) to turn on/off raw mode (#3958)Kevin (Kun) "Kassimo" Qian
2020-02-25Remove _async from method names since _sync are gone (#4128)Ryan Dahl
2020-02-25fix: Resolve makeTemp* paths from CWD (#4104)Nayeem Rahman
2020-02-25Clean up how we use opIds (#4118)Ryan Dahl
2020-02-24feat: Add Deno.formatDiagnostics (#4032)Kitson Kelly
2020-02-24Add missing node os.release() implementation (#4065)ecyrbe
2020-02-23refactor: use OpError instead of ErrBox for errors in ops (#4058)Bartek Iwańczuk
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-23fetch: proper error for unsupported protocol (#4085)Kevin (Kun) "Kassimo" Qian
2020-02-22feat(std/node): add os.loadavg() (#4075)ecyrbe
2020-02-21feat: Deno.fsEvents() (#3452)Bartek Iwańczuk
2020-02-21feat: support UDP sockets (#3946)hazæ41
2020-02-21refactor: remove unneeded ErrorKinds (#3936)Bartek Iwańczuk
2020-02-19refactor: rewrite file_fetcher to use async fns, lift blocking call (#4037)Bartek Iwańczuk
2020-02-19Support loading additional TS lib files (#3863)Kitson Kelly
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-18refactor: remove run_worker_loop (#4028)Bartek Iwańczuk
* remove run_worker_loop, impl poll for WebWorker * store JoinHandle to worker thread
2020-02-18feat: Deno.makeTempFile (#4024)Kevin (Kun) "Kassimo" Qian
2020-02-18refactor: cleanup cli/lib.rs (#4006)Bartek Iwańczuk
* rename methods on Worker related to module loading * reorganize cli/lib.rs * remove cli/progress.rs and cli/shell.rs
2020-02-17feat: add --cert flag for http client (#3972)geoFlux
2020-02-15fix: skip non-UTF-8 dir entries in Deno.readDir() (#4004)Ben Noordhuis
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-15refactor: replace Arc<Box<..>> with Rc<..> (#3996)Bartek Iwańczuk
2020-02-11refactor: Remove atomics from metrics (#3968)Bartek Iwańczuk
* replace "AtomicUsize" with "u64" for field type on "Metrics" * move "compiler_starts" field from "Metrics" to "GlobalState"
2020-02-11workers: basic event loop (#3828)Bartek Iwańczuk
* 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-09No longer require aligned buffer for shared queue (#3935)Andy Finch
Fixes: #3925
2020-02-08refactor: rename ThreadSafeState, use RefCell for mutable state (#3931)Bartek Iwańczuk
* rename ThreadSafeState to State * State stores InnerState wrapped in Rc and RefCell
2020-02-07Add blanket impl for the 'Resource' trait (#3903)Bert Belder
2020-02-07Enable thread pool for blocking ops (#3912)Ryan Dahl
2020-02-05fix: basic web worker message passing (#3893)Ryan Dahl
Removes OP_HOST_GET_WORKER_LOADED, OP_HOST_POLL_WORKER, OP_HOST_RESUME_WORKER and ready/messageBuffer in cli/js/workers.ts.
2020-02-05Move create_channels into worker constructor (#3889)Ryan Dahl
2020-02-04refactor: CLI subcommands and argv (#3886)Bartek Iwańczuk
2020-02-03refactor: Use Tokio's single-threaded runtime (#3844)Ryan Dahl
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-03fix: Deno.remove() to properly remove dangling symlinks (#3860)Rafael Vargas
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-01-29Deno.makeTempDir() check permissions (#3810)EnokMan
2020-01-29workers: proper TS libs, more spec-compliant APIs (#3812)Bartek Iwańczuk
* 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-27refactor: isomorphic snapshot for CLI (#3728)Bartek Iwańczuk
2020-01-26Improve support of type definitions (#3755)Kitson Kelly
2020-01-25refactor: Modules and Loader trait (#3791)Bartek Iwańczuk
* 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-25Refactor error tracking and scope juggling in deno_core (#3783)Bert Belder
2020-01-24s/PinnedBuf/ZeroCopyBuf (#3782)Ryan Dahl
2020-01-24Add signal handlers (#3757)Yoshiya Hinosawa
2020-01-22Reland "Create an old program to be used in snapshot." (#3747)Bartek Iwańczuk
* read CLI assets from disk during snapshotting
2020-01-21Revert "Create an old program to be used in snapshot. (#3644)"Ry Dahl
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 737ab94ea1bdf65eeef323ea37e84bcf430fb92c.
2020-01-21feat: add AsyncUnref ops (#3721)Yoshiya Hinosawa
This is in order to support features like signal handlers, which shouldn't prevent the program from exiting.
2020-01-21refactor: split cli::Worker (#3735)Bartek Iwańczuk
* cli::Worker is base struct to create specialized workers * add MainWorker * add CompilerWorker * refactor WebWorker to use Worker
2020-01-21refactor: Rename JS entry functions (#3732)Bartek Iwańczuk
2020-01-21refactor: don't create new runtime for fs ops (#3730)Bartek Iwańczuk
2020-01-21Implemented alternative open mode in files (#3119)Michał Sabiniarz
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-01-21refactor: split worker and worker host logic (#3722)Bartek Iwańczuk
* 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