From c73ef5fa143b473677d4cab069241ff018e0c971 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Sat, 5 Jun 2021 23:10:07 +0200 Subject: refactor(web): use encoding_rs for text encoding (#10844) This commit removes all JS based text encoding / text decoding. Instead encoding now happens in Rust via encoding_rs (already in tree). This implementation retains stream support, but adds the last missing encodings. We are incredibly close to 100% WPT on text encoding now. This should reduce our baseline heap by quite a bit. --- core/lib.deno_core.d.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/lib.deno_core.d.ts') diff --git a/core/lib.deno_core.d.ts b/core/lib.deno_core.d.ts index 2da28b413..2cec6be76 100644 --- a/core/lib.deno_core.d.ts +++ b/core/lib.deno_core.d.ts @@ -10,15 +10,15 @@ declare namespace Deno { /** Call an op in Rust, and synchronously receive the result. */ function opSync( opName: string, - args?: any, - zeroCopy?: Uint8Array, + a?: any, + b?: any, ): any; /** Call an op in Rust, and asynchronously receive the result. */ function opAsync( opName: string, - args?: any, - zeroCopy?: Uint8Array, + a?: any, + b?: any, ): Promise; /** @@ -38,5 +38,8 @@ declare namespace Deno { /** Get heap stats for current isolate/worker */ function heapStats(): Record; + + /** Encode a string to its Uint8Array representation. */ + function encode(input: string): Uint8Array; } } -- cgit v1.2.3