Commit Graph
485 Commits
Author SHA1 Message Date
Marvin Hagemeister 003f2bbb5f fix: incorrect partial url on backwards navigation (#2510) 2024-06-08 09:01:12 +02:00
Adam Gregory 8c5e2b00c9 fix: Include submitter data in partial form data (#2307)
Fixes #2306
2024-06-06 19:02:49 +02:00
Luca Casonato c3ec742a65 feat: import fresh from fresh (#2479)
Instead of importing as `@fresh/core`.
2024-06-05 14:51:35 +02:00
Marvin Hagemeister 19d3e452ac fix: bring back island module preloading (#2503) 2024-06-05 14:41:02 +02:00
Marvin Hagemeister 3fe988893d fix: don't show "fresh ready" log in prod (#2500) 2024-06-05 10:21:12 +02:00
Marvin Hagemeister 2b88f4bf56 fix: falsy f-* attributes not preserved inside island (#2498)
Fixes https://github.com/denoland/fresh/issues/2359
2024-06-05 10:06:53 +02:00
Marvin Hagemeister fba3f2b845 fix: partial form redirect not working (#2497)
Fixes https://github.com/denoland/fresh/issues/2404
2024-06-05 09:42:27 +02:00
Marvin Hagemeister d613c6a6ba fix: islands not working with basePath (#2496) 2024-06-05 09:02:27 +02:00
Marvin Hagemeister f8b60ddd15 fix: wrong url after partial form submission (#2495)
Fixes https://github.com/denoland/fresh/issues/2409
2024-06-05 08:30:28 +02:00
Marvin Hagemeister e007597ff3 feat: remove MODE global (#2483) 2024-06-03 16:54:37 +02:00
Luca Casonato aa19b393e7 feat: export compat types from /compat export (#2478) 2024-06-03 14:32:38 +00:00
Marvin Hagemeister 2fb8606e9e fix: path handling inconsistencies (#2482) 2024-06-03 15:03:48 +02:00
Marvin Hagemeister 9347b84cba feat: inject process.env.NODE_ENV for third party libs (#2481) 2024-05-31 15:18:23 +02:00
Marvin Hagemeister 88c3671a09 fix: error handling in fs routes (#2474)
Ran into an issue where we weren't responding with the correct status
code and passed response headers. This was a bit of a rabbit hole and it
was caused by us wrapping to more error handling middlewares than
necessary.
2024-05-31 14:27:36 +02:00
Luca Casonato 8d85945da6 fix: remove Data from FreshContext (#2473)
This is now only on `PageProps`.
2024-05-31 13:50:28 +02:00
Luca Casonato dc283a137b fix: remove @fresh/core/client export (#2477)
These files are now referenced with https URLs.
2024-05-29 12:20:57 +02:00
Luca Casonato 4fab47357f tests: wait for esbuild to shut down (#2476) 2024-05-27 20:03:48 +02:00
Luca CasonatoandMarvin Hagemeister d06dad5be6 tests: don't disable all the sanitizers (#2472)
The tests also pass with them enabled for me.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-05-27 15:00:40 +02:00
Marvin Hagemeister bd60444f7c fix: only generate stack on HttpError if status >= 500 (#2470) 2024-05-27 14:34:36 +02:00
Marvin Hagemeister f9545c3d63 fix: don't show error overlay on HttpError < 500 (#2462) 2024-05-24 23:46:21 +02:00
Marvin Hagemeister 9a7399a769 chore: disable sanitizers in esbuild tests (#2461) 2024-05-24 20:39:54 +02:00
Marvin Hagemeister 77dc77826e fix: only load error overlay in development (#2460) 2024-05-24 20:29:59 +02:00
Luca Casonato f2162d24bf feat: add render function (#2454) 2024-05-24 18:31:34 +02:00
Luca Casonato c9f0ccdce7 feat: rename helpers to define (#2453) 2024-05-24 11:48:32 +02:00
Marvin Hagemeister 287929e4d2 major: import Fresh 2.0 code (#2449)
🎉
2024-05-24 09:40:08 +02:00
Marvin Hagemeister e4981d30ad www: rework docs layout (#2429)
- Re-enable partials
- clean up layout a bit
2024-05-21 17:38:32 +02:00
Marcos Candeia 9404787c85 feat: Support startServer for unix domain sockets (#2392)
Signed-off-by: Marcos Candeia <marrcooos@gmail.com>
2024-05-02 20:45:10 +02:00
Marvin Hagemeister 40181142d2 fix: ServerhandlerInfo type for newer Deno versions (#2419)
Newer Deno versions have an additional `completed` property in there.
This PR allows Fresh to be used with both old and newer Deno versions
without getting type errors.
2024-05-02 20:41:33 +02:00
Asher Gomez 425032a6dc chore: minor cleanups (#2393)
These changes occur by just running `deno task ok` on `main`.
2024-04-08 13:08:41 +02:00
Bedis Nbiba 1d69f167ee chore: satisfy use-import-type lint (biomejs) (#2389)
https://biomejs.dev/linter/rules/use-import-type/

From that page the argument is 

>The rule ensures that all imports used only as a type use a type-only
import. It also groups inline type imports into a grouped import type.
2024-03-27 08:00:14 +01:00
Luca CasonatoandMarvin Hagemeister 29d582c987 chore: update ahead-of-time build docs for Deno Deploy (#2381)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-03-22 22:19:17 +01:00
Adam Gregory 9cf838684e fix: Add closing quote for nonce in inline partial script (#2377)
Fixes #2376
2024-03-21 19:32:53 +01:00
Marvin Hagemeister 240252fdb4 Revert "feat: add ctx.redirect() helper (#2358)" (#2372)
Mostly so that it's easier to cut the next patch release for Fresh.

This reverts commit e3508c3054.
2024-03-21 10:27:53 +01:00
Luca Casonato c797716a56 chore: update to esbuild-deno-loader@0.10.2 and esbuild@0.20.2 (#2366) 2024-03-21 08:13:01 +00:00
Marvin Hagemeister e3508c3054 feat: add ctx.redirect() helper (#2358)
This PR adds a `ctx.redirect(path, status)` helper that aims to reduce
the verbosity of having to manually create a `Response` obejct for a
mere redirect.

```ts
// Before
new Response(null, {
  status: 307,
  headers: {
    Location: "/foo/bar"
  },
})

// After
ctx.redirect("/foo/bar", 307)
```

If the second parameter is not passed, it will default to `302`.
2024-03-12 17:36:34 +01:00
Michael Gearhardt 671751d572 fix: $fresh ref in import sources (#2340)
There was an issue with the tailwind error page being pulled in by ref
to $fresh, fixed so now it just uses the file
2024-03-12 12:14:23 +01:00
Reed von Redwitz 5ec06350e2 fix: allow multiple set-cookie headers to be set before render (#2357)
closes #2346

The primary issue was the snippet `headers[key] = value`. This caused
only one `set-cookie` to make it through. Switching to a `Headers`
object allowed me to use `append` when appropriate, allowing for
multiple `set-cookie` entries.

I also cleaned up one of the tests to make use of steps, because I
originally broke it and couldn't immediately tell which part was
failing.
2024-03-12 12:04:42 +01:00
Marvin Hagemeister b7281792a0 chore: update deno_esbuild_loader to 0.9.0 (#2337)
Fixes https://github.com/denoland/fresh/issues/2332
2024-02-23 13:31:00 +01:00
Reed von Redwitz 8f3031317b fix: properly prefix all scripts with base path (#2334)
closes https://github.com/denoland/fresh/issues/2326

There was a big misunderstanding on my part -- in particular that a
different server might be listening at the root, so the redirect built
into `context.ts` will never happen. The existing test (as mentioned in
the issue) passes, but only because no one else is listening, and fresh
is able to perform the redirect.

I briefly considered writing a docker container to orchestrate this
properly, but then I didn't want to have docker running in order to run
these tests. (My laptop is old and bad.) So instead the two new tests
very thoroughly assert that scripts included in the html are properly
prefixed with the base path. And yes, they fail if the fix is reverted.

As for the fix itself: I just needed to prepend the asset URL with the
base path.
2024-02-23 13:30:42 +01:00
Marvin Hagemeister a2be1abc6b chore: update Preact to 10.19.6 (#2331) 2024-02-22 10:46:41 +01:00
Marvin Hagemeister f1c17bc67e fix: invalid quote around partial script data (#2323)
This is a little emberassing 👀
2024-02-20 01:07:51 +01:00
William Weiss 0fc83be54b startServer onListen logs https when key & cert specified (#2321)
Some team members of mine were confused by the default output 

```
 🍋 Fresh ready
    Local: http://localhost:8000/
```

when the server is actually running HTTPS. This should now print

```
 🍋 Fresh ready
    Local: https://localhost:8000/
```

when a key and cert are specified.
2024-02-19 15:14:20 +01:00
Reed von Redwitz 82c75f85e9 fix: update dependency recommendations (#2320)
closes https://github.com/denoland/fresh/issues/2319

The issue is because `imports.ts` wasn't changed before releasing. I
thought I would go through and bump some other versions as well. This
handles everything except the esbuild stuff and `tests/`.
2024-02-19 10:33:04 +01:00
Marvin Hagemeister aeca15eeb9 fix: open redirect issue with trailing slash detection (#2313)
Passing a path like `/foo/bar` as the location header is interpreted as
a relative path. But when it contains two leading slashes like
`//evil.com/` it is interpreted as a port relative url. This has the
consequence that the origin of a URL can essentially be replaced:

```ts
new URL("//evil.com", "https://example.com/");
// -> 'https://evil.com/'
```

Our trailing slash detection logic didn't guard against this case. By
normalizing the pathname of the URL and stripping sibling forward
slashes we sidestep this problem.
2024-02-14 15:25:16 +01:00
Roj [roːʒ] d19c22d592 feat: add back twind in init wizard (#2290) 2024-01-30 12:34:38 +01:00
Benjamin Jesuiter 2652b85532 fix: GH actions warning by upgrading to v4 #2285 (#2286)
I tested the change in my own repo, the warning on github disapears for
the "actions/checkout" action.
It is still there for the denoland/setup-deno action, but an upgrade PR
is already ongoing for this action, see:
https://github.com/denoland/setup-deno/pull/56
2024-01-29 14:13:32 +01:00
Reed von Redwitz 3f28cc8977 chore: upgrade tailwind to 3.4.1 (#2287) 2024-01-29 14:10:28 +01:00
Luca Casonato 34c875c71c chore: update esbuild_deno_loader to 0.8.5 (#2273) 2024-01-23 21:52:30 +01:00
Reed von Redwitz a83765efaa fix: no-window lint error (#2272)
Latest PR runs are failing with linting errors, e.g.
https://github.com/denoland/fresh/actions/runs/7625625084/job/20770308634?pr=2266

Maybe this shouldn't be happening like this right now, but we'll still
need to clean these up eventually.
2024-01-23 21:51:38 +01:00
Luca Casonato 4bd556970a chore: update esbuild deno loader (#2270)
This fixes a bunch of bugs related to `npm:` imports.
2024-01-22 13:01:42 +00:00