mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
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.
This commit is contained in:
parent
bb0c90cadb
commit
c73ef5fa14
27 changed files with 641 additions and 4705 deletions
11
core/lib.deno_core.d.ts
vendored
11
core/lib.deno_core.d.ts
vendored
|
@ -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<any>;
|
||||
|
||||
/**
|
||||
|
@ -38,5 +38,8 @@ declare namespace Deno {
|
|||
|
||||
/** Get heap stats for current isolate/worker */
|
||||
function heapStats(): Record<string, number>;
|
||||
|
||||
/** Encode a string to its Uint8Array representation. */
|
||||
function encode(input: string): Uint8Array;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue