@ogygia/core 0.12.0 → 0.12.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.
|
@@ -839,7 +839,11 @@ var FileCompilation = class {
|
|
|
839
839
|
}
|
|
840
840
|
if (render_mode != null && !RENDER_MODES.has(render_mode)) throw fail(`unknown ${import_keys.render} '${render_mode}'. Use 'static' (inline HTML) | 'deferred' (a hole, fetched) | 'live' (a hole that revalidates).`);
|
|
841
841
|
const said = from_preset ? `preset '${from_preset}'` : "this import";
|
|
842
|
-
if (render_mode === "deferred" && wake_val != null)
|
|
842
|
+
if (render_mode === "deferred" && wake_val != null) {
|
|
843
|
+
if (fetch_val != null) throw fail(`${said} times a \`${import_keys.render}: 'deferred'\` hole twice, with \`${import_keys.fetch}: '${fetch_val}'\` and \`${import_keys.wake}: '${wake_val}'\`. Keep \`${import_keys.fetch}\`: it says when a hole's HTML arrives.`);
|
|
844
|
+
warn_once(`deferred-wake:${rel_host}:${said}:${wake_val}`, `[ogygia] ${rel_host}: ${said} times a \`${import_keys.render}: 'deferred'\` hole with \`${import_keys.wake}: '${wake_val}'\`, which is deprecated. Write \`${import_keys.render}: 'deferred', ${import_keys.fetch}: '${wake_val}'\` instead: \`${import_keys.fetch}\` says when a hole's HTML arrives. (\`${import_keys.wake}\` is when an island's JS runs; a hole ships no JS.)`);
|
|
845
|
+
fetch_val = wake_val;
|
|
846
|
+
}
|
|
843
847
|
if (fetch_val != null && render_mode !== "deferred") throw fail(`${said} sets \`${import_keys.fetch}: '${fetch_val}'\` without \`${import_keys.render}: 'deferred'\` — \`${import_keys.fetch}\` is a hole's timing. Write \`${import_keys.render}: 'deferred', ${import_keys.fetch}: '${fetch_val}'\` for a hole` + (render_mode == null ? `, or \`${import_keys.wake}: '${fetch_val}'\` for an island.` : "."));
|
|
844
848
|
if (render_mode === "deferred") attrs.set("defer", fetch_val ?? "load");
|
|
845
849
|
else if (render_mode === "live") {
|
|
@@ -1731,8 +1735,11 @@ var TsRegionCompilation = class {
|
|
|
1731
1735
|
if (marker.fetch != null && marker.render == null) throw new Error(`[ogygia] ${this.#rel_host}: \`${fetchKey}: '${marker.fetch}'\` without \`${renderKey}: 'deferred'\` — \`${fetchKey}\` is a hole's timing. Write \`${renderKey}: 'deferred', ${fetchKey}: '${marker.fetch}'\` for a hole, or \`${this.#wakeKey}: '${marker.fetch}'\` for an island.`);
|
|
1732
1736
|
if (marker.render != null) {
|
|
1733
1737
|
if (marker.render !== "deferred") throw new Error(marker.render === "live" ? `[ogygia] ${this.#rel_host}: \`${renderKey}: 'live'\` is not supported on a .ts import — use it in a .svelte file.` : `[ogygia] ${this.#rel_host}: unknown \`${renderKey}\` '${marker.render}'. Use 'deferred'.`);
|
|
1734
|
-
if (marker.wake != null)
|
|
1735
|
-
|
|
1738
|
+
if (marker.wake != null) {
|
|
1739
|
+
if (marker.fetch != null) throw new Error(`[ogygia] ${this.#rel_host}: a \`${renderKey}: 'deferred'\` hole timed twice, with \`${fetchKey}: '${marker.fetch}'\` and \`${this.#wakeKey}: '${marker.wake}'\`. Keep \`${fetchKey}\`: it says when a hole's HTML arrives.`);
|
|
1740
|
+
warn_once(`deferred-wake:${this.#rel_host}:ts:${marker.wake}`, `[ogygia] ${this.#rel_host}: a \`${renderKey}: 'deferred'\` hole timed with \`${this.#wakeKey}: '${marker.wake}'\`, which is deprecated. Write \`${renderKey}: 'deferred', ${fetchKey}: '${marker.wake}'\` instead: \`${fetchKey}\` says when a hole's HTML arrives. (\`${this.#wakeKey}\` is when an island's JS runs; a hole ships no JS.)`);
|
|
1741
|
+
}
|
|
1742
|
+
const dval = marker.fetch ?? marker.wake ?? "load";
|
|
1736
1743
|
let when;
|
|
1737
1744
|
if (DEFER_STRATEGIES.has(dval)) when = dval;
|
|
1738
1745
|
else if (is_media_query(dval)) when = dval;
|