profile
viewpoint
Kevin (Kun) "Kassimo" Qian kevinkassimo @google (intern) UCLA → Stanford ksm.sh Looks like an IDIOT. @google Software Engineering Intern 2018 / 2019; worked on @ampproject / Search. Contributor to Deno @denoland

issue commentdenoland/deno

console.log not show private members of javascript

Ref: https://bugs.chromium.org/p/v8/issues/detail?id=8337

Fenzland

comment created time in 7 days

issue commentdenoland/deno

Deno.open mode

The Go open flags are basically the *nix commons. Another option is to design an OpenOptions similar to the one used by Deno.writeFile: https://deno.land/typedoc/interfaces/deno.writefileoptions.html

MarkTiedemann

comment created time in 7 days

issue commentdenoland/deno

WASM instantiation doesn't work properly

#1325 is also related to this: seems we currently do not wait for any async wasm operations.

ry

comment created time in 7 days

startedyangshun/front-end-interview-handbook

started time in 13 days

Pull request review commentdenoland/registry

Render code as pretty html instead of redirecting

 exports.lambdaHandler = async (event, context, callback) => {   };   callback(null, response); };++function renderPrettyCode(pathname, code) {+  const url = `https://deno.land${pathname}`;

Is this safe? url does not seem to be escapde in later contexts. Is pathname always properly escaped?

mtharrison

comment created time in 13 days

push eventdenolib/awesome-deno

EnokMan

commit sha fbfc4ccbcb855296f346afe95f5f840b322a1f6b

add modules (#64) * add modules dso - Simple Deno ORM library sql-builder - sql query builder

view details

push time in 14 days

PR merged denolib/awesome-deno

add modules

dso - Simple Deno ORM library sql-builder - sql query builder

+2 -0

0 comment

1 changed file

manyuanrong

pr closed time in 14 days

push eventmanyuanrong/awesome-deno

Kevin (Kun) "Kassimo" Qian

commit sha a991fefdfc6bbb55ebc84728b620edc9ec8c277b

Format

view details

push time in 14 days

startednpm/tink

started time in 19 days

startedtc39/proposal-optional-chaining

started time in 21 days

startedkeroxp/deno-couchdb

started time in 22 days

issue openeddenoland/deno

Add and use `assertRejects` for testing

Tests like the following is non-robust (if error does not even happen). https://github.com/denoland/deno/blob/60d452264198adb3da4820236cf8ea35d33486cd/js/chown_test.ts#L45-L50

Instead, we can create a function like assertRejects that can be used like

const error = await assertRejects(opToFail);

This could be a good first issue

created time in 23 days

startedentropic-dev/entropic

started time in 25 days

pull request commentdenoland/deno_std

Refactor BufReader/BufWriter interfaces to be more idiomatic

@kitsonk also null (emptiness, nothing) sounds better than undefined (unknown, not well defined) to me in this case by definition in JS

piscisaureus

comment created time in a month

pull request commentdenoland/deno_std

Refactor BufReader/BufWriter interfaces to be more idiomatic

@kitsonk do you think number | null would work in that case? null for EOF might make sense as EOF implies "nothing" to read any more

piscisaureus

comment created time in a month

issue commentkevinkassimo/vhttps

Express example do not work

Hi, I somehow cannot reproduce this bug locally. Can you show what your code look like?

xeroxstar

comment created time in a month

pull request commentdenoland/deno_std

Refactor BufReader/BufWriter interfaces to be more idiomatic

I also like the proposal, though I do feel we might want to move the definition EOF symbol to core (cli) at some point (so it is possible to also encourage users to do similar stuff without relying on remote deps)

piscisaureus

comment created time in a month

pull request commentdenolib/awesome-deno

fixing urls and names

@zekth I remember @justjavac mentioned about some issue with the domain name. Let's drop it for now.

zekth

comment created time in a month

create barnchkerckhoff/kerckhoff-ui

branch : kevin/diff

created branch time in a month

delete branch kevinkassimo/deno

delete branch : wip/signal

delete time in a month

create barnchkevinkassimo/deno

branch : wip/signal

created branch time in a month

pull request commentdenoland/deno_std

Clean up HTTP async iterator code

There is another small issue I noticed: it seems under 500 concurrent connections our HTTP server would die silently... Might be unrelated to this PR though:

$ ./third_party/wrk/mac/wrk -c 500 -d 10 http://localhost:4500
Running 10s test @ http://localhost:4500
  2 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    14.34ms   28.00ms 535.90ms   98.24%
    Req/Sec    17.87k     2.44k   22.63k    74.00%
  355802 requests in 10.01s, 16.97MB read
  Socket errors: connect 0, read 446, write 13, timeout 0
Requests/sec:  35534.95
Transfer/sec:      1.69MB
$ ./third_party/wrk/mac/wrk -c 500 -d 10 http://localhost:4500
Running 10s test @ http://localhost:4500
  2 threads and 500 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     0.00us    0.00us   0.00us     nan%
    Req/Sec     0.00      0.00     0.00       nan%
  0 requests in 10.10s, 0.00B read
  Socket errors: connect 0, read 485, write 14, timeout 0
Requests/sec:      0.00
Transfer/sec:       0.00B

(Actually on master this would result in a panic on

thread '<unnamed>' panicked at 'bad rid', ../../cli/resources.rs:237:15

)

ry

comment created time in a month

pull request commentdenoland/deno_std

Clean up HTTP async iterator code

@piscisaureus Seems performing better than master now.

This branch:

./third_party/wrk/mac/wrk -d 10 http://localhost:4500
Running 10s test @ http://localhost:4500
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   285.13us  185.29us   4.83ms   94.48%
    Req/Sec    18.73k   799.01    20.61k    74.75%
  376607 requests in 10.10s, 17.96MB read
Requests/sec:  37284.09
Transfer/sec:      1.78MB
ry

comment created time in a month

pull request commentdenoland/deno_std

Clean up HTTP async iterator code

This PR results in a 50% reduction of req/sec:

master:

Running 10s test @ http://localhost:4500
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   353.40us  153.27us   2.88ms   95.73%
    Req/Sec    14.48k   692.05    15.67k    68.32%
  290989 requests in 10.10s, 13.88MB read
Requests/sec:  28809.59
Transfer/sec:      1.37MB

this branch:

Running 10s test @ http://localhost:4500
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    24.05ms   61.05ms 353.56ms   88.58%
    Req/Sec    11.01k     4.44k   15.41k    81.50%
  195783 requests in 10.05s, 9.34MB read
Requests/sec:  19489.73
Transfer/sec:      0.93MB

Latency seems exceptionally problematic. I believe this is somehow related to we removed pipelining code? Not so sure if wrk does pipelining...

ry

comment created time in a month

pull request commentdenoland/deno_std

Clean up HTTP async iterator code

@ry seems with this implementation, there is always going to be either 0 or just 1 elements in sendQueue/recvQueue?

ry

comment created time in a month

pull request commentdenoland/deno

feat: auto remove stale compiled version on rerun

@ry Oh okay. I actually though about breaking up the deno_dir.rs before... Also it seems this PR is banned from being landed before I got approval from my manager...

kevinkassimo

comment created time in a month

pull request commentdenoland/deno

feat: auto remove stale compiled version on rerun

@ry I haven’t looked into cache.rs yet... Also i’m temporarily blocked from contributing this week: I have to wait for my intern manager’s approval for outside projects

kevinkassimo

comment created time in a month

issue commentdenoland/deno

WASM Support

@kitsonk actually not yet, WebAssembly.compile still exits immediately...

kevinkassimo

comment created time in a month

issue commentdenoland/deno

Add serde_derive crate

I tried in the past once and failed due to some complications with proc2-macro... hopefully we can have it done this time

bartlomieju

comment created time in a month

startedjedisct1/was-not-wasm

started time in a month

issue commentdenoland/deno

Feature Request: Signal Handlers

Async iterator makes sense. I think I have some basic idea of implementation. Will see if I could do this in the coming week.

kt3k

comment created time in a month

issue commentdenoland/deno

deno fetch sometime exits with code 134 on Linux

Looks like exceptions are disabled under so I cannot catch the error and inspect what has happened. Funny that when I replaced std::mutex with pthread_mutex_t I could no longer trigger the error...

keroxp

comment created time in 2 months

issue commentdenoland/deno

deno fetch sometime exits with code 134 on Linux

I can repeat this on an Ubuntu instance. The following is the generated core dump file info in GDB:

Core was generated by `../deno/target/debug/deno fetch tests.ts'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f8b9ab16700 (LWP 8549))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f8b9b358801 in __GI_abort () at abort.c:79
#2  0x000055cb5be94052 in std::__terminate(void (*)()) ()
#3  0x000055cb5be932da in __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) ()
#4  0x000055cb5be9322f in __cxa_throw ()
#5  0x000055cb5be8f414 in std::__1::__throw_system_error(int, char const*) ()
#6  0x000055cb5be7ef81 in std::__1::mutex::lock() ()
#7  0x000055cb5c7826dd in deno::ArrayBufferAllocator::Unref(void*) ()
#8  0x000055cb5af27c4c in void std::__1::__function::__policy_invoker<void ()>::__call_impl<std::__1::__function::__alloc_func<v8::internal::ArrayBufferCollector::FreeAllocations()::$_1(std::__1::allocator<std::__1::allocator>, void ())> >(std::__1::__function::__policy_storage const*) ()
#9  0x000055cb5c789976 in v8::platform::DefaultWorkerThreadsTaskRunner::WorkerThread::Run() ()
#10 0x000055cb5beceb4d in v8::base::ThreadEntry(void*) ()
#11 0x00007f8b9bece6db in start_thread (arg=0x7f8b9ab16700) at pthread_create.c:463
#12 0x00007f8b9b43988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

@ry since I believe I have seen ArrayBufferAllocator changes in a previous commit.

keroxp

comment created time in 2 months

startedWICG/trusted-types

started time in 2 months

pull request commentdenoland/deno

[WIP] fix: whitelist symlink permission check

As shown in the latest commit, we could probably let check_read/check_write to return the path that is "guaranteed" to be NOT a symlink and use that path for the actual fs operation.

We must turn on O_NOFOLLOW for many operations, which might be painful since Rust std and other third party libraries has bad support for such custom flags (including Tokio, unfortunately...)

kevinkassimo

comment created time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) "Kassimo" Qian

commit sha d9cdc6788b1ed89d7f3b2daf9da7e4a9f664e424

fix: support relative path for whitelisting (#2317) Using `std::fs::canonicalize` to expand path to full existing path, such that later attempt to loop-pop and compare path segment would work.

view details

Vincent LE GOFF

commit sha 07886a03cc913a15fa8e90034e80edeb41186c2c

[manual] fix example (#2307)

view details

Kevin (Kun) Kassimo Qian

commit sha 8c8ead05eaffb1df5af9b790b70500db56a657d9

fix: whitelist symlink permission check Try read given path to ensure that if it is a symlink, the target must be on the whitelist.

view details

Kevin (Kun) Kassimo Qian

commit sha af3bd6e8a551c9fd67ed7336fdc4d015f9e1cf17

demo: avoid TOCTOU by using resolved final targets Return resolved non-symlink target path for check_read/check_write. Use this path for actual fs operation. Current problem: Rust std and third party modules does not have easy support for setting O_NOFOLLOW flag.

view details

push time in 2 months

issue commentdenoland/deno

Add "deno runa" as an alias to "deno run -A"

runa sounds super confusing to me also...

ry

comment created time in 2 months

push eventdenolib/awesome-deno

Vincent LE GOFF

commit sha db8d42bb3cea2f31345cb2c0ca743d469f123f23

add deno-random-interval (#55)

view details

push time in 2 months

PR merged denolib/awesome-deno

add deno-random-interval
+1 -0

0 comment

1 changed file

zekth

pr closed time in 2 months

push eventdenolib/awesome-deno

Kevin (Kun) "Kassimo" Qian

commit sha 1c6908d38cdd4e8411acd6e64c14f9f1bd35044d

Update link to manual

view details

push time in 2 months

pull request commentdenoland/deno

[WIP] fix: whitelist symlink permission check

@afinch7 One idea is probably we can return the final non-link destination as the result of check_read/check_write, and assert no-follow on this destination. I'll try implement this later.

kevinkassimo

comment created time in 2 months

pull request commentdenoland/deno

[WIP] fix: whitelist symlink permission check

@afinch7 I actually might want to retract this PR, since every place of checking there is a TOCTOU issue (assuming some malicious identity also happens to have access to the directory we allow read/write)

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

[WIP] fix: whitelist symlink permission check

Based on #2317.

Try read given path to ensure that if it is a symlink, the target must be on the whitelist.

We have to be careful with some of the cases to decide whether we should attempt permission checks that follow the symlinks (potential TOCTOU issues)

+183 -39

0 comment

5 changed files

pr created time in 2 months

create barnchkevinkassimo/deno

branch : whitelist/symlink

created branch time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha d38d1429fd541679679ef86e6076d77f0cd8f4d5

fix: use `resolve_path` instead of `canonicalize` Allow on a path that will be existing in the future seems acceptible

view details

push time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 99bcd4149cb82272b2dbc490973c57effcd227ed

fix: use `resolve_path` instead of `canonicalize` Allow on a path that will be existing in the future seems acceptible

view details

push time in 2 months

issue openeddenoland/deno

Escape perm whitelist using symlink

e.g. Currently creating a symlink under write-allowed directory to other directories would allow escaping the perm rules and access any file.

created time in 2 months

PR opened denoland/

fix: support relative path for whitelisting

Using std::fs::canonicalize to expand path to full existing path, such that later attempt to loop-pop and compare path segment would work.

+69 -6

0 comment

2 changed files

pr created time in 2 months

PR opened denoland/

fix: support relative path for whitelisting

Using std::fs::canonicalize to expand path to full existing path, such that later attempt to loop-pop and compare path segment would work.

+69 -6

0 comment

2 changed files

pr created time in 2 months

create barnchkevinkassimo/deno

branch : whitelist/relative

created branch time in 2 months

issue commentdenoland/deno

Panicking on opening too many files

@Fenzland I think this is a different problem (since in my case the process crashed under panic). How many times do you run before this error occurs? (Usually ulimit -n should return a value 4000+)

kevinkassimo

comment created time in 2 months

push eventkevinkassimo/deno

Bartek Iwańczuk

commit sha ac8c6fec5bb2be97c8dbdb2286d2688575a593f2

Refactor unit test runner (#2294) Properly discovers the permissions needed for each test.

view details

andy finch

commit sha 2edee3367dc9003b721cf87ca57e820c7acf7b25

First pass at permissions whitelist (#2129)

view details

Kevin (Kun) Kassimo Qian

commit sha 435c86a32da0ccf25fb9ff92499b1bf821cd25fe

feat: auto remove stale compiled version on rerun Creates a new meta file that stores code state_hash (digest from source_code + deno_version + config) and use filename_hash (digest from just the source path). When the file content is updated, during rerun we would check the old cached state_hash. If the hash does not match, we automatically remove the old files.

view details

Kevin (Kun) Kassimo Qian

commit sha 7f2152431717d1bb5e0e4ddf25d6a6de2537454f

test: add test and update code Added integration test for cache stale version purge.

view details

push time in 2 months

startedflutter/flutter_web

started time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 1ef2aa55893f908a901b5b4f75022ad5dad5cd9d

feat: auto remove stale compiled version on rerun Creates a new meta file that stores code state_hash (digest from source_code + deno_version + config) and use filename_hash (digest from just the source path). When the file content is updated, during rerun we would check the old cached state_hash. If the hash does not match, we automatically remove the old files.

view details

push time in 2 months

pull request commentdenoland/deno

feat: auto remove stale compiled version on rerun

I also noticed that sourceURL in the generated JS file already somewhat contains the source info (not source path with remote import though). So it might be okay to drop source_path field from meta if it proves to suffice later.

(source_path is introduced to make the next step of introducing garbage-collection cli command possible)

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

feat: auto remove stale compiled version on rerun

(WIP. Needs tests. Not marked as draft PR such that travis can run)

First step of #2305.

Creates a new meta file that stores code state_hash (digest from source_code + deno_version + config) and use filename_hash (digest from just the source path). When the file content is updated, during rerun we would check the old cached state_hash. If the hash does not match, we automatically remove the old files.

e.g. For a file hello.ts

console.log("HELLO");

Calling deno run hello.ts yields the following cache content:

$ ls gen
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js.map
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.meta
$ cat gen/fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js
console.log("HELLO");
//# sourceMappingURL=hello.js.map
//# sourceURL=/Users/kun/Projects/Deno/test/hello.ts
$ cat gen/fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.meta
{"source_path":"/Users/kun/Projects/Deno/test/hello.ts","state_hash":"17cfdc471944246d87dd49a7315e28e2f4eef145"}

Update this file to

console.log("HELLO WORLD");

We get

$ ls gen
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js.map
fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.meta
$ cat gen/fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.js
console.log("HELLO WORLD");
//# sourceMappingURL=hello.js.map
//# sourceURL=/Users/kun/Projects/Deno/test/hello.ts
$ cat cat gen/fab19d3c617bf268f68f677fa7ff9e4b5fb48b8f.meta
{"source_path":"/Users/kun/Projects/Deno/test/hello.ts","state_hash":"ca58a353e98a585e79d78345fd3bb7fe51a6376d"}

Notice that the old files has been completely replaced with new compiled files of exactly the same name, with content and state_hash updated.

+168 -73

0 comment

1 changed file

pr created time in 2 months

create barnchkevinkassimo/deno

branch : gen/smarter_cache

created branch time in 2 months

issue openeddenoland/deno

Smarter TS compiled file mechanism

Currently whenever we compile a file that has been modified, we simply create a new file using the hash of source file name + source code + version + config. This leaves the old compiled file of previous version still in the cache.

Instead I believe it might be better to introduce a similar design of storing a meta file for each compiled file. For example, we could create a file using hash from purely the source file name

hash = source_code_hash(filename);

and create 2 separate files: ${hash}.js for the compiled code, and ${hash}.meta for metadata. The metadata might be just a string created by hashing source code + version + config.

(If we expect user to be using different configs quite often, we can consider hashing filename + config for compiled file name and store the hash for the rest in the meta file)

Whenever we run a TS file, we could see if the compiled file exists and check if the metadata matches up. If yes, we could proceed to use this compiled file. Otherwise, we could remove the stale compiled version plus old metadata, compile and replace with new ones. This would reduce the gen/ folder size quite effectively.

created time in 2 months

issue openedjinjor/deno-task-runner

Compatibility with deno v0.4.0

The old import style is no longer supported for the Deno namespace and Deno is now a global namespace. We need to make it const { ... } = Deno;

(This issue was brought up by some user in deno gitter chat room)

created time in 2 months

issue commentdenoland/deno

Reorganize `use` statements in Rust files

@Janpot seems that our current settings with rustfmt does not format these. If people can find a way to tweak the formatter settings it also works.

kevinkassimo

comment created time in 2 months

issue commentdenoland/deno

Discussion: CLI cache clean commands

I believe I have raised a similar question for deno fetch in the past... Our resolution at that time was to "just ignore them"... I believe v8 would inform us with dynamic imports requests only during runtime, so unless we uses some tools to generate AST (TS compiler maybe?) we won't be able to know whether and where these dynamic imports occur

kevinkassimo

comment created time in 2 months

issue commentdenoland/deno

Discussion: CLI cache clean commands

@kitsonk I think there is a potentially better use scenario for the exclusion feature: assume that user defines their own DENO_DIR location and carries all the dependencies files along with the project, dep exclusion could help removing unnecessary files while keeping only the cached files that are actually used. (I think this might be a valid scenario: imagine a user initially tried to use e.g. servest and later switches to oakserver to build a web server, s/he might want to get rid of all the old files that are no longer imported)

kevinkassimo

comment created time in 2 months

startedmicrosoft/BosqueLanguage

started time in 2 months

issue openeddenoland/deno

Reorganize `use` statements in Rust files

use statements in e.g. files like cli/ops.rs have grown a bit unnecessarily long. We should try to reduce these statements and reorganize them.

For example in ops.rs,

use futures;
use futures::Async;
use futures::Poll;
use futures::Sink;
use futures::Stream;

could be combined to simply

use futures::{self, Async, Poll, Sink, Stream};

Also for some other files, when we already do use crate::errors::DenoError;, we no longer need to write errors::DenoError and instead DenoError is good enough.

We also need to sort the imports. For example, imports in cli/repl.rs is not sorted.

This could be a good first issue.

created time in 2 months

pull request commentdenoland/deno

feat: expose writeAll() and writeAllSync()

@piscisaureus Not really. For example, write on a Conn have the following layers of implications: ConnImpl.write -> tokio_write::write -> <Resource as AsyncWrite>::poll_write -> tokio::net::TcpStream::poll_write -> tokio::net::TcpStream::write -> PollEvented<mio::net::TcpStream>::write -> mio::net::TcpStream::write -> sys::TcpStream::write -> std::net::TcpStream::write -> std::sys_common::net::TcpStream::write -> libc::send

As it eventually goes to send (2) and none of the above step does a write-all attempt, which means it is possible to write and return partially if something like signal interrupts happens when we have already written part (from manpages on macOS`:)

[EINTR]            A signal interrupts the system call before any data is transmitted.
kevinkassimo

comment created time in 2 months

issue commentdenoland/deno

Discussion: CLI cache clean commands

@ry I'm actually slightly worried about the "delete the dependencies of a script" use case. Since we do not really have the concept of a "project" in fixed locations and thus cannot do reference count of usage of certain dep for all present Deno scripts, if a script happened to import from common modules like deno_std, this would impact many other scripts spreading across the file system when we run deno clean.

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

feat: expose writeAll() and writeAllSync()

Symmetric with readAll() and readAllSync(). Also used in xeval. Also correct usage in writeFile()/writeFileSync().

+46 -17

0 comment

5 changed files

pr created time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 7faa90b10ca77ae0a2ec32589c94c15e79f0e934

feat: expose writeAll() and writeAllSync() Symmetric with `readAll()` and `readAllSync()`. Also used in `xeval`. Also correct usage in `writeFile()`/`writeFileSync()`.

view details

push time in 2 months

create barnchkevinkassimo/deno

branch : buf/writeAll

created branch time in 2 months

issue openeddenoland/deno

Discussion: CLI cache clean commands

(Migrated from gitter) We could potentially introduce some basic cache cleaning commands for Deno. Currently 2 super-duper simple and crude ideas:

  1. Clean by domain, something like deno clean https://github.com deletes all cached files under that domain (this one is somewhat easy to implement)
    • This could be slightly more granular:deno clean -d https://unpkg.com/lodash-es@4.17.11/
    • Rationale: assume related files to be hosted under the same domain/common path segment
  2. Clean by dependency exclusion. Since when we are building dependency tree each time we run a file, we can use such info to dictate deno to clean every file EXCEPT those that serves as dependency of a file. This also potentially allows third-party cli to create "dep lockers" to prevent certain dependency from being cleaned.
    • e.g. deno clean -p ./mydeps.ts. If mydeps.ts imports from all https://deno.land/std/, running this command would delete every cached remote files except for deno_std ones

created time in 2 months

PR closed denoland/deno

[DO NOT MERGE] Core test RwLock experiment

For testing only. Would close this once the benchmark on travis is completed.

This seems no improvement locally. However, not so sure if Arc<Mutex<Option<T>>> design could allow us to attach a clone of each resource in struct Resource such that we don't need to lock resource table during each poll yet still able to affect clones during close() by Option::take()

+64 -20

0 comment

1 changed file

kevinkassimo

pr closed time in 2 months

PR opened denoland/deno

[DO NOT MERGE] Core test RwLock experiment

For testing only. Would close this once the benchmark on travis is completed.

This seems no improvement locally. However, not so sure if Arc<Mutex<Option<T>>> design could allow us to attach a clone of each resource in struct Resource such that we don't need to lock resource table during each poll yet still able to affect clones during close() by Option::take()

+64 -20

0 comment

1 changed file

pr created time in 2 months

create barnchkevinkassimo/deno

branch : exp/rwlock

created branch time in 2 months

create barnchkevinkassimo/deno

branch : exp/locks

created branch time in 2 months

Pull request review commentdenoland/deno

Implement Deno.chown API for Unix/Linux

 use std::path::{Path, PathBuf}; use rand; use rand::Rng; +#[cfg(unix)]+use nix::unistd::chown as unix_chown;+#[cfg(unix)]+use nix::unistd::Gid;+#[cfg(unix)]+use nix::unistd::Uid;
use nix::unistd::{chown as unix_chown, Gid, Uid};
maxwyb

comment created time in 2 months

startedNixOS/nix

started time in 2 months

push eventdenolib/wishlist

Laurence Steven

commit sha 44dddc179bdc10c71609989f58f22d2522f14d51

Add graphql-js to Deno (#5)

view details

push time in 2 months

PR merged denolib/wishlist

Add graphql-js to Deno
+3 -1

0 comment

1 changed file

LaurenceM10

pr closed time in 2 months

Pull request review commentdenoland/deno

feat(cli cmd): deno xeval

 Prettier dependencies on first run.             .multiple(true)             .required(true),         ),+    ).subcommand(+      SubCommand::with_name("xeval")+        .setting(AppSettings::DisableVersion)+        .about("Eval a script on text segments from stdin")+        .long_about(+          "+Eval a script on lines (or chunks split under delimiter) from stdin.++Read from standard input and eval code on each whitespace-delimited+string chunks.++-I/--replvar optionally set variable name for input to be used in eval.+Otherwise '$' will be used as default variable name.++  cat /etc/passwd | deno xeval \"a = $.split(':'); if (a) console.log(a[0])\"+  git branch | deno xeval -I 'line' \"if (line.startsWith('*')) console.log(line.slice(2))\"+  cat LICENSE | deno xeval -d ' ' \"if ($ === 'MIT') console.log('MIT licensed')\"+",+        ).arg(+          Arg::with_name("replvar")+            .long("replvar")+            .short("I")+            .help("Set variable name to be used in eval, defaults to $")+            .takes_value(true),+        ).arg(+          Arg::with_name("delim")+            .long("delim")+            .short("d")+            .help("Set delimiter, defaults to newline")

Ooopsy, it should be beeline (though it is funny to see that xargs also claims to be white space delimited while actually working on new lines also)

This would be fixed along with other changes made to this feature as discussed above

kevinkassimo

comment created time in 2 months

pull request commentdenoland/deno

feat(cli cmd): deno xeval

I’m slightly concerned about map though since map has quite a few different other meanings (and consider something like source maps)... so I personally prefer foreach or each, matching Array.prototype.forEach()

kevinkassimo

comment created time in 2 months

pull request commentdenoland/deno

feat(cli cmd): deno xeval

@Alhadis Yeah I fully agree with your concern on $.

About the name, xeval is created under the intention that it works like xargs but also evaluates code like eval on each line. I think your point about map sounds very interesting, though technically forEach might makes more sense for comparison. Maybe we can name it xforeach, foreach or simply each?

kevinkassimo

comment created time in 2 months

delete branch kevinkassimo/deno

delete branch : cmd/version

delete time in 2 months

pull request commentdenoland/deno

fix: fix `deno version`

Oh lols

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

fix: fix `deno version`

Closes #2285

Avoid unwrap on None

+8 -1

0 comment

3 changed files

pr created time in 2 months

create barnchkevinkassimo/deno

branch : cmd/version

created branch time in 2 months

issue openeddenoland/deno

`deno version` panicks

$ deno version
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

created time in 2 months

Pull request review commentdenoland/

feat(cli cmd): deno xeval prototype

+import { Buffer } from "./buffer";+import { stdin } from "./files";+import { TextEncoder, TextDecoder } from "./text_encoding";+import { exit } from "./os";++export type XevalFunc = (v: string) => void;++async function writeAll(buffer: Buffer, arr: Uint8Array): Promise<void> {+  let bytesWritten = 0;+  while (bytesWritten < arr.length) {+    try {+      const nwritten = await buffer.write(arr.subarray(bytesWritten));+      bytesWritten += nwritten;+    } catch {+      return;+    }+  }+}++export async function xevalMain(+  xevalFunc: XevalFunc,+  delim_: string | null+): Promise<void> {+  const inputBuffer = new Buffer();+  const inspectArr = new Uint8Array(1024);+  const encoder = new TextEncoder();+  const decoder = new TextDecoder();+  if (!delim_) {+    delim_ = "\n";+  }+  const delimArr = encoder.encode(delim_); // due to unicode++  let nextMatchIndex = 0;+  while (true) {+    const rr = await stdin.read(inspectArr);+    if (rr.nread < 0) {+      exit(1);+    }+    const sliceRead = inspectArr.subarray(0, rr.nread);+    // Avoid unicode problems+    let nextSliceStartIndex = 0;+    for (let i = 0; i < sliceRead.length; i++) {

@ry I instead abstracted out chunks(reader, delim) that supports any string delimiter of any length.

kevinkassimo

comment created time in 2 months

Pull request review commentdenoland/

feat(cli cmd): deno xeval prototype

+import { Buffer } from "./buffer";+import { stdin } from "./files";+import { TextEncoder, TextDecoder } from "./text_encoding";+import { exit } from "./os";++export type XevalFunc = (v: string) => void;++async function writeAll(buffer: Buffer, arr: Uint8Array): Promise<void> {+  let bytesWritten = 0;+  while (bytesWritten < arr.length) {+    try {+      const nwritten = await buffer.write(arr.subarray(bytesWritten));+      bytesWritten += nwritten;+    } catch {+      return;+    }+  }+}++export async function xevalMain(+  xevalFunc: XevalFunc,+  delim_: string | null+): Promise<void> {+  const inputBuffer = new Buffer();+  const inspectArr = new Uint8Array(1024);+  const encoder = new TextEncoder();+  const decoder = new TextDecoder();+  if (!delim_) {+    delim_ = "\n";+  }+  const delimArr = encoder.encode(delim_); // due to unicode++  let nextMatchIndex = 0;+  while (true) {+    const rr = await stdin.read(inspectArr);+    if (rr.nread < 0) {+      exit(1);+    }+    const sliceRead = inspectArr.subarray(0, rr.nread);+    // Avoid unicode problems+    let nextSliceStartIndex = 0;+    for (let i = 0; i < sliceRead.length; i++) {

@ry I instead abstracted out chunks(reader, delim) that supports any string delimiter of any length.

kevinkassimo

comment created time in 2 months

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 28c520be0ab7575f2e8edd89a0ec9d8b2ead6f60

chore: abstract chunks async iterator Abstract chunks(reader, delim) async iterator function

view details

push time in 2 months

Pull request review commentdenoland/deno

feat(cli cmd): deno xeval prototype

+import { Buffer } from "./buffer";+import { stdin } from "./files";+import { TextEncoder, TextDecoder } from "./text_encoding";+import { exit } from "./os";++export type XevalFunc = (v: string) => void;++async function writeAll(buffer: Buffer, arr: Uint8Array): Promise<void> {+  let bytesWritten = 0;+  while (bytesWritten < arr.length) {+    try {+      const nwritten = await buffer.write(arr.subarray(bytesWritten));+      bytesWritten += nwritten;+    } catch {+      return;+    }+  }+}++export async function xevalMain(+  xevalFunc: XevalFunc,+  delim_: string | null+): Promise<void> {+  const inputBuffer = new Buffer();+  const inspectArr = new Uint8Array(1024);+  const encoder = new TextEncoder();+  const decoder = new TextDecoder();+  if (!delim_) {+    delim_ = "\n";+  }+  const delimArr = encoder.encode(delim_); // due to unicode++  let nextMatchIndex = 0;+  while (true) {+    const rr = await stdin.read(inspectArr);+    if (rr.nread < 0) {+      exit(1);+    }+    const sliceRead = inspectArr.subarray(0, rr.nread);+    // Avoid unicode problems+    let nextSliceStartIndex = 0;+    for (let i = 0; i < sliceRead.length; i++) {

Did not find this utility in deno_std. I'll add a comment nevertheless, saying we might want to port this to deno_std and later import from it once it is doable.

kevinkassimo

comment created time in 2 months

Pull request review commentdenoland/deno

feat(cli cmd): deno xeval prototype

 fn op_start(    let main_module = state.main_module().map(|m| builder.create_string(&m)); +  let xeval_delim = state+    .flags+    .xeval_delim+    .clone()

I believe yes, we are doing a move later as we initialize the StartResArgs struct (while state.flags.log_debug copies by default)

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

feat: support .mjs extension resolution

Closes #2270.

Removed extmap and added .mjs entry in map_file_extension. The assert in the compiler does not need to be updated, since it is resolving from the compiled cache instead of elsewhere (notice the .map is asserted next to it)

+8 -15

0 comment

5 changed files

pr created time in 2 months

create barnchkevinkassimo/deno

branch : ext/mjs

created branch time in 2 months

push eventkevinkassimo/deno

Bert Belder

commit sha 899951742100b83743ef9f65fbb161454ef4bfa7

core,cli: fix clippy warnings

view details

Bert Belder

commit sha cfff8a9c1bcf7406b5c597280cdfa34fcc68115e

ci: run clippy

view details

Ryan Dahl

commit sha 00ac871607a7aeff1f6ac90f10090f07be9ccf73

Optimize read and write ops (#2259)

view details

Kurt Mackey

commit sha 4d4dcafb96bdffa3050e863df0ef4ddd158ebf16

fixes body formData tests disabled in #2268 (#2274)

view details

Bartek Iwańczuk

commit sha bf9b0c8231d59bfcc79e55b6cde861b68975d5b4

Fix: deno --v8-options does not print v8 options (#2277)

view details

Bartek Iwańczuk

commit sha 459162fc6eeca5560e3b6a99fcd96d3246f8f4f3

add --no-fetch CLI flag to prevent remote downloads (#2213)

view details

Bert Belder

commit sha da428b52a1117dc260d52a752d01fafe9f0f165b

Bump required rustc version to 1.34.1

view details

Bert Belder

commit sha 52830414daa40b19ed8e06182bb2ea68cfd316af

ci: make the sanitize build fast again (#2280) sccache doesn't work for cache debug builds at the moment, because it doesn't support the `-Xclang -fdebug-compilation-dir` flag that has been added by the most recent V8 upgrade. This patch should make the asan/lsan job on Travis CI fast again.

view details

Kevin (Kun) Kassimo Qian

commit sha 01370f4c470473e940f131bb628fe865dda12f43

feat(cli cmd): deno xeval prototype Prototype for `deno xeval`. Allows an optional `-V/--var="varname"` flag to set varname to access

view details

Kevin (Kun) Kassimo Qian

commit sha 7a14643c435c872fd41b777ff63434fe9b4a188f

fix: delete unintended line (unexpectedly included code for experiment...)

view details

Kevin (Kun) Kassimo Qian

commit sha 7740efc1e09434becba5085000d39575a1d56ee7

fix: rename option and add long about section -V/--var => -I/--replvar

view details

Kevin (Kun) Kassimo Qian

commit sha ecf09422a5fe649783e401bbabd18609b6582fff

feat: add flag for delimiter -d/--delim for delimiter. Currently, clap does not escape input string, so -d "\n" will treat "\n" literally. We either have to use -d $'\n' or to introduce a package that does the escaping work.

view details

Kevin (Kun) Kassimo Qian

commit sha 6332fbdc95e0b09da1caff3d46dcc9027902188f

test: add tests Added 3 integration tests

view details

Kevin (Kun) Kassimo Qian

commit sha d4ef1b13b1a54c59e5af26c70b67117a3751fa7b

docs: update examples

view details

push time in 2 months

push eventkevinkassimo/deno

Yingbo (Max) Wang

commit sha da64fba046e4f324bff62d71ae74906fa6e3421f

symlink: Ignore type parameter on non-Windows platforms (#2185) Fixes #2169

view details

Bert Belder

commit sha 6caf8655070211d9771d349492c18d56c03b12b8

third_party: upgrade rust crates

view details

Ryan Dahl

commit sha 675919e915650cd1c88a1cdb4f67310133b8a05e

Use tokio_threadpool's new panic_handler (#2188)

view details

Ryan Dahl

commit sha d68b44b6b2fad6c321aa01a039030bb98c5be88d

core: make Isolate concrete, remove Dispatch trait (#2183) Op dispatch is now dynamically dispatched, so slightly less efficient. The immeasurable perf hit is a reasonable trade for the API simplicity that is gained here.

view details

Ryan Dahl

commit sha 6bece270b2719a66b564a411fc28c3b32ae0b105

Upgrade CI to Node v12 (#2193)

view details

Ryan Dahl

commit sha f6948235079b1d6050a2d3c98891844cb97595f5

Fix symlinkSyncNotImplemented (#2198)

view details

Ryan Dahl

commit sha 7fc9d7d62a864d1e6af0e77291a105726f73279c

core: Add test for snapshotting from Rust (#2197)

view details

迷渡

commit sha 8578ed4e7fcbddcbfb87368529f629ce1aebfebb

`URLSearchParams` deleting appended multiple (#2201)

view details

Ryan Dahl

commit sha e725b26b289fbe96b679039ba4203f10f7229ab9

v0.3.9

view details

David Stone

commit sha 098d6fffabb85d102b3662dacf3173c47e551d34

Fix anchor links and add spinner to the benchmarks page (#2205)

view details

Bartek Iwańczuk

commit sha b7d8a0c6f6e90a65243264faa3f702d1a9471090

Rename deno prefetch to deno fetch (#2210)

view details

Ryan Dahl

commit sha b426ecce80a968ae77cde9e242a9014bff371f79

compile lib.deno_runtime.d.ts into executable (#2209)

view details

Bartek Iwańczuk

commit sha aa85a4d2884e7600e0f64c457e20cd7f02b811c6

Rename CLI flags to subcommands (#2212)

view details

Ryan Dahl

commit sha 40d8ef1ec9f5e50017c41af8bf3b9f8454f97544

v0.3.10

view details

Greg Altman

commit sha 1d4b14e306f6d5c6ef8ce6b4ad9e6dfecca95a0d

core: add Deps::to_json() (#2223)

view details

迷渡

commit sha 6c9e0530f5eb8de112c08d9671551dd8a9324b38

URLSearchParams init with itself (#2218)

view details

Ryan Dahl

commit sha 78bce41c1484adfc291626993cc2e3636f7bd640

Use alt logos on benchmarks and manual page (#2211)

view details

Bartek Iwańczuk

commit sha 02596c08bdedebb7ffb53ead9cae2bd6bf98c238

disable --version flag from deno version (#2226)

view details

Yusuke Sakurai

commit sha 972ac03858cc11e8b6bb759ee69640d17235580d

recover: #1517 Kill all pending accepts when TCP listener is closed (#2224)

view details

迷渡

commit sha a4551c853e25a08ea479c5b75f60dc4109eee72f

fix test description for `atob` (#2232)

view details

push time in 2 months

issue commentdenoland/deno

eval, stdin, and curl don't work well together

This works fine for me though:

curl https://api.github.com/repos/denoland/deno/releases | deno eval "let b = await Deno.readAll(Deno.stdin); console.log(new TextDecoder().decode(b))"

[
  {
    "url": "https://api.github.com/repos/denoland/deno/releases/16986584",
    "assets_url": "https://api.github.com/repos/denoland/deno/releases/16986584/assets",
    "upload_url": "https://uploads.github.com/repos/denoland/deno/releases/16986584/assets{?name,label}",
    "html_url": "https://github.com/denoland/deno/releases/tag/v0.3.10",
    "id": 16986584,
    "node_id": "MDc6UmVsZWFzZTE2OTg2NTg0",
    "tag_name": "v0.3.10",
    "target_commitish": "40d8ef1ec9f5e50017c41af8bf3b9f8454f97544",
    "name": "",
    "draft": false,
    "author": {
      "login": "denobot",
// ...
ry

comment created time in 2 months

Pull request review commentdenoland/deno

feat(cli cmd): deno xeval prototype

 Prettier dependencies on first run.             .multiple(true)             .required(true),         ),+    ).subcommand(+      SubCommand::with_name("xeval")+        .setting(AppSettings::DisableVersion)+        .about("Eval a script on text segments from stdin")+        .long_about(+          "+Eval a script on lines (or chunks split under delimiter) from stdin.++Read from standard input and eval code on each whitespace-delimited+string chunks.++-I/--replvar optionally set variable name for input to be used in eval.+Otherwise '$' will be used as default variable name.++  cat list.txt | deno xeval 'console.log($)'+  cat list.txt | deno xeval -I 'val' 'console.log(val)'+  cat list.txt | deno xeval -d ' ' 'console.log($)'+  cat list.txt | deno xeval -d $'\\n' 'console.log($)'

I also try to find an example to use the -d flag. A quite contrived example is to check if somthing is MIT licensed:

cat LICENSE | deno xeval -d " " "if ($ === 'MIT') console.log('MIT licensed')"
kevinkassimo

comment created time in 2 months

Pull request review commentdenoland/deno

feat(cli cmd): deno xeval prototype

 Prettier dependencies on first run.             .multiple(true)             .required(true),         ),+    ).subcommand(+      SubCommand::with_name("xeval")+        .setting(AppSettings::DisableVersion)+        .about("Eval a script on text segments from stdin")+        .long_about(+          "+Eval a script on lines (or chunks split under delimiter) from stdin.++Read from standard input and eval code on each whitespace-delimited+string chunks.++-I/--replvar optionally set variable name for input to be used in eval.+Otherwise '$' will be used as default variable name.++  cat list.txt | deno xeval 'console.log($)'+  cat list.txt | deno xeval -I 'val' 'console.log(val)'+  cat list.txt | deno xeval -d ' ' 'console.log($)'+  cat list.txt | deno xeval -d $'\\n' 'console.log($)'

Or something like

git branch | deno xeval "if ($.startsWith('*')) console.log($.split()[1])"

to find current branch?

kevinkassimo

comment created time in 2 months

Pull request review commentdenoland/deno

fix: display "-0" for -0

 function stringify(     case "string":       return value;     case "number":+      // Special handling of -0+      return Object.is(value, -0) ? "-0" : `${value}`;

Yes, https://github.com/nodejs/node/blob/8876ac5c358114f0f88424f6737ca4b89fc9e6c7/lib/internal/util/inspect.js#L1026-L1029

kevinkassimo

comment created time in 2 months

PR opened denoland/deno

fix: display "-0" for -0

Closes #2276

Added special handling code in js/console.ts

+3 -0

0 comment

2 changed files

pr created time in 2 months

more