summaryrefslogtreecommitdiff
path: root/cli/emit.rs
AgeCommit message (Collapse)Author
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-01fix: improved support for cjs and cts modules (#26558)David Sherret
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-26perf: pass transpiled module to deno_core as known string (#26555)David Sherret
2024-10-24perf(compile): pass module source data from binary directly to v8 (#26494)David Sherret
This changes denort to pass a static reference of the moude source bytes found in the binary to v8 instead of copying it.
2024-08-29feat: deprecate import assertions (#25281)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-21fix: warn about import assertions when using typescript (#25135)David Sherret
1. On emit, checks for the prescence of import assertions. 1. Warns and doesn't store the parsed source in the emit cache in this case.
2024-08-08perf: skip saving to emit cache after first failure (#24896)David Sherret
2024-06-05fix: better handling of npm resolution occurring on workers (#24094)David Sherret
Closes https://github.com/denoland/deno/issues/24063
2024-05-29fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030)David Sherret
In https://github.com/denoland/deno/pull/23955 we changed the sqlite db journal mode to WAL. This causes issues when someone is running an old version of Deno using TRUNCATE and a new version because the two fight against each other.
2024-05-20perf(cache): compile ts to js in parallel for `deno cache` (#23892)David Sherret
Closes https://github.com/denoland/deno/issues/23860
2024-05-18perf: analyze cjs exports and emit typescript in parallel (#23856)David Sherret
2024-04-17fix(publish): support import equals (#23421)Luca Casonato
2024-04-14perf: do not clone swc `Program` when transpiling (#23365)David Sherret
2024-04-11fix: upgrade deno_ast related crates (#23187)David Sherret
Had to revert back swc due to https://github.com/swc-project/swc/issues/8840 Fixes: - https://github.com/denoland/deno_lint/pull/1262 - https://github.com/denoland/deno_doc/pull/538 - https://github.com/denoland/deno_doc/pull/537 - https://github.com/denoland/deno_graph/pull/430 - https://github.com/denoland/deno_graph/pull/425 - https://github.com/denoland/deno_graph/pull/432
2024-02-01refactor: load bytes in deno_graph (#22212)David Sherret
Upgrades deno_graph to 0.64 where deno_graph is now responsible for turning bytes into a string. This is in preparation for Wasm modules.
2024-01-10chore: bump deno_core (#21832)Matt Mastracci
2024-01-01chore: update copyright to 2024 (#21753)David Sherret
2023-10-31feat: deno run --unstable-hmr (#20876)Bartek Iwańczuk
This commit adds `--unstable-hmr` flag, that enabled Hot Module Replacement. This flag works like `--watch` and accepts the same arguments. If HMR is not possible the process will be restarted instead. Currently HMR is only supported in `deno run` subcommand. Upon HMR a `CustomEvent("hmr")` will be dispatched that contains information which file was changed in its `details` property. --------- Co-authored-by: Valentin Anger <syrupthinker@gryphno.de> Co-authored-by: David Sherret <dsherret@gmail.com>
2023-07-10refactor(lsp): move config file related code to config.rs (#19790)David Sherret
Will make #19788 easier.
2023-06-26chore: fix typos (#19572)Martin Fischer
2023-04-14refactor: break up `ProcState` (#18707)David Sherret
1. Breaks up functionality within `ProcState` into several other structs to break out the responsibilities (`ProcState` is only a data struct now). 2. Moves towards being able to inject dependencies more easily and have functionality only require what it needs. 3. Exposes `Arc<T>` around the "service structs" instead of it being embedded within them. The idea behind embedding them was to reduce the verbosity of needing to pass around `Arc<...>`, but I don't think it was exactly working and as we move more of these structs to be more injectable I don't think the extra verbosity will be a big deal.
2023-04-13refactor(cli): add `Emitter` struct (#18690)David Sherret
Removes the functions in the `emit` module and replaces them with an `Emitter` struct that can have "ctor dependencies" injected rather than using functions to pass along the dependencies. This is part of a long term refactor to move more functionality out of proc state.
2023-03-21perf(core) Reduce script name and script code copies (#18298)Matt Mastracci
Reduce the number of copies and allocations of script code by carrying around ownership/reference information from creation time. As an advantage, this allows us to maintain the identity of `&'static str`-based scripts and use v8's external 1-byte strings (to avoid incorrectly passing non-ASCII strings, debug `assert!`s gate all string reference paths). Benchmark results: Perf improvements -- ~0.1 - 0.2ms faster, but should reduce garbage w/external strings and reduces data copies overall. May also unlock some more interesting optimizations in the future. This requires adding some generics to functions, but manual monomorphization has been applied (outer/inner function) to avoid code bloat.
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-11-29fix(coverage): Error if the emit cache is invalid (#16850)sigmaSd
2022-11-25refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820)David Sherret
2022-11-25refactor: move lockfile.rs to args module (#16818)David Sherret
This should be in the `args` folder as it's similar to `config_file`.
2022-09-02refactor: extract out check code from emit (#15729)David Sherret
Closes #15535
2022-08-22perf: cache swc dependency analysis and don't hold onto `ParsedSource`s in ↵David Sherret
memory (#15502)
2022-07-30refactor: reuse `FastInsecureHasher` in `get_check_hash` (#15354)David Sherret
2022-07-21fix(cli): unset jsxFragmentFactory & jsxFactory options (#15264)Satya Rohith
2022-07-20fix(coverage): do not verify emit source hash for coverage (#15260)David Sherret
2022-07-19feat: emit files on demand and fix racy emit (#15220)David Sherret
2022-07-15refactor: remove redundant qualification of symbols in Rust (#15201)orvit
2022-07-14fix(cli): expand tsc roots when using checkJs (#15164)Rafael Ávila de Espíndola
A JS file can still point to a TS file, so we need to expand the roots in the checkJs case too. Fixes: #15163
2022-07-13chore(cli): remove dead code related to previous tsc emit (#15196)Nayeem Rahman
2022-07-12perf: use emit from swc instead of tsc (#15118)David Sherret
2022-06-28refactor: add `RootConfig` (#14985)David Sherret
2022-06-27refactor: create `args` folder (#14982)David Sherret
2022-06-20refactor: add `EmitCache` trait (#14925)David Sherret
2022-06-15fix(check): use "moduleDetection": "force" (#14875)Nayeem Rahman
2022-06-15chore(cli/cache): Remove CacheType::Declaration (#14873)Nayeem Rahman
2022-05-30refactor: use deno_emit (#14737)David Sherret
2022-05-20refactor: upgrade to deno_ast 0.15 (#14680)David Sherret
2022-05-17BREAKING: Remove unstable Deno.emit and Deno.formatDiagnostics APIs (#14463)Bartek Iwańczuk
2022-05-17fix: base64 encoding of source maps with emojis (#14607)Bartek Iwańczuk
This commit fixes source maps for files that contain emojis. This is done by updating "deno_ast" to "0.14.1" for the case of "--no-check" flag (ie using SWC emit) and by overriding TSC's default base64 encoder (which turned out to be buggy) for the type checking case.
2022-04-18fix(cli/emit): Check JS roots with // @ts-check (#14090)Nayeem Rahman
2022-04-11feat: Add "deno check" subcommand for type checking (#14072)Bartek Iwańczuk
This commit adds new "deno check" subcommand. Currently it is an alias for "deno cache" with the difference that remote modules don't emit TS diagnostics by default. Prints warning for "deno run" subcommand if "--check" flag is not present and there's no "--no-check" flag. Adds "DENO_FUTURE_CHECK" env variable that allows to opt into new behavior now.
2022-04-08fix: upgrade to swc_ecmascript 0.143 (#14238)David Sherret
2022-03-29refactor(flags): rename CheckFlag to TypecheckMode (#14111)Bartek Iwańczuk