1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-02 09:34:19 -04:00
Commit graph

167 commits

Author SHA1 Message Date
Ryan Dahl
8a4533eb75 feat: deno eval -p (#5682) 2020-06-06 09:07:59 -04:00
Bert Belder
9a783ae4e6
ci: upgrade to Rust 1.44.0 (#6113) 2020-06-05 05:11:15 +02:00
Ryan Dahl
23dc9c13db
Fix REPL BorrowMutError panic (#6055) 2020-06-02 16:37:52 -04:00
Bartek Iwańczuk
c813990806
fix: compile TS dependencies of JS files (#6000)
This commit fixes regression that caused TS dependencies
not being compiled.

Check was added that ensures TS compiler is run if 
any of dependencies in module graph is TS/TSX/JSX.
2020-06-01 21:01:51 +02:00
Bartek Iwańczuk
02d46bae9f
fix: media type for .cjs and application/node (#6005) 2020-05-31 21:08:26 +02:00
Bartek Iwańczuk
550556e948
fix: ES private fields parsing in SWC (#5964) 2020-05-30 17:32:48 +02:00
Nayeem Rahman
8e39275429
fix(cli/permissions): Fix CWD and exec path leaks (#5642) 2020-05-29 17:27:43 +02:00
Bartek Iwańczuk
ad6d2a7734
refactor: TS compiler and module graph (#5817)
This PR addresses many problems with module graph loading
introduced in #5029, as well as many long standing issues.

"ModuleGraphLoader" has been wired to "ModuleLoader" implemented
on "State" - that means that dependency analysis and fetching is done
before spinning up TS compiler worker.

Basic dependency tracking for TS compilation has been implemented.

Errors caused by import statements are now annotated with import
location.

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-05-29 16:32:15 +02:00
Kitson Kelly
2668637e9b
fix: REPL evaluates in strict mode (#5565)
Since everything that Deno loads is treated as an ES Module, 
it means that all code is treated as "use strict" except for 
when using the REPL. This PR changes that so code in the 
REPL is also always evaluated with "use strict". There are 
also a couple other places where we load code as scripts 
which should also use "use strict" just in case.
2020-05-29 12:24:06 +02:00
uki00a
55311c33c4
chore(integration_tests): stop collecting unnecessary output in permissions tests (#5926) 2020-05-28 19:40:33 -04:00
Bert Belder
131f2a5f0c
fix: BorrowMutError when evaluating expression in inspector console (#5822)
Note that this does not fix the 'Uncaught ReferenceError' issue that
happens when 'eager evaluation' is enabled in the inspector.

Fixes: #5807
2020-05-25 04:26:33 +02:00
Bert Belder
ee0b5bb89e
test: add utility function for assigning unique port to inspector (#5822) 2020-05-25 02:41:59 +02:00
Bartek Iwańczuk
c3c16f025c
fix: TSX analysis in module graph loader (#5785) 2020-05-23 19:04:29 +02:00
Bartek Iwańczuk
960f9ccb2e
fix: SWC lexer settings and silent errors (#5752)
This commit changes how error occurring in SWC are handled.
Changed lexer settings to properly handle TS decorators.
Changed output of SWC error to annotate with position in file.
2020-05-22 19:23:35 +02:00
Bartek Iwańczuk
e191c70989
fix: ts type imports (#5733) 2020-05-22 19:05:18 +02:00
Bartek Iwańczuk
f9e45114b9
fix: redirects handling in module analysis (#5726)
This commit fixes a bug introduced in #5029 that caused bad 
handling of redirects during module analysis. 

Also ensured that duplicate modules are not downloaded.
2020-05-22 16:01:00 +02:00
Bartek Iwańczuk
491feb859f
fix: --inspect flag working like --inspect-brk (#5697) 2020-05-21 20:34:25 +02:00
Bartek Iwańczuk
5f9c1c7da6
fix: disallow http imports for modules loaded over https (#5680) 2020-05-21 13:06:12 +02:00
Ryan Dahl
30702e2678
move js unit tests to cli/tests (#5678) 2020-05-20 17:52:51 -04:00
Speykious
9752b853dd
Provide better ANSI colorized output when inspecting objects (#5404) 2020-05-19 14:19:26 -04:00
uki00a
cdc9323ccc
fix: REPL does not exit properly when close() is called (#5451) 2020-05-19 13:33:11 -04:00
Bartek Iwańczuk
9d63772fe5
refactor: rewrite TS dependency analysis in Rust (#5029)
This commit completely overhauls how module analysis is 
performed in TS compiler by moving the logic to Rust.

In the current setup module analysis is performed using 
"ts.preProcessFile" API in a special TS compiler worker 
running on a separate thread.

"ts.preProcessFile" allowed us to build a lot of functionality
in CLI including X-TypeScript-Types header support 
and @deno-types directive support. Unfortunately at the 
same time complexity of the ops required to perform 
supporting tasks exploded and caused some hidden 
permission escapes.

This PR introduces "ModuleGraphLoader" which can parse
source and load recursively all dependent source files; as 
well as declaration files. All dependencies used in TS 
compiler and now fetched and collected upfront in Rust 
before spinning up TS compiler.

To achieve feature parity with existing APIs this commit 
includes a lot of changes:

* add "ModuleGraphLoader"
  - can fetch local and remote sources
  - parses source code using SWC and extracts imports, exports, file references, special 
     headers
  - this struct inherited all of the hidden complexity and cruft from TS version and requires 
     several follow up PRs
* rewrite cli/tsc.rs to perform module analysis upfront and send all required source code to 
  TS worker in one message
* remove op_resolve_modules and op_fetch_source_files from cli/ops/compiler.rs
* run TS worker on the same thread
2020-05-18 12:59:29 +02:00
Bartek Iwańczuk
e16eb9e108
chore: capture stderr in integration tests (#5549)
This commit removes "check_stderr" setting from itest! macro used
to generate integration tests. Without this setting on tests discarded
output of stderr making it very hard to debug the problem in test.

Numerous tests were changed by adding "--quiet" flag to not display
"Compile"/"Download" prompts.
2020-05-17 17:42:39 +02:00
uki00a
c5a54e44bc
chore: port deno_dir_test to Rust (#5408) 2020-05-15 10:22:28 -04:00
Ryan Dahl
73d8fa74c6
BREAKING: There is no public Rust API for the CLI (#5226) 2020-05-11 17:33:36 -04:00
Ryan Dahl
fb7d7f40ed
Merge std_tests.rs into integration_tests.rs.rs (#5228)
* Remove usage of url_to_filename from integration_tests
* Make test ports not conflict with each other
2020-05-11 14:49:19 -04:00
Bartek Iwańczuk
32aeec9630
refactor: check permissions in SourceFileFetcher (#5011)
This PR hot-fixes permission escapes in dynamic imports, workers
and runtime compiler APIs.

"permissions" parameter was added to public APIs of SourceFileFetcher
and appropriate permission checks are performed during loading of
local and remote files.
2020-05-11 13:13:27 +02:00
Ryan Dahl
eb505f8afc
Add support for X-Deno-Warning header (#5161) 2020-05-09 12:43:24 -04:00
crowlKats
abbf0339cd
feat(upgrade): allow specifying a version (#5156) 2020-05-09 06:31:15 -04:00
Ryan Dahl
4e5e6da348
Add hint on how to exit REPL (#5143)
Removes exit and help commands
2020-05-08 18:58:51 -04:00
Bartek Iwańczuk
aca21dad1b
BREAKING: make Worker.deno unstable (#5128)
This commit makes "Worker.deno" option unstable.

Added new manual entry "docs/runtime/workers.md".

Removed stale workers tests.
2020-05-07 21:15:59 +02:00
Bartek Iwańczuk
2b66b8a03e
BREAKING: Remove support for .wasm imports (#5135)
Importing .wasm files is non-standardized therefore deciding to
support current functionality past 1.0 release is risky.

Besides that .wasm import posed many challenges in our codebase
due to complex interactions with TS compiler which spawned
thread for each encountered .wasm import.

This commit removes:
- cli/compilers/wasm.rs
- cli/compilers/wasm_wrap.js
- two integration tests related to .wasm imports
2020-05-07 20:43:27 +02:00
Bartek Iwańczuk
0ba90c8c11
fix(imports): fix panic on unsupported scheme (#5131) 2020-05-07 15:57:10 +02:00
Ryan Dahl
6666f1d36a
remove target_test.py (#5112) 2020-05-06 16:34:48 -04:00
Ryan Dahl
221221cc97
BREAKING: execPath should require allow-read (#5109) 2020-05-06 15:51:33 -04:00
Bert Belder
e513751ee9
Clean up 'inspector_break_on_first_line' test and fix its flakiness (#5098) 2020-05-06 04:32:14 +02:00
Bert Belder
e574437922
Fix inspector hanging when task budget is exceeded (#5083)
The issue is solved by proxying websocket messages over a pair of
`futures::mpsc::unbounded` channels. As these are are implemented in
the 'futures' crate, they can't participate in Tokio's cooperative
task yielding.
2020-05-05 16:12:45 +02:00
Ryan Dahl
6c02b061ce
stabilize Deno.cwd and require --allow-read (#5068) 2020-05-04 14:23:06 -04:00
Ryan Dahl
92c0591fcb
simplify unit tests: compiler_api, workers (#5073) 2020-05-04 10:40:18 -04:00
Bartek Iwańczuk
a913b7a1ba
BREAKING: remove CLI 'deno script.ts' hack (#5026)
This PR removes the hack in CLI that allows to run scripts with shorthand: deno script.ts.

Removing this functionality because it hacks around short-comings of clap our CLI parser. We agree that this shorthand syntax is desirable, but it needs to be rethinked and reimplemented. For 1.0 we should go with conservative approach that is correct.
2020-05-04 13:03:30 +02:00
Bartek Iwańczuk
2872b362ff
BREAKING: disallow static import of local modules from remote modules (#5050)
This commit changes module loading logic to disallow statically import
local module (file:// scheme) from remote modules (http://, https://
schemes).
2020-05-02 15:51:08 +02:00
Bartek Iwańczuk
de2c042482
BREAKING: remove support for JSON imports (#5037)
This commit removes support for importing JSON files as modules.

This change is dictated by security; browsers rolled back on this
support as well.
2020-05-02 00:32:05 +02:00
Nayeem Rahman
96fd0f4692
BREAKING: feat(cli/installer): Support guessing the executable name (#5036) 2020-05-01 15:33:11 -04:00
Fenzland
25b765c123
fix misaligned error reporting on tab char (#5032) 2020-05-01 13:03:54 -04:00
Luca Casonato
80e2211141
Unstable methods should not appear in runtime or d.ts (#4957)
Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
2020-04-30 11:23:40 -04:00
Luca Casonato
e6f70c77ee
Make import maps unstable (#4934) 2020-04-28 01:12:38 +02:00
Bartek Iwańczuk
7a94ea08e9
fix(core): fix top-level-await error handling (#4911) 2020-04-27 17:25:26 +02:00
Ryan Dahl
4036be2ab2
Make runtime compile ops unstable (#4912) 2020-04-27 09:59:34 -04:00
Ryan Dahl
0c47cd6785
introduce unstable flag, make a few things unstable (#4892) 2020-04-25 09:31:54 -04:00
Nayeem Rahman
5bfe3eb8f4
feat(cli/installer.rs): Add DENO_INSTALL_ROOT (#4787) 2020-04-16 18:15:42 -04:00