Ryan Dahl
0ceb554343
Native ES modules ( #1460 )
...
* Native ES modules
This is a major refactor of internal compiler.
Before: JS and TS both were sent through the typescript compiler where
their imports were parsed and handled. Both compiled to AMD JS and
finally sent to V8
Now: JS is sent directly into V8. TS is sent through the typescript
compiler, but tsc generates ES modules now instead of AMD. This
generated JS is then dumped into V8.
This should much faster for pure JS code. It may improve TS compilation
speed.
In the future this allows us to separate TS out of the runtime heap and
into its own dedicated snapshot. This will result in a smaller runtime
heap, and thus should be faster.
Some tests were unfortunately disabled to ease landing this patch:
1. compiler_tests.ts which I intend to bring back in later commits.
2. Some text_encoding_test.ts tests which made the file invalid utf8.
See PR for a discussion.
Also worth noting that this is necessary to support WASM
2019-01-09 12:59:46 -05:00
Ryan Dahl
6f79ad721a
Minimal Worker support ( #1476 )
...
This adds the ability to spawn additional Isolates from Rust and send
and receive messages from them. This is preliminary work to support
running the typescript compiler in a separate isolate and thus support
native ES modules. Ref #975 .
2019-01-08 14:44:06 -05:00
Ryan Dahl
57301909cd
Add deno.pid ( #1464 )
2019-01-06 14:16:42 -05:00
Ryan Dahl
ea6c9f2f36
Revert "use byte array instead of string for code fetch ( #1307 )" ( #1455 )
...
This reverts commit e976b3e041
.
There is nothing technically wrong with this commit, but it's adding
complexity to a big refactor (native ES modules #975 ). Since it's not
necessary and simply a philosophical preference, I will revert for now
and try to bring it back later.
2019-01-03 22:11:01 -05:00
Kevin (Kun) "Kassimo" Qian
e4be1209b6
Avoid fetch segfault on empty Uri ( #1394 )
2018-12-21 04:47:09 -05:00
Bartek Iwańczuk
c2b91a3ef6
Flesh out open() modes ( #1282 )
2018-12-12 12:05:58 -05:00
Tnarita0000
e31866a60d
Change default to false Base.bool
2018-12-12 11:44:56 -05:00
F001
e976b3e041
use byte array instead of string for code fetch ( #1307 )
2018-12-12 04:43:42 -05:00
Ryan Dahl
52079b26db
Minor rename for CodeFetch parameters
...
This bring it inline with terminology used in V8
See ResolveCallback in v8.h
2018-12-11 15:06:56 -05:00
binaryta
c427c2df42
Add TooLarge error code for buffers ( #1298 )
...
In collaboration with @yushimatenjin
2018-12-09 15:38:30 -05:00
Bert Belder
48bf4062e4
First pass at running subprocesses ( #1156 )
2018-11-16 12:07:40 +08:00
Ryan Dahl
3c8d2bde68
Support request method and headers in fetch() ( #1188 )
...
Adds a general HttpHeader flatbuffer message for serializing requests
and responses.
2018-11-14 17:36:34 -08:00
Ryan Dahl
b1579460ce
Support streaming response bodies from fetch()
...
Also Buffer.readFrom in fetch() to buffer response.
2018-11-13 21:44:38 -08:00
Andy Hayden
13e1eb2b87
Fix many of the clippy::pedantic warnings
2018-11-06 06:43:02 -08:00
Andy Hayden
27ecfc1617
Add repl ( #998 )
...
- Running repl from js side.
- Add tests for repl behavior.
- Handle ctrl-C and ctrl-D.
2018-11-05 09:55:59 -08:00
Ryan Dahl
ee24254bad
Rename EnvPair to KeyValue.
2018-11-02 20:50:01 -07:00
Ryan Dahl
80b5c61460
Rename FetchReq op to Fetch.
2018-10-30 17:42:19 -07:00
Bartek Iwańczuk
946acbc559
Add resources op ( #1119 )
2018-10-30 12:58:55 -07:00
Kitson Kelly
8b39d2c99e
Separate source map from output code.
2018-10-29 08:16:35 -07:00
Kevin (Kun) "Kassimo" Qian
a99aaf5def
Add chmod/chmodSync on unix (and fix Cargo.toml) ( #1088 )
...
Initial implementation by Srijan Reddy (@srijanreddy98, #672 ).
2018-10-26 13:01:45 -07:00
Kitson Kelly
8ef7da2611
Enforce media types
2018-10-23 04:48:00 -07:00
Jinho Bang
1322f3de9f
deno -v
should report typescript version
...
Fixes #993
2018-10-15 22:16:55 -04:00
Shiva Prasanth
bbf88c5295
Add cwd() and chdir() ( #907 )
2018-10-13 16:03:27 -04:00
Kitson Kelly
298d755152
Add support for --types
2018-10-11 20:29:43 -04:00
Bartek Iwańczuk
51f9331ecb
Add deno.metrics()
2018-10-11 15:45:51 -04:00
J2P
7cc9b64ff7
Rename BadFileDescriptor
2018-10-10 12:21:01 -04:00
Kevin (Kun) "Kassimo" Qian
941e27d8c1
Implement closeRead/closeWrite using TcpStream::shutdown ( #903 )
2018-10-05 12:16:23 -04:00
Ryan Dahl
f774953011
Rename flatbuffer base.msg to base.inner
...
This better disambiguates with the msg_generated.ts module, which in JS
we call "fbs", but would be better called "msg".
2018-10-04 00:25:55 -04:00
Ryan Dahl
0422b224e8
First pass at support for TCP servers and clients. ( #884 )
...
Adds deno.listen(), deno.dial(), deno.Listener and deno.Conn.
2018-10-03 23:58:29 -04:00
J2P
ea87034e26
Implemented readDirSync, readDir
2018-10-03 18:22:57 -04:00
Bert Belder
4eeda9ea27
timers: remove the old timer implementation
...
Fixes #878 .
2018-10-03 13:27:59 -07:00
Bert Belder
aa691ea26c
timers: implement timers in javascript
2018-10-03 13:27:55 -07:00
Ryan Dahl
42c5b103ec
Rename FdTable to ResourceTable.
...
Add docs to src/resources.rs.
2018-10-01 22:30:57 -04:00
Kevin (Kun) "Kassimo" Qian
50a9c2b575
Add copyFile/copyFileSync ( #863 )
2018-09-30 18:06:41 -04:00
Kevin (Kun) "Kassimo" Qian
eceeabdab2
Remove unused table WriteFileSync
2018-09-30 18:05:37 -04:00
ztplz
062b22fe56
Add deno.truncate ( #805 )
2018-09-30 15:06:20 -04:00
Ryan Dahl
bcbbee7399
Adds basic File I/O and FD table.
...
Adds deno.stdin, deno.stdout, deno.stderr, deno.open(), deno.write(),
deno.read(), deno.Reader, deno.Writer, deno.copy().
Fixes #721 . tests/cat.ts works.
2018-09-28 20:53:33 -04:00
Ryan Dahl
d38ccfc6dc
Support zero-copy data in libdeno.send(). ( #838 )
...
This is a large API refactor of deno.h which replaces
deno_send() and deno_set_response() with deno_respond().
It also adds a req_id parameter to the deno_recv_cb.
Make writeFile/writeFileSync use it.
2018-09-27 17:33:10 -04:00
Ryan Dahl
b088b58f76
Add SetGlobalTimeout().
...
To be used for a timers implementation soon.
2018-09-25 17:02:49 -04:00
Mani Maghsoudlou
ad5065e23e
Implement deno.readlink() ( #797 )
2018-09-25 00:20:49 -04:00
Bartek Iwańczuk
3fe4be07ca
Add flag --recompile ( #801 )
2018-09-24 15:33:50 -04:00
Mani Maghsoudlou
017ef096df
Implement deno.symlink() ( #742 )
2018-09-18 21:38:24 -07:00
Kevin (Kun) "Kassimo" Qian
e3d634eb21
Make mode always u32 and switch to has_mode for StatRes fbs ( #761 )
2018-09-17 16:53:55 -07:00
qti3e
41c70b154f
Add support for fetch() headers ( #727 )
2018-09-12 15:16:42 -04:00
Mani Maghsoudlou
88d42f0b18
Implement deno.rename() ( #731 )
2018-09-12 11:44:58 -04:00
Kevin (Kun) "Kassimo" Qian
26081a32df
Add unix-only mode
for FileInfo ( #732 )
2018-09-12 10:28:48 -04:00
Kevin (Kun) "Kassimo" Qian
1ffae65165
Add remove(), removeAll().
...
and removeSync(), removeAllSync().
2018-09-12 10:24:17 -04:00
Sajjad Hashemian
7c50c11f40
Implement deno.stat() and deno.lstat()
2018-09-11 16:05:00 -04:00
Kevin (Kun) "Kassimo" Qian
05f87a0cf2
Move writeFileSync to write_file.ts, add writeFile and tests ( #728 )
2018-09-11 12:00:57 -04:00
Sajjad Hashemian
c2663e1d82
Implement deno.mkdir()
2018-09-10 15:02:07 -04:00