From 8d03397293b388317299dfb0648b541a7005807d Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 14 Nov 2019 02:35:56 +1100 Subject: 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. --- deno_typescript/amd_runtime.js | 54 ------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 deno_typescript/amd_runtime.js (limited to 'deno_typescript/amd_runtime.js') diff --git a/deno_typescript/amd_runtime.js b/deno_typescript/amd_runtime.js deleted file mode 100644 index 1c4f0007a..000000000 --- a/deno_typescript/amd_runtime.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. - -// A very very basic AMD preamble to support the output of TypeScript outFile -// bundles. - -/** - * @type {(name: string) => any} - */ -let require; - -/** - * @type {(name: string, deps: ReadonlyArray, factory: (...deps: any[]) => void) => void} - */ -// eslint-disable-next-line @typescript-eslint/no-unused-vars -let define; - -(function() { - /** - * @type {Map} - */ - const modules = new Map(); - - /** - * @param {string} name - */ - function createOrLoadModule(name) { - let m = modules.get(name); - if (!m) { - m = { name, exports: {} }; - modules.set(name, m); - } - return m; - } - - require = name => { - return createOrLoadModule(name).exports; - }; - - define = (name, deps, factory) => { - const currentModule = createOrLoadModule(name); - const localExports = currentModule.exports; - const args = deps.map(dep => { - if (dep === "require") { - return require; - } else if (dep === "exports") { - return localExports; - } else { - const depModule = createOrLoadModule(dep); - return depModule.exports; - } - }); - factory(...args); - }; -})(); -- cgit v1.2.3