fix: throw error when no partials found (#1853)

This commit is contained in:
Marvin Hagemeister
2023-10-04 15:38:43 +02:00
committed by GitHub
parent ea91687ea3
commit be1c15f8f3
7 changed files with 83 additions and 3 deletions
@@ -0,0 +1,26 @@
import { Partial } from "$fresh/runtime.ts";
import CounterA from "../../islands/CounterA.tsx";
import { Fader } from "../../islands/Fader.tsx";
export default function WarnDemo() {
return (
<div>
<Partial name="slot-1">
<Fader>
<p class="status-initial">Initial content</p>
<CounterA />
</Fader>
</Partial>
<p>
<a
class="update-link"
href="/no_partial_response/injected"
f-partial="/no_partial_response/update"
>
update
</a>
</p>
<pre id="logs"></pre>
</div>
);
}
@@ -0,0 +1,10 @@
import { defineRoute } from "$fresh/src/server/defines.ts";
export default defineRoute(() => {
return new Response("", {
status: 302,
headers: {
Location: "/no_partial_response",
},
});
});
@@ -0,0 +1,11 @@
import { defineRoute } from "$fresh/src/server/defines.ts";
import { RouteConfig } from "$fresh/server.ts";
export const config: RouteConfig = {
skipAppWrapper: true,
skipInheritedLayouts: true,
};
export default defineRoute((req, ctx) => {
return <p class="status-append">append content</p>;
});