This commit adds the formatting of CSS, HTML, and SQL which are embedded in
Tagged Template Literal strings. The embedded languages are detected by
the tag name of the literal.
```ts
// triggers CSS formatting
const Div = styled.div`
margin: 5px;
padding: ${padding}px;
`;
// triggers HTML formatting
document.body.innerHTML = html`
<main>
<h1>Hello ${name}!<h1>
</main>
`;
// triggers SQL formatting when `--unstable-sql` passed
const query = sql`
SELECT
${table}.${field}
FROM
${table};
`
```
See https://github.com/dprint/dprint-plugin-typescript/pull/701 for more
details
Change:
Supported --open flag with deno serve -> (deno serve --open
somescript.ts/js).
The action that takes place is openning the browser on the address that
the server is running on.
Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>
This is technically **BREAKING** as it removes a public API, but the
brand is type-only and the chance of anyone actually relying on this
seems very unlikely.
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
This commit adds two env vars:
- "DENO_CACHE_DB_MODE"
- "DENO_KV_DB_MODE"
Both of these env vars accept either "disk" or "memory" values and
control the modes of backing databases for Web Cache API and
"Deno.openKv()" API.
By default both APIs use disk backed DBs, but they can be changed to use
in-memory
DB, making them effectively ephemeral.
This commit adds support for `DENO_EMIT_CACHE_MODE` env var that accepts
either `normal` or `disable` values, allowing to disable caching of
transpiled sources - ie. transpilation will happen on each run.
Ref #26819
An optional **timeout** parameter has been added to the
**Deno.connect()** interface. This parameter allows specifying a timeout
(in milliseconds) within which the application must establish a
connection. If the timeout is exceeded without successfully connecting,
the operation is automatically aborted with an error. If the parameter
is not provided, the default behavior remains unchanged (no timeout).
Currently, the timeout functionality is implemented only for TCP
connections. Other connection types are not affected by this change.
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
This commit adds "deno_features" crate that contains definitions of all
unstable features in Deno.
Based on these definitions, both Rust and JS code is generated ensuring
that the two are always in sync.
In addition some of flag handling was rewritten to use the generated
definitions, instead of hand rolling these flag definitions.
---------
Co-authored-by: snek <snek@deno.com>
Aligns version between `deno`, `denort` and `deno_lib` crates.
Removes `cli/lib/version.txt` and some build-script shenanigans to
override crate version.
We upgraded `env_logger`, which uses a new color detection backend that
is backwards incompatible with the old backend and does not detect
GitHub Actions as a terminal that supports color. We now force
env_logger to respect the color decision that `deno_terminal` has
already made.
#28646
Edit:
Hi apologies for the delayed explanation @marvinhagemeister.
The reason the error message wasn't appearing was due to the
initialization order. The logging system was being initialized after the
telemetry system. This created a problem: if telemetry failed during its
own initialization, the logging system wasn't yet ready to capture and
report the error.
My solution was to simply move the log initialization to occur before
the telemetry initialization. This resolves the issue, ensuring any
telemetry setup errors are correctly logged.
Basically just update deno_lockfile, deno_npm, and eszip, and then adapt
to those changes. The main changes were the removal of the lockfile v4
resolution snapshot loading, and a terser formatting for the `os` and
`cpu` fields in the lockfile.
Fixes two issues:
- If a cached packument was out of date and missing a version from the
lockfile, we would fail. Instead we should try again with a forced
re-fetch
- We weren't threading through the workspace patch packages correctly
This is the release commit being forwarded back to main for 2.2.11
---------
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
This PR updates the behavior of `deno test --coverage` option. Now if
`--coverage` option is specified, `deno test` command automatically
shows summary report in the terminal, and generates the lcov report in
`$coverage_dir/lcov.info` and html report in `$coverage_dir/html/`
This change also adds `--coverage-raw-data-only` flag, which prevents
the above reports generated, instead only generates the raw json
coverage data (which is the same as current behavior)
With `nodeModulesDir: auto` (and `none`, to a lesser extent), we
frequently repeatedly try to cache npm packages during resolution. On a
(private) fresh project, I counted that `sync_resolution_with_fs` was
called 478 times over the course of a fresh build. This reduces the
number of calls to 8, and doing so speeds things up substantially.
```
❯ hyperfine --warmup 2 -N "deno task build" "../deno/target/release-lite/deno task build"
Benchmark 1: deno task build
Time (mean ± σ): 3.652 s ± 0.042 s [User: 3.285 s, System: 2.399 s]
Range (min … max): 3.587 s … 3.712 s 10 runs
Benchmark 2: ../deno/target/release-lite/deno task build
Time (mean ± σ): 1.356 s ± 0.007 s [User: 1.961 s, System: 1.108 s]
Range (min … max): 1.345 s … 1.372 s 10 runs
Summary
../deno/target/release-lite/deno task build ran
2.69 ± 0.03 times faster than deno task build
```
This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.
Additionally, this will not work when run on readonly file systems.