Commit Graph
1357 Commits
Author SHA1 Message Date
Marvin Hagemeister 39737b4530 fix: write matched pattern into ctx.route (#3113)
Fixes https://github.com/denoland/fresh/issues/3112
2025-07-18 22:38:56 +02:00
Asher GomezandMarvin Hagemeister 83da608504 BREAKING(core): remove FreshBuilder interface (#2935)
Once can just use `Builder` for typing.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-07-18 19:15:14 +02:00
Weverton Marques 958b9528cc docs: fix: Change port to 3000 after setting PORT=3000 (#2828) 2025-07-18 19:14:56 +02:00
Marvin Hagemeister e6a5a5fabb docs: canary remove outdated csp page (#3111) 2025-07-18 18:42:53 +02:00
Marvin Hagemeister 79db6391f0 docs: update canary rendering raw HTML page (#3110) 2025-07-18 18:36:52 +02:00
Marvin Hagemeister 35b696d870 docs: update canary error handling (#3109) 2025-07-18 18:21:58 +02:00
Marvin Hagemeister a703e79181 docs: update canary docs for Fresh 2 (#3108)
There are still some rough edges here and there, but it's in a much
better shape than what we have today.
2025-07-18 15:18:38 +02:00
Marvin Hagemeister a66e0df08d chore: release 2.0.0-alpha.41 (#3107) 2025-07-17 15:37:02 +02:00
Marvin Hagemeister 226e250386 fix: middleware regressions (#3106)
Fixes some regressions found after merging
https://github.com/denoland/fresh/pull/3086

- Missing 404 middlewares when mounting sub-apps
- revert more staticFiles logic to always require the middleware like
before
2025-07-17 15:23:27 +02:00
Marvin Hagemeister c279efa345 fix: incorrect middleware ordering (#3102)
This is a regression introduced in
https://github.com/denoland/fresh/pull/3086
2025-07-16 16:43:46 +02:00
Marvin Hagemeister 9efaf0463e chore: release 2.0.0-alpha.40 (#3101) 2025-07-16 14:46:17 +02:00
Marvin Hagemeister be03e4a548 fix(init): add back static files (#3100) 2025-07-16 14:41:12 +02:00
Marvin Hagemeister 599973bb5c fix: support non-fallthrough static files like before (#3099) 2025-07-16 14:34:39 +02:00
Marvin Hagemeister 776a275b5d docs: design updates (#3098)
Update colors, spacing and fix the toc animation.
2025-07-16 14:01:30 +02:00
Marvin Hagemeister 713c85c12d chore: release 2.0.0-alpha.39 (#3097) 2025-07-16 13:43:31 +02:00
Luca Casonato b7384037f9 fix: find nearest deno config with compiler options (#3096)
Previously it would only consult the compiler options in the workspace
root deno.json, now it also considers relevant workspace members.
2025-07-16 11:36:21 +00:00
Marvin Hagemeister c11cf7b41a feat: expose layouts and pages on App (#3086)
This PR extracts the functionality from the `fs_routes` plugin and
exposes it onto `App`. These are the new APIs:

- `app.layout(pattern, route)`
- `app.onError(pattern, route)`
- `app.notFound(pattern, route)`
- `app.route(pattern, route)`

This also removes the need for `.use(staticFiles())`. This line can be
safely removed.

Fixes https://github.com/denoland/fresh/issues/3040
Fixes https://github.com/denoland/fresh/issues/3033
Fixes https://github.com/denoland/fresh/issues/2591
Fixes https://github.com/denoland/fresh/issues/950
Fixes https://github.com/denoland/fresh/issues/1918
2025-07-14 19:27:48 +02:00
Marvin Hagemeister ccb621d2a3 chore: release 2.0.0-alpha.38 (#3095) 2025-07-14 18:19:03 +02:00
Marvin Hagemeister db412053df fix: wasm allocation issue (#3094)
Fix is included in upstream `@deno/loader` that's used in our esbuild
plugin, see https://github.com/denoland/deno-js-loader/pull/22
2025-07-14 18:15:39 +02:00
Marvin Hagemeister 6eeb20c7a3 Revert "feat: support overwriting default 404 handler (#3081)" (#3093)
This reverts commit 0b3546f201.

Reverting this because it will be superseded by
https://github.com/denoland/fresh/pull/3086
2025-07-14 18:11:20 +02:00
31dcbfbb8b fix: hide node_modules and vendor from update output (#3089)
Added logic to filter out files in node_modules and vendor directories
from user-facing logs and migration summaries in the update process.
Updated tests to verify that these files are processed but not shown in
logs.

close #3082

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Marvin Hagemeister <marvinhagemeister50@gmail.com>
2025-07-14 15:57:07 +02:00
Zichao Lan 3c43d98a57 docs: update HandlerContext -> FreshContext (#3092)
'HandlerContext' is deprecated.deno-ts(6385)
2025-07-13 23:21:56 +02:00
Marvin Hagemeister e2699923b0 chore: rename tests FreshApp -> App (#3087) 2025-07-10 10:24:39 +02:00
Marvin Hagemeister a941dd33c5 chore: ignore test tmp delete failures on windows (#3088) 2025-07-10 10:21:22 +02:00
zhizheng cfc9a9a601 chore: ensures more stable CI runs on Windows environments. (#3070)
This pull request includes a small but important change to the
`withTmpDir` function in `src/test_utils.ts`. The change adds error
handling to ensure that a `PermissionDenied` error during directory
removal does not interrupt the execution.
2025-07-10 10:09:16 +02:00
Marvin Hagemeister 31434a2cf9 fix: wrong fresh domain used in hash (#3085) 2025-07-09 23:39:39 +02:00
Marvin Hagemeister f7174d0df0 chore: cleanup cors middleware (#3083)
- Remove some indirections
- Make tests self contained
- Switch tests to `Deno.test` as the LSP doesn't yet recognise
`describe/it`
2025-07-09 21:44:57 +02:00
Chris d072dc2fc0 fix: avoid reload for user-code history changes (#3045) (#3048)
The Fresh partials popstate handler causes page reloads when user code
makes use of navigation history state. This can lead to a loss of user
data in a browsing context.
To fix this behavior, FreshHistoryState now has a flag which validates
partials functionality/explicitly opts-in to any partial related
location management.
2025-07-09 20:59:32 +02:00
Asher Gomez 3e211dc7ec fix: import current version of fresh (#3020)
Previously, all packages except `@fresh/core` and even some tests
might've imported `jsr:@fresh/core@^2.0.0-alpha.29` rather than the
latest version of Fresh. This PR fixes that.
2025-07-09 11:03:47 +02:00
Coty ee46263053 feat: Add localhost help text to server address output (#3077)
When binding to `0.0.0.0` or `::`, show localhost equivalent URL for
convenience

Closes #3076

output from fresh www

```
deno task start
Task start deno run -A --watch=static/,routes/,../src,../docs dev.ts
Watcher Process started.

 🍋 Fresh ready
    Local:  http://0.0.0.0:8000/ (http://localhost:8000/)

GA4_MEASUREMENT_ID environment variable not set. Google Analytics reporting disabled.
```
2025-07-09 00:58:04 +02:00
Marvin Hagemeister 0b3546f201 feat: support overwriting default 404 handler (#3081)
Fixes https://github.com/denoland/fresh/issues/1918
2025-07-09 00:40:12 +02:00
Marvin Hagemeister ec2bb17589 chore: release 2.0.0-alpha.37 (#3074) 2025-07-02 12:48:11 +02:00
Marvin Hagemeister b00175fafd fix(core): don't rely on strict esbuild version (#3073) 2025-07-02 12:38:42 +02:00
Marvin Hagemeister 67fd8ccd36 chore: release 2.0.0-alpha.36 (#3072) 2025-06-30 16:39:34 +02:00
Marvin Hagemeister 8416078b6a fix(core): improve island props serialization (#3071) 2025-06-30 16:31:58 +02:00
zhizhengand李嘉图·M·路 8d3b8c53c6 docs: Update Fresh canary usage instructions in docs (#3067)
Revise documentation to clarify how to use the latest Fresh 2 canary,
specific commits, and forks via deno.json. Add instructions for creating
new projects using JSR and local sources, and update references to
current package versions. Include links to the Fresh v2 blog and
migration guide for further reading.

close #3058

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
2025-06-30 12:27:53 +02:00
Asher Gomez 8f813fad90 fix(core): use PageProps instead of FreshContext in define*() compat functions (#3064)
In Fresh 1, define apps used `RouteContext`, which align with
`PageProps` in Fresh 2, rather than `FreshContext`. E.g. before this PR,
one would get a type error if they tried to use `ctx.Component` within
`defineApp()` and now they shouldn't.
2025-06-27 09:54:53 +02:00
Marvin Hagemeister 0b6e62a693 chore: release 2.0.0-alpha.35 (#3062) 2025-06-26 15:53:15 +02:00
Josh Dales b338845c7f fix(init): only add tailwind to imports when selected (#3051)
If you don't install tailwind you shouldn't need the plugin, resolves
https://github.com/denoland/fresh/issues/3050
2025-06-19 19:55:05 +02:00
Asher GomezandMarvin Hagemeister 439ed1e5e5 chore(www): remove @deno/otel package (#3047)
This seems to be no longer needed thanks to
https://github.com/denoland/deno/pull/27541.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-06-18 11:22:02 +02:00
Asher Gomez 682368ba30 refactor(src): remove redundant coloring from createCodeFrame() (#3049)
`src/runtime/server/preact_hooks.tsx` is the only place that
`createCodeFrame()` is used which stripped the ANSI codes anyway.
2025-06-18 10:43:56 +02:00
Marvin Hagemeister 85d22e0bb0 fix(core): move to new esbuild deno plugin (#3034)
Move to the new esbuild plugin that leverages `@deno/loader` under the
hood. This is based on the exact same rust crates that Deno itself uses
to do resolution, instead of doing it's own resolution.
2025-06-18 10:42:47 +02:00
Asher Gomez c2b0fe3568 test(www): use @std/expect instead of @std/assert (#3046)
Aligns screenshot tests to the rest of the codebase by using
`@std/expect` instead of `@std/assert`.
2025-06-17 13:50:54 +02:00
75897de196 chore: add tests for fresh/compat imports (#3036)
- `fresh/compat - defineFn mixed return types` - Tests all supported
return types (Response, VNode, null) with both sync and async handlers,
including FreshContext parameter usage

- `fresh/compat - multiple compat imports` - Tests importing multiple
compat functions simultaneously

close #3025 

--patch-1
try to use deno/std Api to replace

--patch-2
make it simple and clean

--patch-3
Convert update_test.ts to .tsx for JSX support
Use static imports instead of dynamic imports for better performance
Switch from @std/assert to @std/expect for consistency
Use ReturnType<> for automatic type inference instead of manual type
definitions

Sincerely grateful to @iuioiua for the guidance and patience.

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2025-06-17 13:06:21 +02:00
Asher Gomez c3c79352b0 fix(core): refine HttpError.status property type (#2890)
As this is property only ever has an error HTTP status code (>400).
2025-06-16 17:57:49 +02:00
Asher Gomez 71b7de4581 fix(core): align defineFn() with previous definition (#3043)
https://github.com/denoland/fresh/blob/990357629e50ef123e5b5ee2b80c250be867534f/src/server/defines.ts#L13-L16

Closes #3042
2025-06-16 11:04:18 +02:00
Asher Gomez 71bec59820 chore: change patch Deno config file option to links (#3030)
Ref: https://github.com/denoland/deno/pull/29677
2025-06-14 09:55:06 +02:00
zhizhengand李嘉图·M·路 dd1721bce6 chore: refactor sreenshot and add test (#3032)
- Refactor screenshot functionality into testable utility functions
- Add comprehensive test suite to catch regressions early
- Ensure functionality doesn't break unexpectedly without notification

--patch-1
based on review, make throw error naturally

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
2025-06-13 20:39:10 +02:00
Asher Gomez e868a924fa fix(update): correct return and argument types for defineFn() (#3023)
Previously, the return union type of the inner function and the function
itself contained a `Request` instead of a `Response`.
2025-06-12 13:25:36 +02:00
zhizhengand李嘉图·M·路 e9cb6486c8 feat(update): use std lib to replace the custom processbar (#3027)
- The constructor of the process-bar in the currently used std/cli
differs from that of the latest version, so the relevant dependencies
have been updated.

- The custom processbar has been replaced with the std lib, and
customization has been carried out to meet the current scenario.

In test env, seem like: 

![bb2868ed3911071ce9915a9c8662786](https://github.com/user-attachments/assets/e4419965-40fc-4ad8-8647-74e30c75ea98)

close #3021

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
2025-06-12 12:32:09 +02:00