Kitson Kelly kitsonk @ThoughtWorksInc Sydney, Australia http://www.kitsonkelly.com/ Principal Technologist @ThoughtWorksInc, contributing to @denoland and author of @oakserver

pull request commentdenoland/deno

Upgrade Typescript to 3.4.3

But that commit, of third_party is not part of this PR. The appropriate commit should be part of the PR.

Kermit-Xuan

comment created time in 6 days

pull request commentdenoland/deno_third_party

Upgrade Typescript to 3.4.3

I don't think this was installed with yarn, because it is not respecting the yarn autoclean settings and checking in some files that shouldn't be here.

Kermit-Xuan

comment created time in 6 days

issue commentdenoland/deno

Rename Deno into deno

Since both seem to be current and valid semantics, I would say there is no value in the code churn then.

Alexsey

comment created time in 7 days

pull request commentdenoland/deno

[WIP] Add support for loading tsconfig.json

Sorry it is taking so long, I am travelling with family and don't have as much time as I would expect.

I have moved the loading of the config directly into the thread safe state, which should make it easier to be able to add the config to the hash and detecting if CheckJS is enabled.

kitsonk

comment created time in 7 days

push eventkitsonk/deno

Bartek Iwańczuk

commit sha 1034d9723db59b6b7354d6d9804735ebe333d4a1

fix --v8-options (#2093)

view details

andy finch

commit sha 960ee5257a7b38c6b3b59a3dca670c7c1771996f

Improve op dispatch (#2088)

view details

Ryan Dahl

commit sha 8584d80cfd26111825af5a69fc6ae4c367ad0700

v0.3.7

view details

迷渡

commit sha ea1b0519f58887f0019ead942bf3de4490e7bc11

Update `deno -h` output in manual (#2099)

view details

Yoshiya Hinosawa

commit sha e0edcc9c1b025c2b02eb5b50ae7a86089d1c4d61

fix: re-expose DomFile (#2100)

view details

andy finch

commit sha d3bd5879c3b1a26cc09a5374bf2b5ee63071fe29

better wait for removed_from_resource_table_on_close test (#2104)

view details

Bartek Iwańczuk

commit sha 591b5e4a7dfc1c3537c7a2c7091ebe3890271780

Add deno eval subcommand (#2102)

view details

Yoshiya Hinosawa

commit sha 635ad2a18ecd26690e611f54062ae899fe307f96

fix absolute path resolution from remote (#2109)

view details

Ryan Dahl

commit sha a51e78215547f5b10498041a1c58b5fa29c22cbe

Upgrade deno_std (#2111)

view details

tanakaworld

commit sha b413cd5afd6b74b3e50bf6dbb5972ea7df9f34fd

docs: add a pixelated animation logo (#2110)

view details

Ryan Dahl

commit sha c7e1f8fabdc87d3622fd94769c57197d5dfecad3

Fix silent error, add custom panic handler (#2098) This is to work around Tokio's panic recovery feature. Ref https://github.com/tokio-rs/tokio/issues/495 Ref https://github.com/tokio-rs/tokio/issues/209 Ref https://github.com/denoland/deno/issues/1311 Fixes #2097

view details

Bert Belder

commit sha 64fb86c0cf6190d72096e58b71eca03ee10b6ed4

third_party: patch hyper to reduce worst-case response latency

view details

Bert Belder

commit sha 3bea62dd0e05d2081750ef2371c072b18a4bb69f

third_party: fix bug in hyper latency patch

view details

JaePil Jung

commit sha 9cb959ec95fed60f4a5e54fd09a0506fbbe4d9c9

Small fixes in manual.md (#2118)

view details

Bert Belder

commit sha 97f0fe7437ad4277afbdabf6cac214a40b637cd1

third_party: upgrade rust crates

view details

Dmitry Sharshakov

commit sha 0c463582206881b6461742633a67f51632db614e

Add max memory benchmark (#2061)

view details

Ryan Dahl

commit sha 1bfb44336914a775cd01120165517394d30aec23

Implement async module loading in CLI (#2084)

view details

Bert Belder

commit sha 2719631038918577c66db2558bbba457c8f4cfd9

core/http_bench: support -D flag to enable logging

view details

Bert Belder

commit sha dd595220abed9e4f9dd88e14110eb67f4f5e77be

core: run isolate tests within a task This change is made in preparation for using FuturesUnordered to track futures that are spawned by the isolate. FuturesUnordered sets up notififications for every future that it finds to be not ready when polled, which causes a crash if attempted outside of a task context.

view details

Bert Belder

commit sha 7807afa97274d3b0645d70475fecb37f5dc8ba14

core: make Isolate use FuturesUnordered to track ops Additionally, instead of polling ops in a loop until none of them are ready, the isolate will now yield to the task system after delivering the first batch of completed ops to the javascript side. Although this makes performance a bit worse (about 15% fewer requests/second on the 'deno_core_http_bench' benchmark), we feel that the advantages are worth it: * It resolves the extremely high worst-case latency that we were seeing on deno_core_http_bench, in particular when using the multi-threaded Tokio runtime, which would sometimes exceed a full second. * Before this patch, the implementation of Isolate::poll() had to loop through all sub-futures and poll each one of them, which doesn't scale well as the number of futures managed by the isolate goes up. This could lead to poor performance when e.g. a server is servicing thousands of connected clients.

view details

push time in 7 days

issue commentdenoland/deno

Polyfilling `require`

I think properly polyfilling require() would be challenging, and top level requires are essentially dynamic imports and would be a whole challenge because of the lack of top level await and the whole flow of the loading. Essentially you would be building a whole loader within a loader.

Both @benjamingr's solution and #2114 is a potential solution. #2114 would be the way that I think we should support it long term out of the box.

evenstensberg

comment created time in 11 days

issue openeddenoland/deno

Ability to support CheckJS

After #2089 lands, we will be able to add back support for "CheckJS". This feature can solve a couple problems:

  • It can statically analyse JavaScript code, leveraging JSDoc annotations, for any type violations without the code having to be authored in TypeScript.
  • It can in many cases transpile other module formats (e.g. CommonJS) to ESM for use in Deno without needing other pre-processing.

created time in 11 days

pull request commentdenoland/deno

[WIP] Add support for loading tsconfig.json

Yeah, I caught the appveyor as well. I am changing a couple things in the PR today and updating and fixing the appveyor failure as well.

I think the CheckJS should be another PR after this lands as it would require a lot of infrastructure. Also, I am going to load the configuration differently, in order to facilitate both CheckJS but also the cache invalidation, but that could be a subsequent PR as well.

kitsonk

comment created time in 11 days

Pull request review commentdenoland/deno

[WIP] Add support for loading tsconfig.json

 window.compilerMain = function compilerMain() {   }; }; +const decoder = new TextDecoder();++function getCompilerConfig(+  compilerType: string+): { path: string; data: string } {+  const builder = flatbuffers.createBuilder();+  const compilerType_ = builder.createString(compilerType);+  msg.CompilerConfig.startCompilerConfig(builder);+  msg.CompilerConfig.addCompilerType(builder, compilerType_);+  const inner = msg.CompilerConfig.endCompilerConfig(builder);+  const baseRes = sendSync(builder, msg.Any.CompilerConfig, inner);+  assert(baseRes != null);+  assert(msg.Any.CompilerConfigRes === baseRes!.innerType());+  const res = new msg.CompilerConfigRes();+  assert(baseRes!.inner(res) != null);++  const path = res.path()!;+  assert(path != null);+  const dataArray = res.dataArray()!;+  assert(dataArray != null);+  const data = decoder.decode(dataArray);+  return { path, data };+}+ export default function denoMain(): void {   os.start("TS");+  const { path, data } = getCompilerConfig("typescript");+  if (data.length) {+    log(`Configuring compiler from "${path}"`);+    const ignoredOptions = compiler.configure(path, data);+    if (ignoredOptions) {+      if (os.noColor) {+        console.warn(+          `Unsupported compiler options in "${path}"\n` ++            `  The following options were ignored:\n` ++            `    ${ignoredOptions.join(", ")}`

They would be very chatty. It can be logged out in debug. I wasn't even sure about this as it also would be chatty a lot of the time.

kitsonk

comment created time in 11 days

issue commentdenoland/deno

expose more globals

That would be a long long list. I think use case driven is still the best way. We are not going to implement name for example. 😄

JamesKyburz

comment created time in 11 days

issue commentdenoland/deno

deno cannot import file from url without context

Deno does not support "magic" index URLs. The web server would need to redirect to something with an extension.

Chococrok

comment created time in 11 days

issue commentdenoland/deno

Deno advantages and potential

The issue tracker really isn't a good place for something like this. The home page (https://deno.land/) provides a collection of information of the purpose and intent of Deno. General discussion occurs on Gitter (https://gitter.im/denolife/Lobby).

cllty

comment created time in 11 days

issue commentdenoland/deno

expose more globals

Request and Response are there, just not exposed globally.

Is there a use case for exposing them globally?

JamesKyburz

comment created time in 11 days

issue commentdenoland/deno

deno size

desire to improve the situation

You are comparing apples to oranges. We track the size the binary in the stats and do care about it, but the two things I mentioned above are significant differences to Node.js.

cup

comment created time in 11 days

Pull request review commentdenoland/deno

Add Deno.lines

 export function toAsyncIterator(r: Reader): AsyncIterableIterator<Uint8Array> {     }   }; }++/** Read lines asynchronously from `r`.+ *+ *      for await (const line of Deno.lines(reader)) {+ *          console.log(line);+ *      }+ */+export async function* lines(r: Reader): AsyncIterableIterator<string> {+  const decoder = new TextDecoder();+  let scratch = "";++  for await (const chunk of toAsyncIterator(r)) {

Yeah, that is complicated (using extensions). I was planning to tackle it in the medium term. Essentially we have to replace rollup.

bartlomieju

comment created time in 12 days

issue commentdenoland/deno

Deno.listen(":8000") gives an indecipherable error message

@swivelgames I think you are misunderstanding my opinion. Runtime argument checking is always chasing your tail in JavaScript. There are infinite numbers of ways of abusing APIs in JavaScript. Check JS feature would immediately give a meaningful error in this case, but we don't enable it at the moment.

Runtime argument type checking in JavaScript is a rabbit hole. I am just challenging the received wisdom of throwing a bunch of runtime type checking into a platform that has a much better and more accurate way of checking arguments that will always give more meaningful errors.

It us just an opinion to make people think, versus an immutable opinion.

ry

comment created time in 12 days

issue commentdenoland/deno

Deno.listen(":8000") gives an indecipherable error message

My concern has always been consistency in guarding against parameters at runtime and maintaining it considering the fact that we have TypeScript which does all of that essentially at runtime in Deno. My opinion is people choosing to abuse APIs in JavaScript who can get meaningful, self maintaining type errors get what they deserve. Restoring CheckJs would also allow this without the use of TS to get meaningful errors. That should be possible after we land the tsconfig. So that is my opinion, we should leverage that platform we have.

ry

comment created time in 13 days

Pull request review commentdenoland/deno

[WIP] Add support for loading tsconfig.json

 window.compilerMain = function compilerMain() {   }; }; +const decoder = new TextDecoder();++function getCompilerConfig(+  compilerType: string+): { path: string; data: string } {+  const builder = flatbuffers.createBuilder();+  const compilerType_ = builder.createString(compilerType);+  msg.CompilerConfig.startCompilerConfig(builder);+  msg.CompilerConfig.addCompilerType(builder, compilerType_);+  const inner = msg.CompilerConfig.endCompilerConfig(builder);+  const baseRes = sendSync(builder, msg.Any.CompilerConfig, inner);+  assert(baseRes != null);+  assert(msg.Any.CompilerConfigRes === baseRes!.innerType());+  const res = new msg.CompilerConfigRes();+  assert(baseRes!.inner(res) != null);++  const path = res.path()!;+  assert(path != null);+  const dataArray = res.dataArray()!;+  assert(dataArray != null);+  const data = decoder.decode(dataArray);+  return { path, data };+}+ export default function denoMain(): void {   os.start("TS");+  const { path, data } = getCompilerConfig("typescript");

It is only needed by the compiler os.start is shared between the compiler and the runtime.

kitsonk

comment created time in 15 days

pull request commentdenoland/deno_std

add json type for readJson/writeJson

There have been long discussions on this in TypeScript land. There is not a good JSON type other than any (see the likes of Microsoft/TypeScript#1897 and others). I would just keep it any which allows it to be cast to whatever. If TypeScript ever solves it we can adopt it them.

axetroy

comment created time in 15 days

PR opened denoland/deno

[WIP] Add support for loading tsconfig.json

Resolves #51

This PR supports the command line option -c/--config and a tsconfig.json file to be passed which will then be used by the compiler.

I need to do a couple things, plus any feedback on the PR:

  • [ ] finish tests
  • [ ] detect "checkjs": true in a configuration and send JS files to the compiler to re-enable the support of CheckJS for Deno.
  • [ ] when caching, add the configuration to the fingerprint so that using a different config file settings will invalidate the cache.
+280 -9

0 comment

11 changed files

pr created time in 15 days

push eventkitsonk/deno

Kitson Kelly

commit sha 4663ed911586a6d44e80cd7d9a58bbeab9f79563

Add support for loading tsconfig.json.

view details

push time in 15 days

push eventkitsonk/deno

Ryan Dahl

commit sha d2579f45641b437974829c87d58c2a362ef66919

core: Rename Behavior to Dispatch (#2082) And rename IsolateState to ThreadSafeState. Also make ThreadSafeState directly implement Dispatch. This is simpler.

view details

Yoshiya Hinosawa

commit sha 5a3f3a744559ef60a2367aaf0ded704713909112

upgrade deno_std & add workaround prettier issue (#2087)

view details

Bert Belder

commit sha fe2f3ba88949b467b14f76422400105c4dd52a79

Use correct type for `source_bytes` when buiding in check-only mode

view details

Bert Belder

commit sha 4ffe1612ff71c324fb0f0c23e1f92e9fa2d5473c

Silence clippy warnings and format source code

view details

Kitson Kelly

commit sha dd6e49434928a15f72ae56653e8e26b5342a64dd

Add support for loading tsconfig.json

view details

push time in 15 days

create barnchkitsonk/deno

branch : tsconfig

created branch time in 15 days

push eventkitsonk/deno_std

Vincent LE GOFF

commit sha c734e3234322cea5298a887373fe4ad1591d7c97

Refactor asserts in testing (#227)

view details

Evan Hahn

commit sha d430a241244c8b7af57c9b0c22664425987c86a8

Update mime-db to 1.38.0 (#238) mime-db@1.38.0 was released on 2019-02-04. This updates the JSON file.

view details

Andy Hayden

commit sha 0fc13fffbdb59d6aee2b11ff17a5de382273126b

Replace deno.land/x/ with deno.land/std/ (#239)

view details

Vincent LE GOFF

commit sha e1d5c00279132aa639030c6c6d9b4e308bd4775e

Testing refactor (#240)

view details

Ryan Dahl

commit sha 4cf39d4a1420b8153cd78d03d03ef843607ae506

Rename assertEq to assertEquals (#242) After some discussion it was found that assertEquals is more common in JS (vs assertEqual, assertEq) and sounds better in the negated form: assertNotEquals vs assertNE.

view details

Yoshiya Hinosawa

commit sha c67751659c50a3c0be5952e3092de7943aa9fa54

Bump CI to v0.3.2 (#245) replace Deno.platform with Deno.build

view details

Vincent LE GOFF

commit sha 899ab67cea12de812c041bcb5ea9ae7fd300d706

Add assertNotEquals, assertArrayContains (#246)

view details

Yoshiya Hinosawa

commit sha 395392912d69fe320d74c1f95a27be8e4adc0fa6

Use Deno global var instead of built-in "deno" module (#247)

view details

Andy Hayden

commit sha afaf343f376eaafc668d553322e5700c0c8c223f

Use fs.walk rather than git ls-files (#241)

view details

Ryan Dahl

commit sha 02274ef48bb298047f2a9a1821a75cd060fc5500

testing/asserts: Add unimplemented and unreachable (#248)

view details

Yoshiya Hinosawa

commit sha bf76484301cccbc857cdf205a44762239392ebed

refactor: use execPath where appropriate (#255)

view details

Eugen Cazacu

commit sha 84f9fe064984276781e7f9deb03544024d81c1a6

http: add return types (#250)

view details

Vincent LE GOFF

commit sha d4088a1920d005132bce2b0cd948ed74e0250563

Use AssertionError instead of Error in testing (#254)

view details

Eugen Cazacu

commit sha 2153fd264681d6e9c132dac1c33f346cd8139717

Eslint Fix http (#257)

view details

Vincent LE GOFF

commit sha 5852cd251b249ff19bda15f5eb29ac32b2176928

Datetime module improvement (#259)

view details

Axetroy

commit sha 142a1c6cf890e5c7626c4c934496fae1eee01715

add fs/exists (#260)

view details

Axetroy

commit sha 64d6bfca565acda9151ebb0b84911cc8d63c8c77

feat: add emptyDir for fs modules (#263)

view details

chiefbiiko

commit sha 4de86f04de8c83f8af184cb67b56f4022c17864f

Move benching into testing. (#258)

view details

Yoshiya Hinosawa

commit sha 61af419bbc5717c2e2552050aacb20ef1b17480b

fix: eslint errors (#265)

view details

Axetroy

commit sha 9ae941338aea09adf0d4f48d40f2b09131ae3d5f

feat: add ensureDir/ensureFile for fs modules (#264)

view details

push time in 15 days

pull request commentdenoland/deno

Upgrade to TypeScript 2.4

@JamesHenry we have just been pinning all our dependencies and only upgrading when we believe there is something of value. I will raise a PR to update those.

kitsonk

comment created time in 16 days

push eventkitsonk/deno

JaePil Jung

commit sha efbe44eb33bb8d19a68bc1a0889c4f2780894184

Fix missing return type (#2038)

view details

Bert Belder

commit sha b735155712b944004ac87ba5d3be7a9baccbf53e

Clippy fixes

view details

Bert Belder

commit sha 5f1e42f8ac3a051e83908dcdd0c1f9735b32a79a

cli: refactor compile_sync() for readability

view details

Ryan Dahl

commit sha 2b0f553e2e1b83ed8ff605f2ea25e2c31bb4c889

Add deno_core::RecursiveLoad for async module loading (#2034)

view details

Bert Belder

commit sha 917e68f30f25c22a87d0f8b8a2f39d27bc8ca906

Refactor deno_core::RecursiveLoad to be more idiomatic (#2034)

view details

迷渡

commit sha 6463a75b44a4f7aad6ffe04d0c5ae073fb5ca137

web-compatibility console (#2042)

view details

迷渡

commit sha 5f97c041d9115c480e3b9f428cfee27b109b3883

fix console.log when error has been caught (#2041)

view details

迷渡

commit sha bb617d24781d7c1e67e8e825cc07faba9a5df075

fix toString for some web objects (#2040)

view details

迷渡

commit sha 8c8576619852ee8b8095ca735f6d517a7e707e79

fix JSDoc (#2043)

view details

andy finch

commit sha 0e7311e1717edd312d371148f331fb558d9bcc4b

Non-fatal compile_sync failures (#2039) And model worker resources as Stream

view details

迷渡

commit sha 4520e5812e112dfb219f8eb6051ed8576141165a

fix code bug in jsdocs (#2048)

view details

Ryan Dahl

commit sha 0a26230a8753c7bb4b0f318fb12af0b219337446

Improve docs in core (#2049)

view details

Ryan Dahl

commit sha 744e56cb58f90acde7baf8811676021fb55b2f2a

v0.3.6

view details

andy finch

commit sha 07f0d077c749f2cbefcc8c1c394c6a63d588b0cf

add compile_async (#2053)

view details

wangtxxl

commit sha 031411b449b1990241c0ff0565e01e60f30b769a

fix v0.3.6 date error (#2051)

view details

andy finch

commit sha 7a3df0a18465ceebe43f3183daa2f9397c4e5ebb

Add worker benchmarks (#2059)

view details

push time in 19 days

push eventkitsonk/deno

Bartek Iwańczuk

commit sha 597ee38ef28d040cbf4d629cf3d2bd3e89a70a11

Rewrite readFile and writeFile (#2000) Using open/read/write

view details

ztplz

commit sha 8ac36d8db421864604a835c50a68411b3f69d62a

Fix typo (#2010)

view details

迷渡

commit sha 1fec34b4632521068c31815c1d9f92286b6d0297

Check `CustomEvent` constructor params (#2011)

view details

Bert Belder

commit sha da1b98b690e39ce4becf314910d046b9850f650f

Clippy fixes (#2009)

view details

Ryan Dahl

commit sha 51abcd614731bdb47a79f9f0c0fed81ddb7a474a

Make sharedQueue overflow warning quieter (#2008)

view details

Ryan Dahl

commit sha c25e262b04c15d4de7107cc131de467882e7dcec

Merge the --recompile and --reload flags (#2003)

view details

Bartek Iwańczuk

commit sha bdc455dd25b4c0d14fd30bc32c07206b2b93a007

Add Process.stderrOutput() (#1828)

view details

Ryan Dahl

commit sha b965c7ab367a417fb7bdde2eaf38312179e5c183

v0.3.5

view details

Bert Belder

commit sha 3d6c033369a75b7eea7b4fa6be36696b613b1606

third_party: upgrade rust crates

view details

迷渡

commit sha 51c6f33f64c7e805b789aec9a28f62d09b91a3a4

Avoid search prototype chain (#2019)

view details

迷渡

commit sha ad3cbc50fb255f287a890a28f158f6842d335538

check `EventTarget` params (#2018)

view details

Ryan Dahl

commit sha c9614d86c190b98bd8f0df9e17272387c3bad1d5

Move //libdeno to //core/libdeno (#2015) Fixes some sed errors introduced in c43cfe. Unfortunately moving libdeno required splitting build.rs into two parts, one for cli and one for core. I've also removed the arm64 build - it's complicating things at this re-org and we're not even testing it. I need to swing back to it and get tools/test.py running for it.

view details

Ryan Dahl

commit sha 6744bb8d750b9ab11d2ec9448334732b98feb58a

Call ninja directly from build.rs (#2020)

view details

Ryan Dahl

commit sha e9910d8ae510fcef54ae2f0a83199daa81c15df1

Rename crate deno_core to deno (#2022)

view details

Ryan Dahl

commit sha 3ba4c3c2b08f9827af67b208f276e95082b625bd

Remove deno_core_http_bench from core/Cargo.toml (#2023) So we don't have to have an optional tokio dependency. We build deno_core_http_bench using GN anyway.

view details

Bert Belder

commit sha 97265895baaf7e90180f10f7ef741e9bbf1dcfd0

Publish rust crate on crates.io (#2024)

view details

Bert Belder

commit sha ff1c80d6d896a3c1cb45d767a6c667ce99eb000b

third_party: add rust crate 'clap'

view details

迷渡

commit sha c855d0edd2ef5098b806ac6368eb7b0a85d0d0c9

Update `deno -h` output in manual (#2030)

view details

Kitson Kelly

commit sha ada5ffa610d2b5400b612917b35d91b98bee2309

Upgrade to TypeScript 3.4.1 (#2027)

view details

迷渡

commit sha 659acadf77fdbeef8579a37839a464feb408437a

Improve new TextDecoder().toString() (#2032)

view details

push time in 23 days

issue commentjashkenas/coffeescript

Support CoffeeScript on the new `deno` JavaScript engine

The privaliged side of Deno (Rust) would handle the module resolution and caching. I would suspect given the NodeJS API, that the wrapper would be super light. After a compiler is instantiated with something like this:

new Worker("https://coffeescript.org/browser-compiler-modern/coffeescript.js", {
  deno: {
    extensions: [ "coffee" ],
    media_types: [ "application/vnd.coffeescript" ]
  }
});

The web worker would receive an onmessage which would contain a payload of a Module Specifier and a Referrer. The compiler would need to use a privileged API to fetch the contents of module (fetchModuleMetaData) supplying the same module specifier and referrer. That would cause the privileged side (Rust) to resolve the module, including retrieving a remote module from the network, and returning the fully qualified module specifier, the media type, and any source code. If the compiler needs other modules meta data to fully transpile the code, it can continue to request additional modules (e.g. TypeScript has to resolve all dependencies in order to properly type check a module).

The compiler is then expected to pass back an ESM module and a source map.

The compiler will only be called to transpile a module if Rust has determined that either the cache is invalid or that the module isn't cached. When the data is returned, Rust will handle caching it locally.

When the module is returned, the privileged side will inject the module into the V8 runtime and V8 will resolve any additional dependencies, if those dependencies resolve to an extension or media type covered by the compiler, it will then repeat the cycle.

We haven't thought through the details of externally configuring a compiler yet, so that you would "always" have it at startup.

As far as a timeline, I have another piece of work in my backlog before really starting the public compiler API, and we need full web worker support which is about to land in Deno. So I expect I would really start working on it in a week or two. We always talked about using CoffeeScript as the "use case" for proving out the public compiler API, so this was timely.

shreeve

comment created time in 23 days

issue commentjashkenas/coffeescript

Support CoffeeScript on the new `deno` JavaScript engine

Hey! Just piping in on this issue. Contributor to Deno and look a lot at the compiler APIs. We have denoland/deno#1739. In order to get "good" CoffeeScript support, we would want to plug in the CoffeeScript compiler to the yet to be public compiler API. This would give the equivalent level of support that the TypeScript compiler has which includes the ability to fetch remote modules and have automatic caching.

We have most of the fundamentals almost there and I will be working on it in the near future. It is planned that the public API for compiler will run as a web worker. The options passed to the web worker would define what media types and extensions should be routed to the compiler when attempted to be loaded. Those will be sent to the compiler and the compiler is expected to return an ESM module which will then be injected into the runtime environment.

A compiler should have a single bundle of JavaScript which interfaces to the public API.

shreeve

comment created time in 23 days

pull request commentdenoland/deno

Upgrade to TypeScript 2.4

DOH! Yes... Thanks @ztplz

kitsonk

comment created time in 24 days

push eventkitsonk/deno

Bartek Iwańczuk

commit sha 597ee38ef28d040cbf4d629cf3d2bd3e89a70a11

Rewrite readFile and writeFile (#2000) Using open/read/write

view details

ztplz

commit sha 8ac36d8db421864604a835c50a68411b3f69d62a

Fix typo (#2010)

view details

迷渡

commit sha 1fec34b4632521068c31815c1d9f92286b6d0297

Check `CustomEvent` constructor params (#2011)

view details

Bert Belder

commit sha da1b98b690e39ce4becf314910d046b9850f650f

Clippy fixes (#2009)

view details

Ryan Dahl

commit sha 51abcd614731bdb47a79f9f0c0fed81ddb7a474a

Make sharedQueue overflow warning quieter (#2008)

view details

Ryan Dahl

commit sha c25e262b04c15d4de7107cc131de467882e7dcec

Merge the --recompile and --reload flags (#2003)

view details

Bartek Iwańczuk

commit sha bdc455dd25b4c0d14fd30bc32c07206b2b93a007

Add Process.stderrOutput() (#1828)

view details

Ryan Dahl

commit sha b965c7ab367a417fb7bdde2eaf38312179e5c183

v0.3.5

view details

Bert Belder

commit sha 3d6c033369a75b7eea7b4fa6be36696b613b1606

third_party: upgrade rust crates

view details

迷渡

commit sha 51c6f33f64c7e805b789aec9a28f62d09b91a3a4

Avoid search prototype chain (#2019)

view details

迷渡

commit sha ad3cbc50fb255f287a890a28f158f6842d335538

check `EventTarget` params (#2018)

view details

Ryan Dahl

commit sha c9614d86c190b98bd8f0df9e17272387c3bad1d5

Move //libdeno to //core/libdeno (#2015) Fixes some sed errors introduced in c43cfe. Unfortunately moving libdeno required splitting build.rs into two parts, one for cli and one for core. I've also removed the arm64 build - it's complicating things at this re-org and we're not even testing it. I need to swing back to it and get tools/test.py running for it.

view details

Ryan Dahl

commit sha 6744bb8d750b9ab11d2ec9448334732b98feb58a

Call ninja directly from build.rs (#2020)

view details

Ryan Dahl

commit sha e9910d8ae510fcef54ae2f0a83199daa81c15df1

Rename crate deno_core to deno (#2022)

view details

Ryan Dahl

commit sha 3ba4c3c2b08f9827af67b208f276e95082b625bd

Remove deno_core_http_bench from core/Cargo.toml (#2023) So we don't have to have an optional tokio dependency. We build deno_core_http_bench using GN anyway.

view details

Bert Belder

commit sha 97265895baaf7e90180f10f7ef741e9bbf1dcfd0

Publish rust crate on crates.io (#2024)

view details

Bert Belder

commit sha ff1c80d6d896a3c1cb45d767a6c667ce99eb000b

third_party: add rust crate 'clap'

view details

Kitson Kelly

commit sha 921b49580306a4601f126ab126b809562068eacf

Upgrade to TypeScript 2.4

view details

push time in 24 days

push eventkitsonk/deno_third_party

Bert Belder

commit sha 8b97fa2fe0c212bedba19c52e5a6fcc70ee5265e

Upgrade rust crates

view details

Bert Belder

commit sha d2df9adb30b15326c1f481420df7bacb468cf440

Add rust crate 'clap'

view details

Kitson Kelly

commit sha 1902aba524c96f56c1dd654f04660a1fc3ebf80d

Upgrade to TypeScript 2.4

view details

push time in 24 days

PR opened denoland/deno

Upgrade to TypeScript 2.4

This PR upgrades Deno to TypeScript 2.4.

ts-morph does not yet support TypeScript 2.4 (@dsherret), so there were some changes ts_library_builder to allow it to use the library files from the version of TypeScript that it comes bundled with, which is used to validate the output library file. Deno will still use 2.4 and the associated library files. I also fixed several linting issues with ts_library_builder as well.

+116 -86

0 comment

7 changed files

pr created time in 24 days

create barnchkitsonk/deno

branch : ts-24

created branch time in 24 days

PR opened denoland/deno_third_party

Upgrade to TypeScript 2.4
+32207 -16973

0 comment

29 changed files

pr created time in 24 days

create barnchkitsonk/deno_third_party

branch : ts-24

created branch time in 24 days

issue commentdenoland/deno

Implement import-maps

That is needed for tscconfig.json too...

kitsonk

comment created time in a month

issue commentdenoland/deno_std

Axios-like wrapper on top of fetch

Also, it has a lot of really bad behaviours that would need to be replicated to be compatible. Again something that would likely be better addressed with a shim for targeted code to make it functional than something that is part of Deno.

sh7dm

comment created time in a month

push eventkitsonk/deno

ztplz

commit sha 989e86c8de70b75dcb89abf119879b55a80eb008

Fix some typos (#2005)

view details

迷渡

commit sha 8c770c5a90d4c0c48256f17371a5de6604270031

remove `isTrusted`'s setter (#2006)

view details

Ryan Dahl

commit sha d0b6152f11800b0baac1ae68d2eef7bfcea13cb5

Fix error when JS is executed with --recompile (#2007) test case from @afinch7

view details

push time in a month

push eventkitsonk/deno

迷渡

commit sha ed2977d3c0e9ab3295a3bb47b844b2953d608197

Check `Event` constructor params (#1997)

view details

Kitson Kelly

commit sha c43cfedeba5d6ac96e1b1febed8549e750606e3f

namespace reorg: libdeno and DenoCore to Deno.core (#1998)

view details

0xflotus

commit sha d78b4112c65b77dbf1839f06c0776a7e4691fb25

fixed typo (#2001)

view details

Kevin (Kun) "Kassimo" Qian

commit sha 5c4189a3b8aa80e05088a4b01ecd5eccdd1540fb

Do not close file on invalid seek mode (#2004)

view details

push time in a month

create barnchkitsonk/deno_third_party

branch : ext-ts

created branch time in a month

push eventkitsonk/deno

andy finch

commit sha cdfd32dd74d6286afe99fb5400e3dc0e9f2cec49

Re-implement init scripts in core (#1958) Re-enables arm64 CI test

view details

Ryan Dahl

commit sha 8f3d0ca6649236434ee7a795f5a2cea114d44847

Deprecate DENO_BUILD_MODE=release Instead use: tools/build.py --release

view details

Ryan Dahl

commit sha c7d81fa9ff495986675c05e52e13acc9ffc85372

Make write_gn_args.py quiet

view details

Ryan Dahl

commit sha fa3c35301aa44975776b96c85f200de8eb500c22

Rename //src/ to //cli/ (#1962) To better distinguish the deno_core crate from the executable deno, which will now be called "the cli" internally.

view details

Ryan Dahl

commit sha 2c5030000b317b703333b63dcbd77efda5c3d487

Add async version of http_util::fetch_sync_string

view details

Ryan Dahl

commit sha 5e4312de4d82ae3a41a0f5142eb75b8d804f8897

Move fetch_remote_source, fetch_local_source They do not depend on DenoDir, so should not be methods of it.

view details

Ryan Dahl

commit sha fb2c0c29ec79434a2ca8354efe8b5e2de8a92558

Add fetch_remote_source_async (#1972)

view details

andy finch

commit sha 6131152a575f86c7510702091ba18f061628674f

Remove old Buf definition in cli.rs (#1971)

view details

andy finch

commit sha 48bf419669694802f82b418b901cb282957fb64f

Separate behavior for the compiler isolate (#1973)

view details

Ryan Dahl

commit sha 4c831f1eb5e5eae4d56c82c941260f5b18940369

Add more async module loading function (#1974) * get_source_code_async * fetch_module_meta_data_async * fetch_module_meta_data_and_maybe_compile_async

view details

Ryan Dahl

commit sha 8f334ae56887cc5291be20da8b9288fe7054410e

Improve pretty printing of objects If an object has more than 5 elements, it is printed in abbeviated form displaying only the keys. This is useful in the REPL when inspecting large objects like the Deno namespace: > Deno { args, noColor, pid, env, exit, isTTY, execPath, chdir, cwd, File, open, stdin, stdout, stderr, read, write, seek, close, copy, toAsyncIterator, SeekMode, Buffer, readAll, mkdirSync, mkdir, makeTempDirSync, makeTempDir, chmodSync, chmod, removeSync, remove, renameSync, rename, readFileSync, readFile, readDirSync, readDir, copyFileSync, copyFile, readlinkSync, readlink, statSync, lstatSync, stat, lstat, symlinkSync, symlink, writeFileSync, writeFile, ErrorKind, DenoError, libdeno, permissions, revokePermission, truncateSync, truncate, connect, dial, listen, metrics, resources, run, Process, inspect, build, platform, version, Console, stringifyArgs, DomIterableMixin }

view details

Ryan Dahl

commit sha 842627d6b905f71aea821c426a886022b07270a5

pretty-print long strings

view details

Ryan Dahl

commit sha 9444bd71a0b9165ef1a900f19b08a88592d2bb5c

Website and manual improvements (#1967)

view details

Ryan Dahl

commit sha 9831a440ca0f2186c4a1afe981a31dabf6084099

Disable arm test again getting this failure on travis: https://travis-ci.com/denoland/deno/jobs/186518015 $ $CARGO_TARGET_DIR/aarch64-unknown-linux-gnu/release/deno tests/002_hello.ts qemu: Unsupported syscall: 278 qemu: Unsupported syscall: 278 Compiling file:///home/travis/build/denoland/deno/tests/002_hello.ts

view details

Ryan Dahl

commit sha 223a2adbb46cb33e75ffe861ecaff6ff7e6d555e

v0.3.4

view details

Ryan Dahl

commit sha 94405bb61722142e8c4d90bb5f31038fc9aa5f72

Fix clippy errors and upgrade Rust to 1.33.0 in CI (#1945)

view details

Simon Menke

commit sha 93793dc45504fcc7927354c7e4f39d6de406e9d4

core: Allow terminating an Isolate from another thread (#1982)

view details

andy finch

commit sha 1499d57490f2d928e57b21c992e559fc403cad42

Remove dead code (#1983)

view details

Ryan Dahl

commit sha 12753e492f924e32be2a74d94720213f1d5c6b66

Website updates (#1984)

view details

迷渡

commit sha efe9c18b459dbec71b213e8dc87e2e1b02477139

remove `console` constructor (#1985)

view details

push time in a month

pull request commentdenoland/deno

libdeno and DenoCore to Deno.core

@ry I think the Appveyor failure is not related to this PR and something transitory. It is passing everywhere else. 🤷‍♂️

kitsonk

comment created time in a month

pull request commentdenoland/deno

libdeno and DenoCore to Deno.core

Ok, it is removed.

Strangely the GN_OUT_DIR is working on OSX both on my local machine and remotely. I will raise a seperate PR for that though after this lands.

kitsonk

comment created time in a month

push eventkitsonk/deno

Bernard Lin

commit sha 3cc90d9bcf4be58bf88b433ae410f42fa4ad69c7

Add benchmark for max latency (#1975)

view details

Bartek Iwańczuk

commit sha 5ae78eb1de378f04d0b9d54842bcb898053467d6

Update ts_library_builder (#1920)

view details

Ryan Dahl

commit sha d8714281b40f457420608c7e766fe787609c7afb

Resolve callback moved from Behavior to mod_instantiate() (#1999) This simplifies the Behavior trait and makes it more explicit where the resolve callback is being made. Also s/StartupScript/Script

view details

Kitson Kelly

commit sha 0d2f87d2e70f439887733a8a9d732e0b8c751c24

libdeno and DenoCore to Deno.core

view details

push time in a month

issue commentMicrosoft/TypeScript

Why does TypeScript PM advice not to use const enum? If so, why not take out from language SPEC

Why does TypeScript PM advice not to use const enum?

@DanielRosenwasser didn't say don't use const enums, just use them appropriately. The problem is that it causes the TypeScript compiler to "hard code" all the values, fully erasing the enum, which, when using a self contained library where that enum won't be leaked outside of that code base is slightly more runtime efficient. Most cases though, you don't want the enum fully erased at runtime.

I think @nattthebear's suggestion is a good one, though the handbook basically says "use regular enums unless..." already:

In most cases, enums are a perfectly valid solution. However sometimes requirements are tighter. To avoid paying the cost of extra generated code and additional indirection when accessing enum values, it’s possible to use const enums.

And it talks about how they are fully erased. I guess the only thing it doesn't say is they should be limited in use to "internal" enums.

LiangMingChen

comment created time in a month

issue commentoakserver/oak

The second post JSON will result in 404 errors

Sorry, I haven't been paying attention. I will look into it, I think you are right @bartlomieju but does it mean that Oak should always consume the body when processing requests?

manyuanrong

comment created time in a month

pull request commentdenoland/deno

libdeno and DenoCore to Deno.core

Why don't we do the renaming of stuff but hold off on the .js to .ts for the shared array? I will remove that from this PR.

kitsonk

comment created time in a month

push eventkitsonk/deno

Kitson Kelly

commit sha b98418f874402acc3ecc9625bf733d059e68a6a1

libdeno and DenoCore to Deno.core

view details

push time in a month

push eventkitsonk/deno

Kitson Kelly

commit sha 51ce47db870b9b397ce5e95dbbf63dbe634b0352

libdeno and DenoCore to Deno.core

view details

push time in a month

pull request commentdenoland/deno

libdeno and DenoCore to Deno.core

@ry @piscisaureus it seems that at the stage the build tries to compile core on Windows the GN_OUT_DIR is not set: https://ci.appveyor.com/project/deno/deno/builds/23324075#L1060

I am not familiar enough with it to understand what is going wrong here. Any thoughts?

kitsonk

comment created time in a month

PR closed denoland/deno

Convert shared_queue to TypeScript

@ry don't know if this is exactly as clean as you would want it, but it works and should give you an idea.

+86 -27

1 comment

5 changed files

kitsonk

pr closed time in a month

pull request commentdenoland/deno

Convert shared_queue to TypeScript

Closing in favour of #1998

kitsonk

comment created time in a month

PR opened denoland/deno

libdeno and DenoCore to Deno.core

Resolves #1956

This PR migrates the libdeno namespace and the DenoCore namepsace to Deno.core. Also all the properties of Deno.core are prefaced with _ and not included in the runtime type library, as they are not intended for end user use and internal to Deno only.

This also converts the /core/*.js files to .ts and builds them.

+241 -163

0 comment

24 changed files

pr created time in a month

create barnchkitsonk/deno

branch : deno-core-ns

created branch time in a month

pull request commentdenoland/deno

remove unused code

Why linting didn't pick it up. The removal was correct.

justjavac

comment created time in a month

pull request commentdenoland/deno

remove unused code

Because it isn't unused. const console shadowed the global console.

justjavac

comment created time in a month

issue commentdenoland/deno

Custom tsconfig.json

It is being worked on.

jedmao

comment created time in a month

issue commentdenoland/deno

discussion: state and platform info shouldn't be required by js code

While you can abstract away most things within Deno, you cannot do that externally. For example Deno allows you to invoke external processes. Depending on the workload, a programme author would need to vary that by platform. There is no way you can abstract that, nor should Deno be in that business.

Permissions is similar in that authors of libraries used by others need to write code that behaves well no matter what the runtime state is, in order to ensure the correct behaviour of their code.

You can always write crap code. We can only do so much to prevent it.

afinch7

comment created time in a month

issue commentdenoland/deno

Typescript to webassembly compilation

@otabekgb I highly doubt it. V8 is very highly optimised, much better than I would assume assemblyscript would be, especially when it comes to things like GC and fast pathing code.

I think to even consider it, a performance proof of concept would be needed, even then I highly suspect there would be lots of issues in accessing and supporting non-TC39 APIs, like the browser ones and the Deno ones.

I would be glad to be proven wrong. Deno supports web assembly, so taking a TypeScript application (one that is representative of a performance benchmark) running it under Deno against a .wasm transpiled version would give a good idea of potential performance. Ideally it would also do importing of more than one module to see how that would work in a real world application.

otabekgb

comment created time in a month

push eventkitsonk/deno

andy finch

commit sha e98d3391de9abf6be0c2be18651611c66eec4073

Re-enable permissions prompt tests (#1957)

view details

Ryan Dahl

commit sha 34a2aa4de6cfe334cf0d26620d244d5c66a976a4

Remove Eager read, write, accept (#1959) Removing this reduces tail latency in test/http_bench.ts by half.

view details

push time in a month

push eventkitsonk/deno

Nikola Ristic

commit sha 22f791c26caca980305bd74692de020d900cfff0

Typo fix in styleguide (#1946)

view details

Ryan Dahl

commit sha 52b7cc5499061bb79708a0db92bf9b2d0828f3c3

Fix entry point for tools/docs.py

view details

Ryan Dahl

commit sha 59ac2063e0563586a901b664f6ea05e9b6ef11b5

Remove unused tools/build_test.py file

view details

andy finch

commit sha 08a674bf917185fe9d00907120d3f03599a810a0

More permissions prompt options (#1926)

view details

andy finch

commit sha b711a8d0474cd914c564b691b48cc55abf4480cf

CI jobs should fail quicker on bad test_format or lint (#1954)

view details

Ryan Dahl

commit sha 33438b83a2a2597c2b9918475dd5362faa5c1728

Re-order tests for sanity

view details

Ryan Dahl

commit sha 44773c9b0fe4ae90089c87aa46d049a0a58cccce

Integrate //core into existing code base This disables a few tests which are broken still: - tests/error_004_missing_module.test - tests/error_005_missing_dynamic_import.test - tests/error_006_import_ext_failure.test - repl_test test_set_timeout - repl_test test_async_op - repl_test test_set_timeout_interlaced - all of permission_prompt_test

view details

push time in a month

issue commentdenoland/deno

JS API: Rename DenoCore namespace to Deno.core

FYI, I am working on this one.

ry

comment created time in a month

issue commentdenoland/deno

String.normalize()

Sounds like it might be the same category as #1636.

zekth

comment created time in a month

issue commentMicrosoft/TypeScript

Possibly bug, TS cannot infer narrow type properly

This is also covered in the Do's and Don'ts of TypeScript Union Types.

alexeypetrushin

comment created time in a month

issue commentMicrosoft/TypeScript

Possibly bug, TS cannot infer narrow type properly

Why did you not fill out the template properly before opening the issue. In particular, you did not provide search terms you used.

This is a duplicate of #1805 and many many other issues (which are linked in that issue).

alexeypetrushin

comment created time in a month

pull request commentdenoland/deno_std

[WIP] feat: add http client module

I think if there is a decent standard that is part of the web platform (fetch()) that we shouldn't cloud std with overlapping APIs. While some people might not like the API, that alone is not a good reason to confuse people. It is better off left just in the registry.

axetroy

comment created time in a month

PR opened denoland/deno

Convert shared_queue to TypeScript

@ry don't know if this is exactly as clean as you would want it, but it works and should give you an idea.

+86 -27

0 comment

5 changed files

pr created time in a month

create barnchkitsonk/deno

branch : ts_shared_queue

created branch time in a month

push eventkitsonk/deno

Ryan Dahl

commit sha ae4405d747f8a990e1dd31b7bb1166ca7fad9921

Make some renames in js/build.ts (#1912) * Replace Deno.OSType enum with Deno.OperatingSystem type alias * Add arm64 to supported CPU architectures * add type alias for cpu arch Deno.Arch

view details

Jed Fox

commit sha ad21be837036574154e8aa69b06001a1eb380b2b

manual: Improve formatting (#1842)

view details

Ryan Dahl

commit sha 6b07ed189cc0a787065d3cdb87a0bf2e09b29d58

Small cleanups for //core (#1914) * Privatize a few deno_core::Isolate methods * Add deno_core::Isolate docs

view details

Ryan Dahl

commit sha 9691d7b53bea5a2656ec47e8437fac1f527b3cce

Sort ops

view details

Ryan Dahl

commit sha 58cc69f672f91841984fc4e1e9bcfb1a75362677

Make timers act like normal ops This is in preperation for core integration.

view details

andy finch

commit sha 7e092210312af337a118c70865c2eb2593c83192

--no-prompt flag for non-interactive environments (#1913)

view details

Ryan Dahl

commit sha 3dbb06e699398549e8cfabc896ef3256ab433cba

v0.3.3

view details

Jack Rowlingson

commit sha bf9e5334a8c8432ea7513efced39a180a81b4675

Fix command in manual.md (#1931)

view details

Ryan Dahl

commit sha 630ead1296dd53fa8f13b7598fd6700dc7a2d9f1

Upload mac/sccache that doesn't link to openssl (#1929) Fixes #1787

view details

Ryan Dahl

commit sha 45fad1b7cfd44376d8be35288b7213636bc93450

allow v8 cli flags on deno_core_http_bench (#1934)

view details

Ryan Dahl

commit sha 76c73ec61ec4271581795a2f0e3ae60072676dae

Add --no-binary-download option to setup.py (#1916)

view details

Ryan Dahl

commit sha 1811318097b57c136913bd95bb9e16d820cc1a1a

core: Behavior shouldn't be generic We always pass around Box<[u8]>, and adding this generic is an unnecessary complication. Add deno_core_http_bench_test to test.py sharedQueue works on deno_core_http_bench

view details

Ryan Dahl

commit sha 1e3509df42e996ea092ae7e8b5a61aef51c92c2b

disable arm64 test

view details

Yoshiya Hinosawa

commit sha 4dbc33c6e3824bc56c884a58a8cfd814e266257d

docs: fix example (#1936)

view details

Vincent LE GOFF

commit sha b2f15cf21ae7b08986468dd8d18b06f9c2e97dc2

jsdoc style guide update (#1932)

view details

Ryan Dahl

commit sha bb642e8c7c9f8ab16540d2e3b1ef6a5543ded91e

Fix TextDecoder for SharedArrayBuffer backed TypedArray (#1940)

view details

Bert Belder

commit sha 62761a4e3a12e123d32c7d78a06f6565118d63b4

core: remove reset() from SharedQueue API

view details

Vincent LE GOFF

commit sha 23108b06b9c8803e44e0e251bdbe193a5cf16ad6

Add test style guide (#1918)

view details

joemclo

commit sha 785b48a423abf98490ac1ea7aebc2020fe445bc1

Fix a missing import in manual.md example for testing (#1935)

view details

push time in a month

pull request commentdenoland/deno

Update ts_library_builder

It should be declare interface FizzBuzz, you will have to toggle some of the flags on that node.

bartlomieju

comment created time in a month

issue commentMicrosoft/TypeScript

Feature Request --noAnyProperties

Then what you are looking for is the unknown type. any means any, which allows intentional unfettered access to the variable, breaking that would be a horrible idea.

Jojoshua

comment created time in a month

issue commentMicrosoft/TypeScript

Feature Request --noAnyProperties

This is already well covered by linting rules in both eslint and tslint:

  • https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-explicit-any.md
  • https://palantir.github.io/tslint/rules/no-any/
Jojoshua

comment created time in a month

issue commentMicrosoft/TypeScript

Support proposed ES Next "|>" pipeline operator

Yes, that is what I consider a serious issue.

graingert

comment created time in a month

issue commentMicrosoft/TypeScript

Support proposed ES Next "|>" pipeline operator

Any updates?

🤦‍♂️ TypeScript does not implement proposal until they reach Stage 3. The pipeline operator is currently Stage 1 and has serious issues. That information has been provided multiple times in this thread.

graingert

comment created time in a month

issue commentdenoland/deno

Support import()

Just to be clear, this was implemented but during the re-write to use ESM natively, it had to be dropped to be re-implemented later. It is currently sitting in @ry's backlog.

hayd

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++type Replacer = (key: string, value: any) => any;++export interface WriteJsonOption {
export interface WriteJsonOptions {
axetroy

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;

It can be, but I wouldn't want people to use the API that way... If we can tighten up APIs we should, even if what we are backing off to supports something different.

axetroy

comment created time in a month

issue commentdenoland/deno_std

testing: Generate lcov

Duplicate of denoland/deno#106

We need to address it there.

zekth

comment created time in a month

Pull request review commentdenoland/deno

Update ts_library_builder

 export function mergeGlobal({   // to extract the type and add it to the global variable map   sourceFile.forEachChild(node => {     if (TypeGuards.isExpressionStatement(node)) {+      console.log(

Do you really want this debug code in the final? You should leverage the silent option if you really want to output this. 😀

bartlomieju

comment created time in a month

issue commentdenoland/deno

Add KV Storage Built In Module

I meant the KV Storage implementations not the browser itself.

That is also in the draft spec... Like the ordering of keys, etc. There are a couple concerns regarding this layering though which are also addressed in the draft spec: https://wicg.github.io/kv-storage/#perfect-polyfill

kitsonk

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;+}++type Replacer = (key: string, value: any) => any;++/**+ * Writes an object to a JSON file.+ * @export+ * @param {string} filePath+ * @param {*} object+ * @param {WriteJsonOption} [options]+ * @returns {Promise<void>}

No, because those include the types... we want something that does not include the types.

@j-f1 any rule you know of to keep types out of JSDoc?

axetroy

comment created time in a month

pull request commentdenoland/deno

Update ts_library_builder

@bartlomieju we crossed the streams on that.

bartlomieju

comment created time in a month

issue commentdenoland/deno

Update ts_library_builder to properly handle global types

lib.web_assembly.d.ts is a different beast, though they are closely related... lib.web_assembly.d.ts are declarations that should be in TypeScript (see: Microsoft/TypeScript#29747) and hopefully will one day, so all we are doing is replicating that.

In this case we are taking an already existing global interface and extending it.

Actually thinking about lib.web_assembly.d.ts, we should inline it in assets.ts and include it in the lib: [ "esnext", "web_assembly" ] in our configuration for the compiler.ts. We would then replace it with the official one when/if the issue gets resolved. (See: #1930)

bartlomieju

comment created time in a month

issue openeddenoland/deno

Move web assembly lib to assets.ts

From #1854

Actually thinking about lib.web_assembly.d.ts, we should inline it in assets.ts and include it in the lib: [ "esnext", "web_assembly" ] in our configuration for the compiler.ts. We would then replace it with the official one when/if the issue gets resolved.

created time in a month

Pull request review commentdenoland/

Update ts_library_builder

 export type TextDecoder = textEncoding.TextDecoder; window.performance = new performanceUtil.Performance();  window.workerMain = workers.workerMain;++// @ts-ignore

Also it might make sense to only deal with exported interfaces from this module.

bartlomieju

comment created time in a month

Pull request review commentdenoland/deno

Update ts_library_builder

 export type TextDecoder = textEncoding.TextDecoder; window.performance = new performanceUtil.Performance();  window.workerMain = workers.workerMain;++// @ts-ignore

I really don't like using this... I would just export the interface then the error will go away.

bartlomieju

comment created time in a month

Pull request review commentdenoland/

Update ts_library_builder

 export type TextDecoder = textEncoding.TextDecoder; window.performance = new performanceUtil.Performance();  window.workerMain = workers.workerMain;++// @ts-ignore

Also it might make sense to only deal with exported interfaces from this module.

bartlomieju

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;+}++type Replacer = (key: string, value: any) => any;++/**+ * Writes an object to a JSON file.+ * @export+ * @param {string} filePath+ * @param {*} object+ * @param {WriteJsonOption} [options]+ * @returns {Promise<void>}

If you want to provide descriptions you can do that, this JSDoc is not doing that. If providing descriptions is informative then the following would be acceptable:

/** Some description
 * @param filePath The path to the file
 */

What is included here is not acceptable. Need to find out if there is an eslint rule for this.

axetroy

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;

This should be failing linting... Also, why null? That makes no sense.

  replacer?: Array<number | string> | Replacer;
axetroy

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;+}++type Replacer = (key: string, value: any) => any;

Should be declared before it is used. Also will be failing linting due to explicit use of any.

axetroy

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {
export interface WriteJsonOptions {
axetroy

comment created time in a month

Pull request review commentdenoland/deno_std

feat: add writeJson/writeJsonSync for fs modules

+// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.+import * as path from "./path/mod.ts";++interface WriteJsonOption {+  spaces?: number | string;+  replacer?: (number | string)[] | null | Replacer;+}++type Replacer = (key: string, value: any) => any;++/**+ * Writes an object to a JSON file.+ * @export+ * @param {string} filePath+ * @param {*} object+ * @param {WriteJsonOption} [options]+ * @returns {Promise<void>}

Correct. We shouldn't be using JSDoc like this.

axetroy

comment created time in a month

issue commentdenoland/deno

Add KV Storage Built In Module

What happens when the way that x browser stores this information in IndexDB is not exactly the same as y browser?

Well that is part of the IndexDB spec.

kitsonk

comment created time in a month

Pull request review commentdenoland/deno_std

Assertion improvement

 // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.-import { assertEquals as prettyAssertEqual } from "./pretty.ts";+import { createStr, buildDiffMessage, buildMessage } from "./pretty.ts";+import diff, { DiffResult } from "./diff.ts";  interface Constructor {   // eslint-disable-next-line @typescript-eslint/no-explicit-any   new (...args: any[]): any; }  export class AssertionError extends Error {-  constructor(message: string) {+  constructor(message?: string) {     super(message);-    this.name = "AssertionError";+    this.name = "Assertion Error";

I agree... It should be AssertionError

> new RangeError().name
"RangeError"
> new TypeError().name
"TypeError"
zekth

comment created time in a month

issue commentdenoland/deno

Add KV Storage Built In Module

Well, if you look at the spec, there is a expected back off to IndexedDB where you can gain access to the db instance for advanced usage.

kitsonk

comment created time in a month

issue commentoakserver/oak

Router prefix

You should be able to fork the repo into your own account and raise a pull request. Most projects don't allow contributors push access to their main repos.

msweda

comment created time in a month

issue commentdenoland/deno

IndexedDB

This is really complicated when you dig into it.

There is no Rust implementation of IndexDB (there is a crate that appears to be squatting, but it really isn't an implementation). Servo does not support IndexedDB, they have a long standing issue to implement. So on the Rust front it is sort of a dead end.

In Node.js, there are no realistic implementations either. Again there is a package squatting on indexeddb, but it isn't really a good package at all. The one thing that seems to have promise is IndexedDBShim which sits on top of WebSQL, and there are native implementations of WebSQL on Node.js using sqlite3.

jsdom doesn't implement IndexedDB or WebSQL, though there is this issue talking about implementing the IndexedDB shim mentioned above, I assume requiring the WebSQL implementation. It looks like it is stalled.

There is also an in memory IndexedDB API written in TypeScript.

There is what looks like a realistic Rust create for sqlite3.

So outside of using a C++ implementation, which would be a break in the pattern, the only realistic path I can easily see is that to use the in memory IndexedDB written in TypeScript, which would not give persistent storage, or we could adapt the in memory version and wire it up to a Rust sqlite3 bindings to persist the data.

I don't think just persisting out to JSON really works, because IndexedDB is a bit more complex than that, it contains concepts like transactions and other database features which is why almost all the browser implementations are based on sqlite3 IIRC.

sh7dm

comment created time in a month

issue commentdenoland/deno

Add KV Storage Built In Module

Actually reading the spec further, it is actually a standard modern API layer on top of IndexDB and uses IndexDB to persist the storage. So #1699 is a requirement before we could implement this.

kitsonk

comment created time in a month

issue openeddenoland/deno

Add KV Storage Built In Module

In Chromium 74, KV Storage has been implemented as a built-in module. The module is a far more rational API than IndexDB (and local storage).

The WICG draft is located here: https://wicg.github.io/kv-storage/

This would require #1922

This could negate the need for #1699

created time in a month

more