tosijs-ui 1.14.1 → 1.14.3

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
@@ -1,5 +1,72 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.14.3
4
+
5
+ A single-fix patch cut from `v1.14.2`. Carries no 1.15.0 work.
6
+
7
+ ### tjs-lang 0.13.13 — a quoted test block was executed in the HOST page (#135)
8
+
9
+ On tjs-lang ≤ 0.13.11, a `test '…' { … }` written inside a template literal or a
10
+ double-quoted string was mistaken for a real test block: the body ran at transpile time and
11
+ the text was **deleted from the output**. Both silent.
12
+
13
+ That is the bad case for a doc site specifically, because documentation about a language
14
+ quotes the language. `transform()` is called from the component — the **host page** — and its
15
+ output is then injected into the iframe, so anything the transpiler executes at transpile time
16
+ runs outside the sandbox that exists for exactly this. Any tjs example *showing* a test block
17
+ had it deleted from the rendered example and executed in the host page. Upstream lost 52 of 99
18
+ failures in their own conversion gate to it before finding the cause.
19
+
20
+ Fixed in 0.13.12; this moves to **0.13.13** (latest), verified across all four lanes rather
21
+ than on the release note alone. 0.13.5–0.13.13 also carry the AJS/TJS parser split, a
22
+ prototype-chain lookup fix in the VM, a source-size cap on `Eval`/`SafeFunction`, and further
23
+ literal-blindness fixes.
24
+
25
+ The pin lives in **two** places by design — `package.json` and `TJS_VERSION` in
26
+ `code-transform.ts`, which governs the CDN bundle a doc site actually loads — and both moved
27
+ together. The peer floor is unchanged at `^0.13.1`: raising it would warn on install for
28
+ people whose own pin is older, and the CDN pin is what fixes the behaviour on the default
29
+ path. **If you install tjs-lang yourself, upgrade to ≥0.13.12** — your copy wins over ours.
30
+
31
+ Reported by tjs-lang, which was blocked on this while moving its playground onto the doc-site
32
+ system. Released as a patch so nobody waits for 1.15.0 for it.
33
+
34
+ ## 1.14.2
35
+
36
+ A single-fix patch, cut from `v1.14.1` rather than from `main`, so it carries none of the
37
+ in-progress 1.15.0 work.
38
+
39
+ ### `import 'tosijs-ui/doc-browser'` now actually defines `<tosi-doc-system>` (#158, #159)
40
+
41
+ **If you are building a doc site with `tosijs-ui/site`, upgrade.** The one import every
42
+ adoption doc tells you to write did not register the doc system.
43
+
44
+ `doc-browser.ts` is a library module — types, helpers, `createDocBrowser()` — while the element
45
+ lives in `doc-system/doc-system.ts`, which imports *from* doc-browser. The dependency arrow ran
46
+ the wrong way, so that import could never have reached the registrar however it was written.
47
+
48
+ What let it survive several releases is that it was a **partial** success. The leaf components
49
+ (`tosi-sidenav`, `tosi-example`, …) registered fine, so your bundle looked healthy, your own
50
+ elements worked, pages served 200 — and `<tosi-doc-system>` sat in the markup inert. The
51
+ expensive half was quieter: no doc system means no `window.__docTestResults`, so an entire
52
+ inline doc-test corpus **silently stopped existing**. Not a red suite; a suite reporting
53
+ nothing. Two projects hit this independently, one of them reaching a release candidate first.
54
+
55
+ `tosijs-ui/doc-browser` now resolves to an entry that imports the registrar and re-exports the
56
+ whole documented API. **No code changes** — the line you already wrote starts working.
57
+
58
+ A more precise spelling, a named `tosijs-ui/doc-system` export, is coming in a later release.
59
+ **This one keeps working**; it is an addition, not a deprecation.
60
+
61
+ Two sentences were separately false and are corrected: `import 'tosijs-ui'` does **not** also
62
+ register the doc system. The root barrel deliberately excludes that cluster (#133 — it was 77%
63
+ of the barrel's weight, landing on every app that imported a button), so the root import gives
64
+ you buttons and an undefined doc system. That text shipped in the emitted `.d.ts`, the adoption
65
+ page and the adopter reference.
66
+
67
+ A test now imports the built entry in a subprocess and fails if the element is undefined.
68
+ Verified by mutation: strip the side-effect import and it goes red.
69
+
3
70
  ## 1.14.1
4
71
 
5
72
  ### The doc-test gate can tell a dropped page from a passing one
@@ -0,0 +1,2 @@
1
+ import './doc-system/doc-system.js';
2
+ export * from './doc-browser.js';
@@ -0,0 +1,28 @@
1
+ /*
2
+ The entry behind `tosijs-ui/doc-browser`.
3
+
4
+ This exists because that import — the one EVERY adoption doc tells you to write, and the one
5
+ the build's own remediation warning prints when it detects a missing doc system — did not
6
+ define `<tosi-doc-system>`.
7
+
8
+ `doc-browser.ts` is a library module: types, helpers, and the `createDocBrowser()` factory. The
9
+ custom element lives in `doc-system/doc-system.ts`, which imports FROM `doc-browser.ts`. The
10
+ dependency arrow runs the wrong way, so the documented import could never reach the registrar
11
+ however it was written.
12
+
13
+ The result was precisely the failure mode the adoption page warns about, and it is disguised by
14
+ being a PARTIAL success: `tosi-sidenav`, `tosi-example` and the other leaf components do
15
+ register, so the bundle looks healthy, pages serve 200, and `<tosi-doc-system>` sits in the
16
+ markup inert. The expensive half is quieter — no doc system means no `window.__docTestResults`,
17
+ so an adopter's entire inline doc-test corpus silently stops existing. The suite does not fail;
18
+ it reports nothing. Two projects hit this independently (#158, #159), one of them reaching a
19
+ release candidate before anyone noticed.
20
+
21
+ A SEPARATE FILE, not a side-effect import inside `doc-browser.ts`: that would be a genuine
22
+ import cycle (doc-system → doc-browser → doc-system). It would probably work, because
23
+ `doc-system.ts` uses `createDocBrowser` only inside methods — but "probably works, depending on
24
+ evaluation order after your bundler reorders it" is not a thing to put under the one import
25
+ every adopter is told to write. Nothing here depends on evaluation order.
26
+ */
27
+ import './doc-system/doc-system.js';
28
+ export * from './doc-browser.js';
@@ -85,8 +85,10 @@ export interface SiteConfig {
85
85
  * (tosijs-ui#145). The build now warns when it can tell, but the warning is a safety net,
86
86
  * not the contract.
87
87
  *
88
- * Importing the package ROOT (`import 'tosijs-ui'`) also works and registers everything,
89
- * but pulls in every component. Prefer the subpaths above.
88
+ * Importing the package ROOT (`import 'tosijs-ui'`) does **NOT** cover this. The root
89
+ * barrel deliberately excludes the doc-system cluster (tosijs-ui#133 — it was 77% of the
90
+ * barrel's weight, landing on every app that imported a button), so it registers your
91
+ * buttons and leaves `<tosi-doc-system>` undefined. Use the subpaths above.
90
92
  *
91
93
  * If omitted, pages fall back to `scriptUrl` (tosijs-ui's published iife.js), which
92
94
  * already contains the doc system.