Skip to content

Commit 0815f2a

Browse files
authored
1.3.0 (#1048)
* update dependencies * 1.3.0 * only notify if dark changed * ylgnbu
1 parent e439830 commit 0815f2a

File tree

8 files changed

+420
-433
lines changed

8 files changed

+420
-433
lines changed

docs/config.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export default {
167167

168168
The base path when serving the site. Currently this only affects the custom 404 page, if any.
169169

170-
## cleanUrls <a href="https://github.com/observablehq/framework/pull/1037" target="_blank" class="observablehq-version-badge" data-version="prerelease" title="Added in #1037"></a>
170+
## cleanUrls <a href="https://github.com/observablehq/framework/releases/tag/v1.3.0" target="_blank" class="observablehq-version-badge" data-version="^1.3.0" title="Added in 1.3.0"></a>
171171

172172
Whether page links should be “clean”, _i.e._, formatted without a `.html` extension. Defaults to true. If true, a link to `config.html` will be formatted as `config`. Regardless of this setting, a link to an index page will drop the implied `index.html`; for example `foo/index.html` will be formatted as `foo/`.
173173

@@ -200,7 +200,7 @@ toc: false
200200

201201
Whether to enable [search](./search) on the project; defaults to false.
202202

203-
## interpreters <a href="https://github.com/observablehq/framework/pull/935" target="_blank" class="observablehq-version-badge" data-version="prerelease" title="Added in #935"></a>
203+
## interpreters <a href="https://github.com/observablehq/framework/releases/tag/v1.3.0" target="_blank" class="observablehq-version-badge" data-version="^1.3.0" title="Added in 1.3.0"></a>
204204

205205
The **interpreters** option specifies additional interpreted languages for data loaders, indicating the file extension and associated interpreter. (See [loader routing](./loaders#routing) for more.) The default list of interpreters is:
206206

docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Or with Yarn:
221221

222222
You should see something like this:
223223

224-
<pre data-copy="none"><b class="green">Observable Framework</b> v1.2.0
224+
<pre data-copy="none"><b class="green">Observable Framework</b> v1.3.0
225225
↳ <u><a href="http://127.0.0.1:3000/" style="color: inherit;">http://127.0.0.1:3000/</a></u></pre>
226226

227227
<div class="tip">

docs/lib/generators.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -75,24 +75,26 @@ const width = Generators.width(document.querySelector("main"));
7575
width
7676
```
7777

78-
## dark() <a href="https://github.com/observablehq/framework/pull/1025" target="_blank" class="observablehq-version-badge" data-version="prerelease" title="Added in #1025"></a>
78+
## dark() <a href="https://github.com/observablehq/framework/releases/tag/v1.3.0" target="_blank" class="observablehq-version-badge" data-version="^1.3.0" title="Added in 1.3.0"></a>
7979

80-
Returns an async generator that yields a boolean indicating whether the page is currently displayed with a dark [color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme).
80+
Returns an async generator that yields a boolean indicating whether the page is currently displayed with a dark [color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme).
8181

82-
If the page supports dark mode (for example with the default Framework themes), the value reflects the user’s preferred color scheme. It will yield if that value changes, and update the charts that depend on it without needing to reload the page — this happens at dusk (if the user settings adapt from light to dark), and conversely at dawn, from dark to light; and of course, when the user is playing with their settings.
82+
If the page supports both light and dark mode (as with the [default theme](../themes)), the value reflects the user’s [preferred color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme). The generator will yield a new value if the preferred color changes — as when the user changes their system settings, or if the user’s system adapts automatically to the diurnal cycle — allowing you to update the display as needed without requiring a page reload.
8383

84-
If the page does _not_ support dark mode, and only has a light theme, the value is always false, and likewise it is always true if the page only has a dark theme.
84+
If the page only supports light mode, the value is always false; likewise it is always true if the page only has a dark theme.
8585

86-
```js echo
87-
html`<em>Current theme: ${dark ? "dark" : "light"}</em>`
86+
The current theme is: *${dark ? "dark" : "light"}*.
87+
88+
```md run=false
89+
The current theme is: *${dark ? "dark" : "light"}*.
8890
```
8991

9092
This generator is available by default as `dark` in Markdown. It can be used to pick a [color scheme](https://observablehq.com/plot/features/scales#color-scales) for a chart, or an appropriate [mix-blend-mode](https://developer.mozilla.org/en-US/docs/Web/CSS/mix-blend-mode):
9193

9294
```js echo
9395
Plot.plot({
9496
height: 260,
95-
color: {scheme: dark ? "turbo" : "blues"},
97+
color: {scheme: dark ? "turbo" : "ylgnbu"},
9698
marks: [
9799
Plot.rectY(
98100
olympians,

docs/lib/mosaic.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ sql:
33
trips: nyc-taxi.parquet
44
---
55

6-
# Mosaic vgplot <a href="https://github.com/observablehq/framework/pull/1015" target="_blank" class="observablehq-version-badge" data-version="prerelease" title="Added in #1015"></a>
6+
# Mosaic vgplot <a href="https://github.com/observablehq/framework/releases/tag/v1.3.0" target="_blank" class="observablehq-version-badge" data-version="^1.3.0" title="Added in 1.3.0"></a>
77

88
[Mosaic](https://uwdata.github.io/mosaic/) is a system for linking data visualizations, tables, and inputs, leveraging [DuckDB](./duckdb) for scalable processing. Mosaic includes an interactive grammar of graphics, [Mosaic vgplot](https://uwdata.github.io/mosaic/vgplot/), built on [Observable Plot](./plot). With vgplot, you can interactively visualize and explore millions — even billions — of data points.
99

package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@observablehq/framework",
33
"license": "ISC",
4-
"version": "1.2.0",
4+
"version": "1.3.0",
55
"type": "module",
66
"publishConfig": {
77
"access": "public"
@@ -63,7 +63,7 @@
6363
"cross-env": "^7.0.3",
6464
"cross-spawn": "^7.0.3",
6565
"d3-array": "^3.2.4",
66-
"esbuild": "^0.19.8",
66+
"esbuild": "^0.20.1",
6767
"fast-array-diff": "^1.1.0",
6868
"gray-matter": "^4.0.3",
6969
"he": "^1.2.0",
@@ -72,11 +72,11 @@
7272
"is-wsl": "^3.1.0",
7373
"jsdom": "^24.0.0",
7474
"jszip": "^3.10.1",
75-
"markdown-it": "^13.0.2",
75+
"markdown-it": "^14.0.0",
7676
"markdown-it-anchor": "^8.6.7",
77-
"mime": "^3.0.0",
77+
"mime": "^4.0.0",
7878
"minisearch": "^6.3.0",
79-
"open": "^9.1.0",
79+
"open": "^10.1.0",
8080
"rollup": "^4.6.0",
8181
"rollup-plugin-esbuild": "^6.1.0",
8282
"semver": "^7.5.4",
@@ -100,9 +100,9 @@
100100
"@types/send": "^0.17.2",
101101
"@types/tar-stream": "^3.1.3",
102102
"@types/ws": "^8.5.6",
103-
"@typescript-eslint/eslint-plugin": "^6.7.3",
104-
"@typescript-eslint/parser": "^6.7.3",
105-
"c8": "^8.0.1",
103+
"@typescript-eslint/eslint-plugin": "^7.2.0",
104+
"@typescript-eslint/parser": "^7.2.0",
105+
"c8": "^9.1.0",
106106
"chai": "^4.3.10",
107107
"chai-http": "^4.4.0",
108108
"concurrently": "^8.2.2",
@@ -118,7 +118,7 @@
118118
"rimraf": "^5.0.5",
119119
"tempy": "^3.1.0",
120120
"typescript": "^5.2.2",
121-
"undici": "^5.27.2"
121+
"undici": "^6.7.1"
122122
},
123123
"engines": {
124124
"node": ">=18"

src/client/stdlib/generators/dark.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ import {observe} from "./observe.js";
44
// TODO: in preview, also watch for changes in the theme meta.
55
export function dark() {
66
return observe((notify: (dark: boolean) => void) => {
7+
let dark: boolean | undefined;
78
const media = matchMedia("(prefers-color-scheme: dark)");
8-
const changed = () => notify(getComputedStyle(document.body).getPropertyValue("color-scheme") === "dark");
9+
const changed = () => {
10+
const d = getComputedStyle(document.body).getPropertyValue("color-scheme") === "dark";
11+
if (dark === d) return; // only notify if changed
12+
notify((dark = d));
13+
};
914
changed();
1015
media.addEventListener("change", changed);
1116
return () => media.removeEventListener("change", changed);

test/output/build/imports/foo/foo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import {define} from "../_observablehq/client.js";
2222
import {registerFile} from "../_observablehq/stdlib.js";
2323

24-
registerFile("../top.js", {"name":"../top.js","mimeType":"application/javascript","path":"../_file/top.a53c5d5b.js"});
24+
registerFile("../top.js", {"name":"../top.js","mimeType":"text/javascript","path":"../_file/top.a53c5d5b.js"});
2525

2626
define({id: "261e010e", inputs: ["display","FileAttachment"], outputs: ["d3","bar","top"], body: async (display,FileAttachment) => {
2727
const [d3, {bar}, {top}] = await Promise.all([import("../_npm/[email protected]/+esm.js"), import("../_import/bar/bar.13bb8056.js"), import("../_import/top.160847a6.js")]);

0 commit comments

Comments
 (0)