1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

29 commits

Author SHA1 Message Date
crowlKats
e435c2be15
Remove doc strings from cli/js TS files (#4329)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-13 10:22:22 +01:00
Bartek Iwańczuk
99a0c6df79
reorg: cli/js/compiler/, move more API to cli/js/web/ (#4310)
- moves compiler implementation to "cli/js/compiler/" directory
- moves more APIs to "cli/js/web":
    * "console.ts"
    * "console_table.ts"
    * "performance.ts"
    * "timers.ts"
    * "workers.ts"
- removes some dead code from "cli/js/"
2020-03-11 10:53:06 +01:00
Bartek Iwańczuk
2e59007214 move Web APIs to cli/js/web/ 2020-03-05 18:48:55 +01:00
Bartek Iwańczuk
52b96fc22a
refactor: cleanup compiler runtimes (#4230)
- Cleanup "tsCompilerOnMessage" by factoring out separate methods for each 
  request type:
    * "compile"
    * "runtimeCompile"
    * "runtimeTranspile"
- Simplify control flow of compiler workers by a) no longer calling "close()" in worker runtime after a
single message; b) explicitly shutting down worker from host after a single message

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-03-05 11:13:10 +01:00
Kitson Kelly
83d902a780
Fix JavaScript dependencies in bundles. (#4215)
Fixes #4602

We turned off `allowJs` by default, to keep the compiler from grabbing
a bunch of files that it wouldn't actually do anything useful with.  On
the other hand, this caused problems with bundles, where the compiler
needs to gather all the dependencies, including JavaScript ones.  This
fixes this so that when we are bundling, we analyse JavaScript imports
in the compiler.
2020-03-02 22:18:27 +01:00
Kitson Kelly
1d26da6a47
feat: Support types compiler option in compiler APIs (#4155)
Handles `types` in the compiler APIs to make it easier to supply
external type libraries.
2020-02-27 11:27:00 -05:00
Kitson Kelly
6431622a6d
fix: mis-detecting imports on JavaScript when there is no checkJs (#4040)
This PR fixes an issue where we recursively analysed imports on plain JS files
in the compiler irrespective of "checkJs" being true. This caused problems
where when analysing the imports of those files, we would mistake some
import like structures (AMD/CommonJS) as dependencies and try to resolve
the "modules" even though the compiler would not actually look at those files.
2020-02-19 22:58:05 -05:00
Bartek Iwańczuk
79b3bc05d6
workers: basic event loop (#3828)
* establish basic event loop for workers
* make "self.close()" inside worker
* remove "runWorkerMessageLoop() - instead manually call global function 
  in Rust when message arrives. This is done in preparation for structured clone
* refactor "WorkerChannel" and use distinct structs for internal 
  and external channels;  "WorkerChannelsInternal" and "WorkerHandle"
* move "State.worker_channels_internal" to "Worker.internal_channels"
* add "WorkerEvent" enum for child->host communication; 
  currently "Message(Buf)" and  "Error(ErrBox)" variants are supported
* add tests for nested workers
* add tests for worker throwing error on startup
2020-02-11 10:04:59 +01:00
Kitson Kelly
ea6179f7dc
Improve support for diagnostics from runtime compiler APIs (#3911)
- Exports diagnostic items from `diagnostics.ts` which are missing at
  runtime.
- Returns an array of diagnostics, instead of an object with a property
  of `items`.  This is because of the way Rust deals with certain
  structures, and shouldn't be exposed in the APIs.
2020-02-07 01:54:05 -05:00
Bartek Iwańczuk
161adfc51b
workers: proper TS libs, more spec-compliant APIs (#3812)
* split lib.deno_main.d.ts into:
  - lib.deno.shared_globals.d.ts
  - lib.deno.window.d.ts
  - lib.deno.worker.d.ts
* remove no longer used libs:
  - lib.deno_main.d.ts
  - lib.deno_worker.d.ts
* change module loading to use proper TS library for compilation
* align to Worker API spec:
  - Worker.terminate()
  - self.close()
  - self.name
2020-01-29 18:54:23 +01:00
Bartek Iwańczuk
ac10d79d23 refactor: isomorphic snapshot for CLI (#3728) 2020-01-27 21:12:25 -05:00
Kitson Kelly
950537e8ef Break out runtime lib to main and worker (#3771)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-01-24 14:15:01 -05:00
Bartek Iwańczuk
bd9561f4de
Reland "Create an old program to be used in snapshot." (#3747)
* read CLI assets from disk during snapshotting
2020-01-22 20:18:01 +01:00
Ry Dahl
fa7f34eb8c
Revert "Create an old program to be used in snapshot. (#3644)"
Ref #3712. This change allowed the deno_typescript crate to reference
cli/js/lib.deno_runtime.d.ts which breaks "cargo package". We intend to
reintroduce a revised version of this patch later once "cargo
package" is working and tested.

This reverts commit 737ab94ea1.
2020-01-21 14:57:56 -05:00
Bartek Iwańczuk
5e2fd183ff
refactor: Rename JS entry functions (#3732) 2020-01-21 15:53:29 +01:00
Bartek Iwańczuk
7966bf14c0
refactor: split worker and worker host logic (#3722)
* split ops/worker.rs into ops/worker_host.rs and ops/web_worker.rs

* refactor js/workers.ts and factor out js/worker_main.ts - entry point for WebWorker runtime

* BREAKING CHANGE: remove support for blob: URL in Worker

* BREAKING CHANGE: remove Deno namespace support and noDenoNamespace option in Worker constructor

* introduce WebWorker struct which is a stripped down version of cli::Worker
2020-01-21 09:49:47 +01:00
Kitson Kelly
60b53fd6b6 Use globalThis to reference global scope (#3719)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-01-20 09:30:30 -05:00
Klaus Hvam
35eb79610f Fix compile and bundle api types (#3703) 2020-01-17 17:45:18 -05:00
Kitson Kelly
737ab94ea1 Create an old program to be used in snapshot. (#3644) 2020-01-12 12:20:33 +01:00
Kitson Kelly
d325566a7e Runtime Compiler API (#3442)
Also restructures the compiler TypeScript files to make them easier to
manage and eventually integrate deno_typescript fully.
2020-01-08 09:17:44 -05:00
Ry Dahl
bfab4ed0df
Happy new year! (#3578) 2020-01-02 15:13:47 -05:00
Bartek Iwańczuk
658ec2aaf9 better error message for missing module (#3402) 2019-11-25 09:33:23 -05:00
Kitson Kelly
8d977d0117 feat: Support named exports on bundles. (#3352) 2019-11-20 11:02:08 -05:00
Ry Dahl
4902a1cacb
Turn on TS strict mode for deno_typescript (#3330) 2019-11-14 15:05:36 -05:00
Kevin (Kun) "Kassimo" Qian
4189cc1ab5 Loader: support .wasm imports (#3328)
* loader: support .wasm imports

* http_server: true

* Support named exports

* Clippy
2019-11-14 08:31:39 -05:00
Kitson Kelly
9837d324a7 Update to TypeScript 3.7 (#3275)
and update to prettier 1.19

Also, update `assert()` and remove not null assertions where possibly
in `cli`.

Closes #3273
2019-11-13 13:42:34 -05:00
Kitson Kelly
8d03397293 Make bundles fully standalone (#3325)
- Bundles are fully standalone. They now include the shared loader with
  `deno_typescript`.
- Refactor of the loader in `deno_typescript` to perform module
  instantiation in a more
- Change of behaviour when an output file is not specified on the CLI.
  Previously a default name was determined and the bundle written to that
  file, now the bundle will be sent to `stdout`.
- Refactors in the TypeScript compiler to be able to support the concept
  of a request type.  This provides a cleaner abstraction and makes it
  easier to support things like single module transpiles to the userland.
- Remove a "dangerous" circular dependency between `os.ts` and `deno.ts`,
  and define `pid` and `noColor` in a better way.
- Don't bind early to `console` in `repl.ts`.
- Add an integration test for generating a bundle.
2019-11-13 10:35:56 -05:00
Andy Hayden
aec5a646c9 feat: top-level-for-await (#3212) 2019-10-27 09:04:42 -04:00
Ryan Dahl
b81e5db17a
Merge deno_cli_snapshots into deno_cli (#3064) 2019-10-04 20:28:51 -04:00
Renamed from js/compiler.ts (Browse further)