Skip to content

Commit 9e2d134

Browse files
authored
Merge branch 'main' into move-buildOutDir
2 parents c70e22a + fcd9480 commit 9e2d134

41 files changed

Lines changed: 720 additions & 613 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@std/semver": "jsr:@std/semver@1",
6666
"@std/streams": "jsr:@std/streams@1",
6767

68-
"@astral/astral": "jsr:@astral/astral@^0.4.6",
68+
"@astral/astral": "jsr:@astral/astral@^0.5.2",
6969
"@marvinh-test/fresh-island": "jsr:@marvinh-test/fresh-island@^0.0.1",
7070
"linkedom": "npm:linkedom@^0.16.11",
7171
"@std/async": "jsr:@std/async@1",

deno.lock

Lines changed: 116 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/latest/examples/client-side-components-and-libraries.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function LeafletProvider(props: { children: ComponentChildren }) {
5353
<p>Leaflet must be loaded on the client. No children will render</p>
5454
);
5555
}
56-
const [value, setValue] = useState<typeof Leaflet | null>(null);
56+
const value = useSignal<typeof Leaflet | null>(null)
5757
return (
5858
<>
5959
{/* Load Leaflet CSS */}
@@ -65,7 +65,7 @@ function LeafletProvider(props: { children: ComponentChildren }) {
6565
/>
6666
{/* Load Leaflet JS */}
6767
<script
68-
onLoad={() => setValue(window.L)}
68+
onLoad={() => value.value = window.L}
6969
src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
7070
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
7171
crossorigin=""
@@ -120,8 +120,9 @@ export default function MapIsland() {
120120
```tsx MapIsland.tsx
121121
import * as Leaflet from "https://esm.sh/v135/@types/leaflet@1.9.4/index.d.ts";
122122
import { IS_BROWSER } from "$fresh/runtime.ts";
123-
import { useContext, useEffect, useState } from "preact/hooks";
123+
import { useContext, useEffect } from "preact/hooks";
124124
import { ComponentChildren, createContext } from "preact";
125+
import { useSignal } from "@preact/signals";
125126

126127
// Create a context to hold Leaflet data/functions
127128
const LeafletContext = createContext<typeof Leaflet | null>(null);
@@ -131,7 +132,7 @@ function LeafletProvider(props: { children: ComponentChildren }) {
131132
if (!IS_BROWSER) {
132133
return <p>Leaflet must be loaded on the client. No children will render</p>;
133134
}
134-
const [value, setValue] = useState<typeof Leaflet | null>(null);
135+
const value = useSignal<typeof Leaflet | null>(null);
135136
return (
136137
<>
137138
{/* Load Leaflet CSS */}
@@ -143,7 +144,7 @@ function LeafletProvider(props: { children: ComponentChildren }) {
143144
/>
144145
{/* Load Leaflet JS */}
145146
<script
146-
onLoad={() => setValue(window.L)}
147+
onLoad={() => value.value = window.L}
147148
src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
148149
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
149150
crossorigin=""

docs/latest/getting-started/form-submissions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ export default function Page({ data }: PageProps<Data>) {
5353
return (
5454
<div>
5555
<form>
56-
<input type="text" name="q" value={query} />
57-
<button type="submit">Search</button>
56+
<input type="text" name="q" value={query} class="border p-1" />
57+
<button type="submit" class="ml-1 px-2 py-1 bg-gray-100 border">
58+
Search
59+
</button>
5860
</form>
5961
<ul>
6062
{results.map((name) => <li key={name}>{name}</li>)}

init/src/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ ${GRADIENT_CSS}`;
403403
import { define, type State } from "./utils.ts";
404404
405405
export const app = new App<State>();
406+
406407
app.use(staticFiles());
407408
408409
// this is the same as the /api/:name route defined via a file. feel free to delete this!
@@ -421,7 +422,6 @@ const exampleLoggerMiddleware = define.middleware((ctx) => {
421422
app.use(exampleLoggerMiddleware);
422423
423424
await fsRoutes(app, {
424-
dir: "./",
425425
loadIsland: (path) => import(\`./islands/\${path}\`),
426426
loadRoute: (path) => import(\`./routes/\${path}\`),
427427
});

0 commit comments

Comments
 (0)