@webjsdev/core 0.7.36 → 0.7.37

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/core",
3
- "version": "0.7.36",
3
+ "version": "0.7.37",
4
4
  "type": "module",
5
5
  "description": "webjs core runtime - html/css tags, WebComponent base, isomorphic renderers",
6
6
  "types": "./index.d.ts",
@@ -79,6 +79,14 @@ abstract class WebComponentBase extends HTMLElement {
79
79
  static properties: Record<string, PropertyDeclaration>;
80
80
  static styles: CSSResult | CSSResult[] | null;
81
81
  static lazy?: boolean;
82
+ /**
83
+ * Force this component to ship (hydrate) even when the elision analyser would
84
+ * drop it as display-only. The escape hatch for interactivity the analyser
85
+ * cannot see statically: a dynamically-computed tag string, or a `:defined`
86
+ * rule in an external stylesheet outside the module graph. Leave unset for
87
+ * the automatic verdict.
88
+ */
89
+ static interactive?: boolean;
82
90
  /** Register this class as a custom element under `tag`. Tag must contain a hyphen. */
83
91
  static register(tag: string): void;
84
92
  static readonly observedAttributes: string[];
@@ -81,7 +81,17 @@ export interface WebjsRedirectRule {
81
81
  /** The trailing-slash canonicalization policy in `webjs.trailingSlash`. */
82
82
  export type WebjsTrailingSlash = 'never' | 'always' | 'ignore';
83
83
 
84
- /** Dev task orchestration in `webjs.dev` (#550). Read by the CLI, not the server. */
84
+ /** A single on-request regeneration rule in `webjs.dev.regenerate` (#967). */
85
+ export interface WebjsRegenerateRule {
86
+ /** The appDir-relative served output this rule rebuilds (e.g. `"public/tailwind.css"`); a leading slash is stripped. */
87
+ output: string;
88
+ /** The shell command that rebuilds `output` (the same command prod uses in `start.before`, so dev and prod cannot diverge). */
89
+ command: string;
90
+ /** Source files/directories whose newest mtime is compared to `output`'s; a newer one (or a missing output) triggers the rebuild. */
91
+ inputs?: string[];
92
+ }
93
+
94
+ /** Dev task orchestration in `webjs.dev` (#550). `before`/`parallel` read by the CLI, `regenerate` by the server. */
85
95
  export interface WebjsDevTasks {
86
96
  /**
87
97
  * One-shot commands run sequentially to completion BEFORE the dev server
@@ -91,10 +101,18 @@ export interface WebjsDevTasks {
91
101
  before?: string[];
92
102
  /**
93
103
  * Long-lived commands run as child processes ALONGSIDE the dev server (the
94
- * old `concurrently` watchers: the Tailwind CLI `--watch`). Spawned once in
95
- * the parent and torn down on exit, so a watcher cannot leak past the server.
104
+ * old `concurrently` watchers). Spawned once in the parent and torn down on
105
+ * exit, so a watcher cannot leak past the server.
96
106
  */
97
107
  parallel?: string[];
108
+ /**
109
+ * On-request build-output regeneration (#967), DEV-ONLY. Each rule rebuilds a
110
+ * stale `output` before the dev server serves it, so a static build product
111
+ * (the scaffold's `public/tailwind.css`, #947) never goes stale without a
112
+ * live `--watch` process that can die mid-session. Prod builds the same output
113
+ * once via `start.before`. Read by the server (`readRegenerateRules`).
114
+ */
115
+ regenerate?: WebjsRegenerateRule[];
98
116
  /**
99
117
  * Extra directories the dev live-reload watcher follows IN ADDITION to the
100
118
  * appDir (#894). The dev server watches its appDir recursively, but an app