75 Commits
Author SHA1 Message Date
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
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
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
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
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
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
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
Asher GomezandMarvin Hagemeister da8879dede tests: use the same browser instance across tests and better use explicit resource management (#2901)
On my machine, reduces time taken to perform `deno task test` from
~1m20s to ~30s.

Inspired by and supersedes #2110.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-05-21 11:32:18 +02:00
Asher Gomez b8c75ec0e3 chore: update dependencies (#2975)
Updates relating to Tailwind CSS v4 can be handled in #2903 or #2829.
2025-05-19 13:17:53 +02:00
Asher Gomez 144ed2e75c refactor(core): minor fresh/compat cleanups (#2880) 2025-05-19 12:05:22 +02:00
Asher Gomez 8953650420 refactor(init): tidy up check task (#2976) 2025-05-19 11:04:52 +02:00
Asher Gomez cc93a1f469 tests(init): remove MockTTY (#2974)
These changes simplify implementation logic of the init workflow and
mock `prompt()` and `console()` functionality in a more direct manner.
This makes things easier to reason about by jumping through fewer mental
hoops.
2025-05-19 10:56:16 +02:00
Asher Gomez 3776ef3154 refactor: centralise imports and cleanup exports (#2900)
The benefits of these changes are:
1. Managing and updating dependencies is easier. One only needs to run
`deno outdated` at the root, instead of in each workspace.
2. The versions of dependencies across workspaces is kept consistent.

Closes #2788
2025-05-19 09:41:06 +02:00
Asher Gomez 20162f6896 chore: use lint tags (#2952) 2025-05-15 09:34:46 +02:00
Asher Gomez 7728e1cb52 chore(core): simplify tasks (#2892) 2025-05-14 13:27:13 +02:00
Asher Gomez 84a03ee66c chore(init): cleanup twind options (#2868)
These values are no longer used.
2025-05-12 23:29:17 +02:00
Asher Gomez 8ea3dbeac5 refactor(www): use useSignal() instead of useState() (#2894) 2025-05-12 23:28:46 +02:00
Asher Gomez 54d18d8bca tests: fix leaks, macOS hangs and utility cleanups (#2897)
1. Upgrades `@astral/astral`
2. Fixes test leaks
3. Fixes `@fresh/init` test hangs
4. Simplifies and cleans up test utilities
2025-05-07 10:53:42 +02:00
Asher Gomez cea7a2a821 chore: update screenshot task script (#2881) 2025-05-05 08:42:09 +02:00
Asher Gomez e0ca9423d9 BREAKING(core): remove Mode type (#2884)
It doesn't seem like it deserves to be it's own type. It can just be an
interface property.
2025-05-05 08:40:34 +02:00
Asher Gomez 49a9c69d9e chore(update): remove unused maybePrependReqVar.ts (#2886) 2025-05-05 08:38:35 +02:00
Asher Gomez 45ce7e3ac0 chore: add doc checker (#2877)
First steps towards #2876
Depends on https://github.com/denoland/std/pull/6632
2025-05-02 10:55:55 +02:00
Asher Gomez 51e4d334af refactor(core): remove unused constants (#2872) 2025-04-30 10:32:19 +02:00
Asher Gomez b582c57e57 refactor(core): use getSnapshotPath() (#2873) 2025-04-30 10:31:47 +02:00
Asher Gomez cfa7fdc6b9 tests: minor cleanups of tests/precompile_test.ts (#2870)
A tiny lesson that `URL` and `import.meta` can be used instead of
`@std/path`. Also, might fix CI thanks to `deno.lock` being updated.
2025-04-29 08:10:17 +02:00
Asher Gomez d077130b05 refactor(init): avoid network request for downloading of favicon (#2867) 2025-04-28 15:10:03 +02:00
Asher Gomez 7aec5a268e refactor(core): standardize HttpError (#2858)
- Now extends `Error`, so that it satisfies `instanceof Error`
operations.
- Narrows the `status` property to be an actual HTTP status code.
- Outsources default evaluation of the `message` property to
`@std/http/status`, which already implements this functionality.
- Brings the `stack` property to the class, regardless of its status,
which seems like a needless constraint.
2025-04-27 20:01:31 +02:00
Asher Gomez 5876ca7752 chore: remove prettyTime() (#2859)
This isn't used anywhere.
2025-04-27 19:59:07 +02:00
Asher Gomez b8f1be76fc docs: contributing guidelines (#2860)
Outdated and needs work but will suffice.
2025-04-27 19:58:00 +02:00
Asher Gomez 149509995e fix(init): define working directory in check task for init script (#2852)
~~This fixes CI for current PRs until
https://github.com/denoland/deno/pull/28655 is added to Deno 2.3.0.~~

This fixes CI until https://github.com/denoland/deno/issues/28923 is
fixed. Then, we can use `Deno.makeTempDir()` and not have to use
`tmp_*/`.
2025-04-22 13:17:05 +02:00
Asher Gomez 0ca7568f54 chore: @std/* dependencies (#2488)
Mainly done to get release candidates in use.
2024-06-04 09:38:24 +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
Asher Gomez 99eb5435bb refactor: use --env CLI arg (#2204)
This change replaces the use of the Standard Library's `dotenv.load()`
with the native `--env` CLI flag.

The benefits include:
* One less dependency
* More obvious consumption of the `.env` file in the CLI output
2023-12-29 10:47:15 +01:00
Asher Gomez 6ddef91d95 refactor: replace references of options with config (#1903) 2023-10-11 09:25:03 +02:00
Asher Gomez d5659a41ac fix: flaky doesn't leak data across renderers test (#1901)
Using `createHandler()` is simpler than starting a server and fetching a
page. `createHandler()` avoids unnecessary network requests, which can
be flaky when you only need to analyse parts of the returned request. I
think we should push for more use of `createHandler()` and only start a
server as a last resort.

This closes #1896, or rather the particular test mentioned there, but
other tests involving TCP connections can still occur. Again, their
remedy is to use `createHandler()` instead of starting a server.
2023-10-11 10:04:33 +11:00
Asher Gomez 6ce39b8cee refactor: use manifest variable name (#1902)
Previously, the `routes` variable name was used. This change makes more
sense as the variable has the `Manifest` type.
2023-10-11 10:03:08 +11:00
Asher Gomez 500336e97d chore: synchronize CI and local tests (#1894) 2023-10-10 11:35:04 +02:00
Asher Gomez 2bb17981c3 refactor: simplify www test (#1895) 2023-10-10 11:34:21 +02:00
Asher Gomez 88985fe933 chore: update Deno KV OAuth plugin and docs (#1826)
These changes aim to improve the clarity and understandability of the
Deno KV OAuth plugin. It also updates to use the latest version of the
module.
2023-09-28 08:05:53 +00:00
Asher Gomez d9829e25e6 ci: run on latest stable version of Deno (#1820)
This PR changes CI to include the latest stable version of Deno,
alongside canary. This is important for picking up bugs in canary. This
seems like a reasonable thing to have for overall stability.

Possible prerequisite for #1819
2023-09-27 09:34:50 +02:00
Asher Gomez 8ebb94bf59 refactor: simplified Deno KV OAuth plugin (#1808) 2023-09-25 18:35:46 +10:00
Asher Gomez 06fac31e6b docs(www): update hello bar for Fresh 1.4 (#1653) 2023-08-17 05:30:03 +02:00
Asher Gomez 76f0f4a84a chore: deno task ok (#1573) 2023-08-04 12:01:38 +02:00
Asher Gomez 6a9dd4adb7 chore(CI): parallel tests (#1583)
Let's give this a few tries and see if we can weed out the root causes.
2023-08-03 09:46:57 +02:00
Asher Gomez 4849d1abb5 chore: format on save (#1584)
I feel as though this is a reasonable default to have. This eliminates
one more thing that a contributor must remember to do before submitting
a PR.
2023-08-03 07:45:08 +00:00
Asher Gomez 71fc1b8efc chore(CI): combine install Chrome jobs (#1557) 2023-08-02 14:07:02 +02:00
Asher Gomez 62f5d3a492 chore(CI): remove redundant steps (#1569)
`deno task check:types` and `deno test -A` take care of everything.
2023-08-02 17:54:11 +10:00
Asher Gomez 4b28e2e269 chore(CI): rework lighthouse action (#1570) 2023-08-02 09:49:53 +02:00
Asher Gomez 5e78224f49 chore(CI): fix and simplify caching (#1571) 2023-08-02 09:44:42 +02:00
Asher Gomez ecb718b6a7 chore(CI): make formatting same across platforms (#1575) 2023-08-02 09:43:28 +02:00
Asher Gomez 0b96db4bae fix: async route typing (#1510) 2023-07-24 08:22:48 +00:00
Asher Gomez d0b277a135 docs: add "Contributing" section (#1233) 2023-06-18 13:42:23 +02:00
Asher Gomez a4f7172807 docs: fix Signal type typo (#1304) 2023-06-16 10:32:20 +02:00
Asher Gomez adc16c5c29 docs: fix "Writing Tests" example title typo (#1288)
To align the casing with the rest of the documentation titles.
2023-06-14 14:57:37 +02:00
Asher Gomez 5ef6fa34d9 fix: use await Deno.serve().finished (#1287)
[A recent change in the
runtime](https://github.com/denoland/deno/pull/19485) has changed the
behaviour of `Deno.serve()` such that it throws when called a promise.
The correct way to do it is instead to call `Deno.serve().finished` as a
promise. This PR does that.

Fixes
https://github.com/denoland/fresh/pull/1286#issuecomment-1589987387
2023-06-14 08:23:51 +10:00
Asher Gomez e3defa8e74 chore: remove www workflow (#1282)
This change removes the `www` workflow, simplifying CI to one workflow.
This is made more accessible, thanks to #1281. This also fixes PR
merging nits for when the affected files lie only within the `/www`
folder. E.g.
https://github.com/denoland/fresh/pull/1259#issuecomment-1586050738

The same checks in the `www` workflow are performed in the `ci`
workflow.
2023-06-13 18:30:20 +10:00
Asher GomezandLuca Casonato 1b6678951a feat: support embedded import map in deno.json (#1188)
One can now inline the `imports` and `scopes` from the import map directly into deno.json.

For new projects, `import_map.json` is not generated anymore.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-06-03 10:46:40 +02:00
Asher Gomez 02dec2f483 chore: upgrade preact-render-to-string to 6.0.3 (#1236) 2023-06-02 16:24:14 +02:00
Asher Gomez 8fa4141e06 refactor: replace useState() with useSignal() (#1234) 2023-06-02 06:43:01 +10:00
Asher Gomez 8fc117d000 chore: upgrade to esbuild_deno_loader@0.7.0 (#1228) 2023-05-31 09:04:38 +00:00
Asher Gomezandhashrock c172a70181 docs: add new "Examples" section (#1221)
It's currently empty, but this sets up future Fresh examples.

Closes #1204
Moves towards #1211

---------

Co-authored-by: hashrock <hashrock@users.noreply.github.com>
2023-05-31 09:19:06 +10:00
Asher Gomez b5532aeb69 feat: island sub-directories (#1185) 2023-05-31 05:29:56 +10:00
Asher Gomez 8347eadbef refactor: move counter example to top-level (#1219) 2023-05-30 19:51:16 +02:00
Asher Gomez e0cb693c0f chore(deps): update to std@0.189.0 (#1201) 2023-05-27 17:36:15 +10:00
Asher Gomez 366c8afef1 chore: update versions.json for 1.1.6 (#1200)
I missed this in the 1.1.6 release. My bad - lesson learnt.
2023-05-24 17:40:29 +10:00
Asher Gomez 98636ec8a0 doc: API reference link in README (#1197) 2023-05-23 19:35:17 +10:00
Asher Gomez 24c38e49e8 refactor: simplify www task (#1190) 2023-05-19 14:21:50 +10:00
Asher Gomez 8db73e0485 refactor: disable lock (#1186) 2023-05-18 21:20:48 +10:00
Asher Gomez 1f04d01297 chore(ci): enable Deno v1.x (#1179) 2023-05-17 14:00:41 +10:00
Asher Gomez 0b8e01e38e chore(ci): disable fail-fast (#1180) 2023-05-17 13:59:59 +10:00
Asher Gomez 87536502d8 chore(ci): dependabot for GitHub actions (#1181) 2023-05-17 13:59:20 +10:00
Asher Gomez 570da5172f www: add Deno SaaSKit to showcase (#1105) 2023-04-07 17:45:24 +09:00