forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TextEncoder/TextDecoder support.
Fixes denoland#470 This commit increases size: out/release/gen/bundle/main.js 7.3M -> 7.9M out/release/gen/bundle/main.js.map 11M -> 12M out/release/gen/snapshot_deno.bin 34M -> 37M out/release/deno 49M -> 53M Note the amount in the JS code added is quite small: 4.0K node_modules/text-encoding/index.js 4.0K node_modules/@types/text-encoding/index.d.ts 4.0K js/text_encoding.ts Unclear to me what is causing the jump in snapshot size.
- Loading branch information
Showing
6 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2018 the Deno authors. All rights reserved. MIT license. | ||
|
||
// @types/text-encoding relies on lib.dom.d.ts for some interfaces. We do not | ||
// want to include lib.dom.d.ts (due to size) into deno's global type scope. | ||
// Therefore this hack: add a few of the missing interfaces in | ||
// @types/text-encoding to the global scope before importing. | ||
|
||
declare global { | ||
type BufferSource = ArrayBufferView | ArrayBuffer; | ||
|
||
interface TextDecodeOptions { | ||
stream?: boolean; | ||
} | ||
|
||
interface TextDecoderOptions { | ||
fatal?: boolean; | ||
ignoreBOM?: boolean; | ||
} | ||
|
||
interface TextDecoder { | ||
readonly encoding: string; | ||
readonly fatal: boolean; | ||
readonly ignoreBOM: boolean; | ||
decode(input?: BufferSource, options?: TextDecodeOptions): string; | ||
} | ||
} | ||
|
||
export { TextEncoder, TextDecoder } from "text-encoding"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule third_party
updated
10 files