Commit Graph
63 Commits
Author SHA1 Message Date
Marvin Hagemeister 6a41b7b194 chore: release 2.0.0-alpha.51 (#3166) 2025-08-01 10:15:22 +02:00
Marvin Hagemeister c08710f7dd chore: release 2.0.0-alpha.50 (#3160) 2025-07-31 09:31:35 +02:00
Marvin Hagemeister f87d2180fb chore: release 2.0.0-alpha.49 (#3156) 2025-07-30 15:20:36 +02:00
Marvin Hagemeister d8d19c4113 chore: release 2.0.0-alpha.48 (#3154) 2025-07-30 12:33:00 +02:00
Marvin Hagemeister d44dcdd60e chore: release 2.0.0-alpha.47 (#3152) 2025-07-30 09:10:08 +02:00
Marvin Hagemeister 76002fef0e chore: release 2.0.0-alpha.46 (#3134) 2025-07-25 08:40:06 +02:00
Marvin Hagemeister 85c17fac72 fix: nested index route not working in prod builds (#3132)
This was due to a mismatch in the disk snapshot compared to in memory.
2025-07-24 21:27:16 +02:00
Marvin Hagemeister ba1a1bc9c2 chore: release 2.0.0-alpha.45 (#3128)
This is done to pick up the latest tailwind version in `@fresh/init`
2025-07-24 16:21:30 +02:00
Marvin Hagemeister 211af4e3c8 fix(update): rewrite ctx.renderNotFound() (#3126)
Fixes https://github.com/denoland/fresh/issues/3026
2025-07-24 16:10:08 +02:00
Marvin Hagemeister 5903684d02 chore: release 2.0.0-alpha.44 (#3124) 2025-07-24 15:35:15 +02:00
Marvin Hagemeister 118242eaa6 major: build islands + scan routeDir without importing user code (#3122)
This fixes a bunch of long standing issues in our tracker where a build
wouldn't finish because of importing user code. It's common for backend
apps to spawn some open ended tasks like subscribing to Deno KV or other
things. This addresses another problem of having to set up ENV vars just
for the build, even though they are technically not required to build
islands.

This also gives a roughly ~30% performance boost on cold starts (at
least on `deno.com`). Unfortunately, this does require some breaking
changes. But I believe the performance improvements + removing the
footgun of loading user code during build is well worth it. This work is
also a precursor in case we want to exploring moving to vite at some
point in the future.

## Breaking changes

1. Build options have moved to the builder.
```diff
  // main.ts
- const app = new App({ build: { outDir: "dist/" } })
+ const app = new App()

  // dev.ts
- const builder = new Builder();
+ const builder = new Builder({ outDir: "dist/" });
```

2. Another breaking change is how file based routes are loaded. Since
they're prepared and loaded by the builder the API changed.

```diff
  // main.ts
  const app = new App()
    .use(staticFiles())
  
- await fsRoutes(app, {
-   loadIsland: (path) => import(`./islands/${path}`),
-   loadRoute: (path) => import(`./routes/${path}`),
- }); 
+ app.fsRoutes()
```
You can optionally change the `islandDir` or `routeDir` by passing that
to the `Builder`:

```ts
// dev.ts
const builder = new Builder({
  islandDir: "/path/to/islands", 
  routeDir: "/path/to/routes"
});
```

3. Import `app` lazily in `dev.ts`. Passing `app` to `builder.build()`
is not necessary anymore.

```diff
- import { app } from "./main.ts";

  const builder = new Builder({ target: "safari12" });
  
  if (Deno.args.includes("build")) {
-    await builder.build(app);
+    await builder.build();
  } else {
-   await builder.listen(app);
+   await builder.listen(() => import("./main.ts"));
  }
```

4. The production run command has changed. It's now using `deno serve`
```diff
  // deno.json
  {
    "tasks": {
      "dev": "deno run -A --watch=static/,routes/ dev.ts",
      "dev": "deno run -A dev.ts build",
-     "start": "deno run -A main.ts",
+     "start": "deno serve -A _fresh/server.js",
    }
  }
```
Remove this bit in `main.ts`:

```diff
  // main.ts
  
- if (import.meta.main) {
-   await app.listen()
- }
```

Fixes https://github.com/denoland/fresh/issues/2240
Fixes https://github.com/denoland/fresh/issues/2640
Fixes https://github.com/denoland/fresh/issues/2592
Fixes https://github.com/denoland/fresh/issues/1843
2025-07-24 15:04:05 +02:00
bb23643779 feat: support tailwindcss v4 (#3054)
update /www and tailwind-plugin to support tailwind v4.

Thanks to the merge of #3034, the work of integrating and advancing
#2903 is promoted.

related #3034 
related #2903 

close #3056
close #2819

--patch-1 
based on review,

1. del compiler and make it more clean and simple,
2.  fix init tailwind part,
3. fix test tailwind part

--patch-2

1. fix the docs 
2. fix the docs of plugin and version

--patch-3
1. Addressed various maintenance tasks (chores)
2. Updated the Tailwind CSS plugin to align with this release. Generated
a fresh project using the updated init configuration and
3. deployed it via Deno Deploy EA. Deployment is functioning correctly.

--patch-4
Move postcss imports to Tailwind section in init script

--patch-5
Refactored Tailwind plugin type definitions by copying PluginOptions
properties from @tailwindcss/postcss and adding Fresh-specific exclude
option, while exporting types from package entrypoint for better
accessibility.

Test Project: https://fresh.fresh-press.deno.net/
Test Project Repository:
https://github.com/SisyphusZheng/fresh-tailwindv4
Test Plugin: https://jsr.io/@freshpress/fresh-plugin-tailwind@1.0.0

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-07-21 16:13:34 +02:00
Marvin Hagemeister be253a3a70 chore: release 2.0.0-alpha.43 (#3117) 2025-07-19 12:32:27 +02:00
Marvin Hagemeister 41cf4ac64a chore: release 2.0.0-alpha.42 (#3114) 2025-07-18 22:41:56 +02:00
Marvin Hagemeister a66e0df08d chore: release 2.0.0-alpha.41 (#3107) 2025-07-17 15:37:02 +02:00
Marvin Hagemeister 9efaf0463e chore: release 2.0.0-alpha.40 (#3101) 2025-07-16 14:46:17 +02:00
Marvin Hagemeister 713c85c12d chore: release 2.0.0-alpha.39 (#3097) 2025-07-16 13:43:31 +02:00
Marvin Hagemeister ccb621d2a3 chore: release 2.0.0-alpha.38 (#3095) 2025-07-14 18:19:03 +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
Marvin Hagemeister ec2bb17589 chore: release 2.0.0-alpha.37 (#3074) 2025-07-02 12:48:11 +02:00
Marvin Hagemeister 67fd8ccd36 chore: release 2.0.0-alpha.36 (#3072) 2025-06-30 16:39:34 +02:00
Marvin Hagemeister 0b6e62a693 chore: release 2.0.0-alpha.35 (#3062) 2025-06-26 15:53:15 +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
zhizhengand李嘉图·M·路 133d4bcfb5 feat(update): delete fresh.gen.ts in @fresh/update (#3028)
delete fresh.gen.ts
close #3022
- before:

![8dd2fb246bc33b206b4f50f3d8f7439](https://github.com/user-attachments/assets/fa45af2f-0241-4ad7-9837-6b14364756ed)



- after:

![50b9512afcd0f522dada0ab3f3b4cc0](https://github.com/user-attachments/assets/56539c41-3ee5-4d3a-a1ac-5c64e5d008b0)

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
2025-06-12 12:30:46 +02:00
b2807b7720 feat(update): More logs for update script #2968 (#3010)
Before:

![340fffdbf558fa7a1bc1036972e0679](https://github.com/user-attachments/assets/e20e1c2f-1e1c-4477-82ee-231163d53085)

After:
Case1:

![1adc44294f2001dc43cd411254dfc2d](https://github.com/user-attachments/assets/e7bebd32-1083-4bc1-b00b-346c9ba66d43)
Case2:

![8cd3445877d5311ff8d9b9f66adb30e](https://github.com/user-attachments/assets/596ad777-6f6d-4b62-ae0e-32b82ebefb20)

In Test Env:

![df5b20de6d1437e471c6dcfc1e55178](https://github.com/user-attachments/assets/1eb53cdc-4398-4e61-874d-4c72e037e57f)

Close #2968

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-06-11 17:40:52 +02:00
zhizheng a85fdf18e2 fix(update): fresh/runtime import specifier updated incorrectly (#3009)
…ports

The original code is shown in the following figure, and there is an
incorrect usage in it.


![1749021630760](https://github.com/user-attachments/assets/2d603bdd-6dd7-4ddf-9dae-8d62b8bdaedf)
2025-06-04 19:24:48 +02:00
Marvin Hagemeister d5a2afd7ac fix(update): Update tasks + lock in deno.json (#2987)
Noticed that we don't update these.
2025-05-21 15:23:41 +02:00
Christian Svensson 17257dd1c2 test: use disposable tmp dirs (#2983)
Replaces the patterns below with consistent `AsyncDisposable` and `await
using` resource management for automatic cleanup.

- `await withTmpDir(async (dir) => { ... })` with `finally`
  - Makes code a bit flatter, and reduces callback-hell a bit
- `await Deno.makeTempDir()` + `Deno.remove()`
- `await Deno.makeTempDir()`

Helps be more consistent in removing temporary folders. Among others,
ensures temp folders are removed in the tests below:

- `src/build_cache_test.ts`
- `src/dev/builder_test.ts`
- `src/dev/dev_build_cache_test.ts`

## TODO's

The `Deno.makeTempDir()` method is still used by `buildProd` as well,
but this method is used in the top module scope, where it does not work
correctly with `Deno.test` (it runs before the test methods). I removed
this part from the PR and leave this for later to avoid making the PR
too big.

-
https://github.com/csvn/fresh/blob/test%2Fdisposable-tmp-dirs/tests/test_utils.tsx/#L64
-
https://github.com/csvn/fresh/blob/test%2Fdisposable-tmp-dirs/www/main_test.ts/#L7
2025-05-21 11:13:02 +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
Marvin Hagemeister 3900aa70d4 chore: release alpha 34 (#2967) 2025-05-16 21:36:12 +02:00
Marvin Hagemeister f8d390e2c3 chore: release alpha 33 (#2949) 2025-05-14 23:25:08 +02:00
Marvin Hagemeister 638a98b106 chore: release alpha 32 (#2947) 2025-05-14 23:05:22 +02:00
Marvin Hagemeister 74d5c0f98f chore: release alpha.31 (#2945) 2025-05-14 22:50:25 +02:00
Marvin Hagemeister c3095f38c4 chore: release 2.0.0-alpha.30 (#2939) 2025-05-14 10:55:47 +02:00
Asher Gomez 49a9c69d9e chore(update): remove unused maybePrependReqVar.ts (#2886) 2025-05-05 08:38:35 +02:00
Marvin Hagemeister 65c05b2127 2.0.0-alpha.29 (#2812) 2025-01-16 22:43:40 +01:00
Marvin Hagemeister c7c341b695 2.0.0-alpha.28 (#2810) 2025-01-16 14:24:07 +01:00
Luca Casonato 0864559562 2.0.0-alpha.27 (#2791) 2024-12-12 14:08:25 +01:00
Luca Casonato 03847e9a33 2.0.0-alpha.26 2024-12-10 16:05:22 +01:00
Luca Casonato 6ee4551df1 2.0.0-alpha.25 2024-11-08 12:08:56 +01:00
Luca Casonato 96e520a352 chore: release alpha.24 (#2745) 2024-10-31 11:31:51 +01:00
Marvin Hagemeister bf45e8652a chore: release alpha.23 (#2728) 2024-10-22 14:01:21 +02:00
Luca CasonatoandMarvin Hagemeister 407987589f feat: support fresh projects that are part of a workspace (#2716)
Also a performance improvement & bug fix in the tailwind plugin.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-10-17 17:08:24 +02:00
Marvin Hagemeister e303b873a6 chore: release 2.0.0-alpha.22 (#2685) 2024-10-04 10:32:02 +02:00
Marvin Hagemeister e0f65319cd chore: add license fields (#2666) 2024-09-30 18:45:51 +02:00
Marvin Hagemeister 39dbee5497 chore: release 2.0.0-alpha.21 (#2665) 2024-09-30 18:38:41 +02:00
Marvin Hagemeister 85c44d6460 chore: release alpha 20 (#2618) 2024-08-13 14:20:59 +02:00
Marvin Hagemeister 76af4114b7 chore: release alpha 19 (#2571) 2024-07-03 11:30:37 +02:00
Marvin Hagemeister bfb5753ecb chore: release alpha 18 (#2553) 2024-06-27 11:59:36 +02:00
Marvin Hagemeister fa22c60a4e chore: release 2.0.0-alpha.17 (#2549) 2024-06-26 11:29:54 +02:00