Commit graph

102 commits

Author SHA1 Message Date
Luke Channings a2488ae792
fix(npm): support compiling on linux/aarch64 (#16208)
Changes introduced in #13633 have broken the ability to compile for
linux/aarch64 - specifically the use of a `i8` as a char type, which is
an `u8` on linux/aarch64.

This PR:
- Replaces instances of `i8` with the architecture-aware wrapper type
`c_char`
- Skips the use of `--export-dynamic-symbol` on linux-aarch64, because
the target environments often rely on older libc/binutils versions
2022-10-10 07:59:31 +05:30
Colin Ihrig c27234888f
fix(napi): move napi symbols file (#16179)
The current location was causing failures during v1.26.1 publication.

<!--
Before submitting a PR, please read http://deno.land/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
-->
2022-10-07 09:21:43 +05:30
Divy Srivastava cd1c63ad71
fix(build): don't export all symbols to dynamic symbol table (#16171)
Currently, we use `-rdynamic` for exporting Node API symbols to the
symbol table. `-rdynamic` will export *all* symbols, that means
previously unused functions will not be optimized away introducing a lot
of binary bloat. 

This patch uses `-exported_symbol` and `--export-dynamic-symbol` link
flags (not as universal as `-rdynamic`) to only mark Node API symbols to
be put in the dynamic symbol table.
2022-10-06 21:20:00 +05:30
Divy Srivastava 0b016a7fb8
feat(npm): implement Node API (#13633)
This PR implements the NAPI for loading native modules into Deno. 

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: DjDeveloper <43033058+DjDeveloperr@users.noreply.github.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-10-05 19:36:44 +05:30
Satya Rohith b312279e58
feat: implement Web Cache API (#15829) 2022-09-28 17:41:12 +05:30
Bartek Iwańczuk a919a5dd11
Revert "refactor(snapshots): to their own crate (#14794)" (#15076)
This reverts commit fd5a12d7e2.
2022-07-05 00:12:41 +02:00
Aaron O'Mullan fd5a12d7e2
refactor(snapshots): to their own crate (#14794)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-06-24 15:04:45 +02:00
Kitson Kelly 7eee521199
feat: update to TypeScript 4.7 (#14242) 2022-06-01 10:19:18 +10:00
David Sherret eb5ffab1cb
fix(lsp): correct positions in some scenarios (#14359) 2022-05-15 14:41:37 -04:00
Andreu Botella 3e7afb8918
chore(runtime): Make some ops in ext and runtime infallible. (#14589)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-05-13 10:36:31 +02:00
Luca Casonato 242273e69b
chore: update deps (#14416) 2022-05-05 12:41:59 +02:00
Ryan Dahl f7ab41583e
fix: cargo publish fails without absolute paths (#13993)
This reverts commit 4e3ed37037.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-03-17 01:25:44 +01:00
Divy Srivastava 89a41d0a67
chore(cli): Disallow cross compiling for snapshots (#13976) 2022-03-16 19:17:15 +05:30
Aaron O'Mullan bd481bf095
feat(ops): optional OpState (#13954) 2022-03-16 00:33:46 +01:00
Aaron O'Mullan 88d0f01948
feat(ops): custom arity (#13949)
Also cleanup & drop ignored wildcard op-args
2022-03-14 23:38:53 +01:00
Divy Srivastava b4e42953e1
feat(core): codegen ops (#13861)
Co-authored-by: Aaron O'Mullan <aaron.omullan@gmail.com>
2022-03-14 18:44:15 +01:00
Divy Srivastava 4e3ed37037
chore: improve build times for ext/ changes (#13927) 2022-03-14 09:08:54 +05:30
Kitson Kelly 7fc5bfe51b
feat(cli): update to TypeScript 4.6.2 (#13474) 2022-03-02 07:44:43 +11:00
Aaron O'Mullan bd5d445da9
chore: re-enable wgpu_sync (#13453) 2022-01-24 23:47:05 +01:00
Aaron O'Mullan 3ab68bd0a2
revert(#13402): experiment: wgpu sync (#13439) 2022-01-20 15:23:53 +01:00
Aaron O'Mullan 2ab21dafa7
experiment: wgpu sync (#13402) 2022-01-19 13:38:51 +01:00
evan b66afa2518
feat(cli, runtime): compress snapshots (#13320) 2022-01-10 15:51:23 -08:00
Ryan Dahl 1fb5858009
chore: update copyright to 2022 (#13306)
Co-authored-by: Erfan Safari <erfanshield@outlook.com>
2022-01-07 22:09:52 -05:00
Kitson Kelly 345f0fbe5c
feat(cli): update to TypeScript 4.5 (#12410)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-12-10 09:12:21 +11:00
Luca Casonato fcd0992dba
fix: move unstable declarations to deno.unstable (#11876) 2021-08-31 11:25:15 +02:00
Kitson Kelly 935133f53a
feat(cli): Update to TypeScript 4.4 (#11678) 2021-08-27 10:12:59 +10:00
Kitson Kelly 465cf9a6fe
feat: add new esnext types (#11627) 2021-08-10 10:33:08 +02:00
Bert Belder 63546c15bf fix(cli): rebuild when environment variables change (#11471) 2021-07-20 19:06:40 -07:00
Luca Casonato f649960f87
refactor: deno_http op crate (#11335) 2021-07-12 12:44:49 +02:00
Bartek Iwańczuk 38a7128cdd
feat: Add "deno_net" extension (#11150)
This commits moves implementation of net related APIs available on "Deno"
namespace to "deno_net" extension.

Following APIs were moved:
- Deno.listen()
- Deno.connect()
- Deno.listenTls()
- Deno.serveHttp()
- Deno.shutdown()
- Deno.resolveDns()
- Deno.listenDatagram()
- Deno.startTls()
- Deno.Conn
- Deno.Listener
- Deno.DatagramConn
2021-06-29 01:43:03 +02:00
Bartek Iwańczuk 9105892ec8
refactor: unify JavaScript script execution method (#11043)
This commit renames "JsRuntime::execute" to "JsRuntime::execute_script". Additionally
same renames were applied to methods on "deno_runtime::Worker" and
"deno_runtime::WebWorker".

A new macro was added to "deno_core" called "located_script_name" which
returns the name of Rust file alongside line no and col no of that call site.
This macro is useful in combination with "JsRuntime::execute_script"
and allows to provide accurate place where "one-off" JavaScript scripts
are executed for internal runtime functions.

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2021-06-22 01:45:41 +02:00
Kitson Kelly 281c4cd8fc
feat(cli): support "types" when type checking (#10999)
Fixes #10677
2021-06-22 07:18:32 +10:00
Bartek Iwańczuk 6091ea098a
refactor: merge deno_file crate into deno_web (#10914)
This refactor makes it so there's one less crate to publish on each release.
2021-06-10 15:26:10 +02:00
Luca Casonato 83ce333633
build: cli(build) shouldn't depend on deno_runtime (#10787)
This speeds up incremental rebuild when only touching JS files by 30%
compared to #10786.

Rebuild time after touch 01_broadcast_channel.js:

main: run 1 49.18s, run 2 50.34s
#10786: run 1 43.12s, run 2 43.19s
this + #10786: run 1 30.30s, run 2 30.95s
2021-05-29 16:25:14 +02:00
Kitson Kelly 59237d195f
feat(cli): upgrade to TypeScript 4.3 (#9960) 2021-05-28 09:33:11 +10:00
Ben Noordhuis 8cf7f966f2 feat(extensions): add BroadcastChannel
Co-Authored-By: Ben Noordhuis <info@bnoordhuis.nl>
Fixes: #10354
2021-05-23 15:16:42 +02:00
crowlKats dfe528198d
feat: add WebStorage API (#7819)
This commit introduces localStorage and sessionStorage.
2021-05-10 12:02:47 +02:00
Aaron O'Mullan 1e8e44f4c3
refactor(ops): replace ZeroCopyBuf arg by 2nd generic deserializable arg (#10448) 2021-05-06 19:32:03 +02:00
Aaron O'Mullan 83bece56b0
refactor(core): move op cache sync responsibility to rust space (#10340)
Even if bootstrapping the JS runtime is low level, it's an abstraction leak of 
core to require users to call `Deno.core.ops()` in JS space.

So instead we're introducing a `JsRuntime::sync_ops_cache()` method, 
once we have runtime extensions a new runtime will ensure the ops 
cache is setup (for the provided extensions) and then loading/unloading 
plugins should be the only operations that require op cache syncs
2021-04-25 22:00:05 +02:00
Aaron O'Mullan 46b1c653c0
refactor(deno): remove concept of bin & json ops (#10145) 2021-04-12 15:55:05 -04:00
Luca Casonato 00e63306cb
refactor: add deno_file op crate (#10019)
Also enables WPT for FileReader.
2021-04-06 12:55:05 +02:00
Luca Casonato 0770449c93
refactor: move Console to op_crates/console (#9770) 2021-03-12 21:23:59 +01:00
Luca Casonato e83ff62ccb
chore: split web op crate (#9635)
This commit starts splitting out the deno_web op crate into multiple
smaller crates. This commit splits out WebIDL and URL API, but in the
future I want to split out each spec into its own crate. That means we
will have (in rough order of loading): `webidl`, `dom`, `streams`,
`console`, `encoding`, `url`, `file`, `fetch`, `websocket`, and
`webgpu` crates.
2021-03-12 16:17:18 +01:00
crowlKats 7cd14f97c9
feat: WebGPU API (#7977)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-03-01 11:31:13 +01:00
Divy Srivastava 4b56537ea9
chore: move crypto types to op_crates/crypto (#9609) 2021-02-26 12:06:26 -05:00
Divy Srivastava 67ca978f97
chore: simplify internal dependencies between crates (#9600) 2021-02-26 12:46:15 +01:00
Kitson Kelly e516e4d1d5
chore(cli/runtime): use re-export serde from deno_core (#9599) 2021-02-26 07:18:35 +11:00
Jared Beller b50691efed
refactor(core): Strongly typed deserialization of JSON ops (#9423)
This PR makes json_op_sync/async generic to all Deserialize/Serialize types
instead of the loosely-typed serde_json::Value. Since serde_json::Value
implements Deserialize/Serialize, very little existing code needs to be updated,
however as json_op_sync/async are now generic, type inference is broken in some
cases (see cli/build.rs:146). I've found this reduces a good bit of boilerplate,
as seen in the updated deno_core examples.

This change may also reduce serialization and deserialization overhead as serde
has a better idea of what types it is working with. I am currently working on
benchmarks to confirm this and I will update this PR with my findings.
2021-02-13 11:56:56 -05:00
Luca Casonato cf3202644d
fix: full commit hash in canary compile download (#9166) 2021-01-19 13:53:23 +01:00
Bartek Iwańczuk f4dbb267c6
fix: incremental build for deno declaration files (#9138) 2021-01-17 15:12:00 +01:00