@barmark/render 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -6,6 +6,15 @@ package uses [semantic versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.15.1] - 2026-11-07
10
+
11
+ ### Fixed
12
+
13
+ - **Long charts lay out quickly again.** In 0.15.0 a chart with no
14
+ `part:` lines asked, for each of its lines, whether any bar of the chart
15
+ sings, so a 2,000-line chart took about three times as long as in
16
+ 0.14.0. The answer is now worked out once a chart.
17
+
9
18
  ## [0.15.0] - 2026-11-07
10
19
 
11
20
  Needs `barmark` 0.17.0.
@@ -375,7 +384,8 @@ that needs no script or as the `<barmark-chart>` web component. Requires
375
384
  zoom without sideways scrolling, the element renders and re-renders, and
376
385
  a screen reader hears "bar 9: D". Run them with `bun run test:browser`.
377
386
 
378
- [Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.15.0...HEAD
387
+ [Unreleased]: https://github.com/kevinpeckham/barmark/compare/render-v0.15.1...HEAD
388
+ [0.15.1]: https://github.com/kevinpeckham/barmark/compare/render-v0.15.0...render-v0.15.1
379
389
  [0.15.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.14.0...render-v0.15.0
380
390
  [0.14.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.13.0...render-v0.14.0
381
391
  [0.13.0]: https://github.com/kevinpeckham/barmark/compare/render-v0.12.0...render-v0.13.0
package/dist/verses.js CHANGED
@@ -19,7 +19,7 @@ const keyOf = (v) => v.part ?? "";
19
19
  export function singerOf(l, parse) {
20
20
  const { parts } = parse;
21
21
  if (!parts.length)
22
- return l.part === undefined && parse.bars.some(onNotes) ? "" : null;
22
+ return l.part === undefined && singsOnNotes(parse) ? "" : null;
23
23
  const p = l.part === undefined
24
24
  ? parts.length === 1
25
25
  ? parts[0]
@@ -33,6 +33,16 @@ export function singerOf(l, parse) {
33
33
  }
34
34
  /** Whether a chart with no parts sings: its verse 1 sits on notes. */
35
35
  const onNotes = (b) => (b.lyrics ?? []).some((v) => v.syllables.some((s) => s.note));
36
+ /** `onNotes` over the chart, worked out once a parse: asked for each line, it would read every bar each time. */
37
+ const sang = new WeakMap();
38
+ function singsOnNotes(parse) {
39
+ const known = sang.get(parse);
40
+ if (known !== undefined)
41
+ return known;
42
+ const sings = parse.bars.some(onNotes);
43
+ sang.set(parse, sings);
44
+ return sings;
45
+ }
36
46
  /**
37
47
  * What lands on each cell a row draws: its bar as played, with the verses
38
48
  * of every pass the occurrence plays over that written bar, each part's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barmark/render",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Render barmark chord charts as a clean, accessible bar grid: HTML with Declarative Shadow DOM, or the <barmark-chart> web component.",
5
5
  "type": "module",
6
6
  "exports": {