@paged-media/plugin-sdk 0.2.30-canary.0 → 0.2.32-canary.0
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/dist/index.d.ts +30 -11
- package/dist/index.js +41 -15
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -698,19 +698,38 @@ declare function loadBundle(getEditor: () => PagedEditor, bundle: PagedBundle, o
|
|
|
698
698
|
* KEEP IN SYNC with plugin-cli's WASM_MAX_* and the schema's `maxBytes`
|
|
699
699
|
* maximum — the CLI hand-mirrors the contract. */
|
|
700
700
|
declare const WASM_BUDGETS: {
|
|
701
|
-
/**
|
|
702
|
-
*
|
|
703
|
-
*
|
|
704
|
-
*
|
|
705
|
-
*
|
|
701
|
+
/**
|
|
702
|
+
* THE budget, as of 2026-08-19 (maintainer decision): **100 MB for the
|
|
703
|
+
* whole app including every plugin.**
|
|
704
|
+
*
|
|
705
|
+
* The per-thing ceilings below used to be the governance. They were
|
|
706
|
+
* the wrong shape: each capped one artifact or one bundle, so eight
|
|
707
|
+
* bundles could each pass their own gate while the app shipped a
|
|
708
|
+
* quarter of a gigabyte, and nothing in any repo measured the sum.
|
|
709
|
+
* What a user downloads is the sum, so the sum is what is governed.
|
|
710
|
+
*
|
|
711
|
+
* This constant is the CONTRACT; the enforcement lives where the app
|
|
712
|
+
* is assembled, in the editor's `scripts/wasm-budget.mjs` (run in its
|
|
713
|
+
* `checks` CI job), because only the app knows which bundles ship. It
|
|
714
|
+
* deduplicates by real path — pnpm links one store entry from many
|
|
715
|
+
* packages, and a naive walk over-counts nearly 6x. Measured 2026-08-19:
|
|
716
|
+
* 49.4 MB across 9 distinct artifacts, ~50 MB of headroom.
|
|
717
|
+
*/
|
|
718
|
+
readonly maxAppTotalBytes: number;
|
|
719
|
+
/** Per-artifact ceiling for layout/codec/compute. Folded into the
|
|
720
|
+
* app-wide envelope on 2026-08-19 (was 8 MiB, briefly 25): a single
|
|
721
|
+
* artifact is no longer independently interesting, since the sum is
|
|
722
|
+
* bounded. Kept — not deleted — so a manifest `maxBytes` still has
|
|
723
|
+
* something to TIGHTEN and the loader keeps a hard upper stop. */
|
|
706
724
|
readonly maxArtifactBytes: number;
|
|
707
|
-
/** D-07b — the
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
*
|
|
725
|
+
/** D-07b — was the HIGHER ceiling for `purpose: "engine"` (a vendored
|
|
726
|
+
* DB/query engine like DuckDB-WASM ≈ 36 MiB) back when ordinary
|
|
727
|
+
* artifacts were capped far lower. Now equal to the ordinary cap; the
|
|
728
|
+
* `purpose` distinction survives for governance/telemetry, not size. */
|
|
711
729
|
readonly maxEngineArtifactBytes: number;
|
|
712
|
-
/** Total declared wasm across
|
|
713
|
-
*
|
|
730
|
+
/** Total declared wasm across ONE bundle. Also the app-wide number —
|
|
731
|
+
* one bundle may in principle spend the entire envelope, and the
|
|
732
|
+
* app-wide check is what stops the app as a whole. */
|
|
714
733
|
readonly maxTotalBytes: number;
|
|
715
734
|
/** Wall-clock budget for fetch + compile + instantiate. Protects the
|
|
716
735
|
* editor's main flow from a pathological module; advisory, the loader
|
package/dist/index.js
CHANGED
|
@@ -566,7 +566,12 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
566
566
|
"contribute.panel",
|
|
567
567
|
`contributes.panels[] must include "${c.id}"`
|
|
568
568
|
);
|
|
569
|
-
return store.add(
|
|
569
|
+
return store.add(
|
|
570
|
+
getEditor().registries.panels.register({
|
|
571
|
+
...c,
|
|
572
|
+
source: manifest.name
|
|
573
|
+
})
|
|
574
|
+
);
|
|
570
575
|
},
|
|
571
576
|
schemaPanel(c) {
|
|
572
577
|
assertNamespaced(c.id, "schemaPanel");
|
|
@@ -583,6 +588,8 @@ function createBundleHost(getEditor, manifest, options) {
|
|
|
583
588
|
defaultGroup: c.defaultGroup,
|
|
584
589
|
closable: c.closable,
|
|
585
590
|
movable: c.movable,
|
|
591
|
+
// Host-stamped provenance, same as `panel()` above.
|
|
592
|
+
source: manifest.name,
|
|
586
593
|
component: makeSchemaPanelComponent(
|
|
587
594
|
c,
|
|
588
595
|
bindings,
|
|
@@ -2618,20 +2625,39 @@ function loadBundle(getEditor, bundle, options) {
|
|
|
2618
2625
|
|
|
2619
2626
|
// src/wasm-bundle-loader.ts
|
|
2620
2627
|
var WASM_BUDGETS = {
|
|
2621
|
-
/**
|
|
2622
|
-
*
|
|
2623
|
-
*
|
|
2624
|
-
*
|
|
2625
|
-
*
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
*
|
|
2629
|
-
*
|
|
2630
|
-
*
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
*
|
|
2634
|
-
|
|
2628
|
+
/**
|
|
2629
|
+
* THE budget, as of 2026-08-19 (maintainer decision): **100 MB for the
|
|
2630
|
+
* whole app including every plugin.**
|
|
2631
|
+
*
|
|
2632
|
+
* The per-thing ceilings below used to be the governance. They were
|
|
2633
|
+
* the wrong shape: each capped one artifact or one bundle, so eight
|
|
2634
|
+
* bundles could each pass their own gate while the app shipped a
|
|
2635
|
+
* quarter of a gigabyte, and nothing in any repo measured the sum.
|
|
2636
|
+
* What a user downloads is the sum, so the sum is what is governed.
|
|
2637
|
+
*
|
|
2638
|
+
* This constant is the CONTRACT; the enforcement lives where the app
|
|
2639
|
+
* is assembled, in the editor's `scripts/wasm-budget.mjs` (run in its
|
|
2640
|
+
* `checks` CI job), because only the app knows which bundles ship. It
|
|
2641
|
+
* deduplicates by real path — pnpm links one store entry from many
|
|
2642
|
+
* packages, and a naive walk over-counts nearly 6x. Measured 2026-08-19:
|
|
2643
|
+
* 49.4 MB across 9 distinct artifacts, ~50 MB of headroom.
|
|
2644
|
+
*/
|
|
2645
|
+
maxAppTotalBytes: 100 * 1e3 * 1e3,
|
|
2646
|
+
/** Per-artifact ceiling for layout/codec/compute. Folded into the
|
|
2647
|
+
* app-wide envelope on 2026-08-19 (was 8 MiB, briefly 25): a single
|
|
2648
|
+
* artifact is no longer independently interesting, since the sum is
|
|
2649
|
+
* bounded. Kept — not deleted — so a manifest `maxBytes` still has
|
|
2650
|
+
* something to TIGHTEN and the loader keeps a hard upper stop. */
|
|
2651
|
+
maxArtifactBytes: 100 * 1e3 * 1e3,
|
|
2652
|
+
/** D-07b — was the HIGHER ceiling for `purpose: "engine"` (a vendored
|
|
2653
|
+
* DB/query engine like DuckDB-WASM ≈ 36 MiB) back when ordinary
|
|
2654
|
+
* artifacts were capped far lower. Now equal to the ordinary cap; the
|
|
2655
|
+
* `purpose` distinction survives for governance/telemetry, not size. */
|
|
2656
|
+
maxEngineArtifactBytes: 100 * 1e3 * 1e3,
|
|
2657
|
+
/** Total declared wasm across ONE bundle. Also the app-wide number —
|
|
2658
|
+
* one bundle may in principle spend the entire envelope, and the
|
|
2659
|
+
* app-wide check is what stops the app as a whole. */
|
|
2660
|
+
maxTotalBytes: 100 * 1e3 * 1e3,
|
|
2635
2661
|
/** Wall-clock budget for fetch + compile + instantiate. Protects the
|
|
2636
2662
|
* editor's main flow from a pathological module; advisory, the loader
|
|
2637
2663
|
* aborts with a clear error when exceeded. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paged-media/plugin-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.32-canary.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@paged-media/plugin-api": "0.2.
|
|
14
|
+
"@paged-media/plugin-api": "0.2.32-canary.0"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": "^18.3.0"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@paged-media/canvas-wasm": "0.
|
|
25
|
+
"@paged-media/canvas-wasm": "0.62.0",
|
|
26
26
|
"@types/node": "20.19.39",
|
|
27
27
|
"@types/react": "^18.3.12",
|
|
28
28
|
"react": "^18.3.0",
|