Commit Graph
141 Commits
Author SHA1 Message Date
Marvin Hagemeister ae3db58a99 fix(vite): .env files not being loaded (#3416)
Fixes https://github.com/denoland/fresh/issues/3364
2025-09-12 18:21:51 +02:00
Marvin Hagemeister fb341e4ab7 chore: release 2.0.0 (#3371) 2025-09-09 18:52:36 +02:00
Marvin Hagemeister 79d8cfc3ed docs: make 2.x the default version (#3369) 2025-09-09 14:36:51 +02:00
Marvin Hagemeister 6e9f586c54 chore: release 2.0.0-beta.5 and @fresh/plugin-vite@0.10.2 (#3365)
Fixes https://github.com/denoland/fresh/issues/3363
2025-09-08 22:07:49 +02:00
Marvin Hagemeister 4c3ff9b74d chore: fix demo tasks (#3354) 2025-09-08 15:43:07 +02:00
Marvin Hagemeister e21d6742d2 chore: add demo tasks (#3332) 2025-09-03 18:52:19 +02:00
Marvin Hagemeister fd2ebc63c5 fix(init): setup vite/client types on init (#3327)
Note that this also requires
https://github.com/denoland/deno/issues/30560 to work. That will be
released in either Deno `2.4.6` or `2.5.0` depending on which one comes
first.

Fixes https://github.com/denoland/fresh/issues/3319
2025-09-03 12:02:52 +02:00
Marvin Hagemeister ff9db336f7 feat(vite): check valid imports per environment (#3299)
Fixes https://github.com/denoland/fresh/issues/3296
2025-09-01 17:30:30 +02:00
Marvin Hagemeister 70bcac298c chore: add @types/node to silence LSP warning (#3293) 2025-09-01 12:15:48 +02:00
Marvin Hagemeister 541bc6c6ca feat(vite): support remote islands (#3294) 2025-09-01 12:11:08 +02:00
Marvin Hagemeister e3b429ac9d chore: ignore tests publish (#3291) 2025-09-01 08:53:51 +02:00
Marvin Hagemeister 7a3c1a0c84 fix: exclude test files during publish (#3289)
Properly addresses https://github.com/denoland/fresh/pull/3288
2025-09-01 08:46:35 +02:00
Marvin Hagemeister 37a5d991a7 chore: exclude tests from publish (#3288) 2025-09-01 08:32:24 +02:00
Marvin Hagemeister 4fe0199c9f www: port fresh.deno.dev to vite (#3227)
This PR ports fresh.deno.dev to use our vite plugin.
2025-08-29 16:41:16 +02:00
Marvin Hagemeister b41c151de3 fix(vite): serve css imported in islands (#3272)
Fixes https://github.com/denoland/fresh/issues/3271
2025-08-29 14:30:00 +02:00
Marvin Hagemeister 1daca75489 feat: bring back <Head> component (#3249)
This PR brings back the `<Head>` component from Fresh 1.x . The
implementation is much cleaner than back then and also works client-side
now too.
2025-08-25 15:40:47 +02:00
Marvin Hagemeister 59549c9532 fix(vite): npm resolution + cjs + duplicated preact signals (#3211) 2025-08-16 19:26:39 +02:00
Marvin Hagemeister 477fcefed4 feat: support inlining FRESH_PUBLIC_ env vars (#3214)
Fixes https://github.com/denoland/fresh/issues/3213
2025-08-12 12:00:59 +02:00
Marvin Hagemeister 815b1940e3 chore: restructure repository into packages/ folder (#3197)
We're having a growing number of packages in this repository. This PR
moves them into a `packages/` directory like it's commonly done in other
projects.
2025-08-06 15:52:45 +02:00
Marvin Hagemeister f35338b75f chore: release 2.0.0-alpha.56 (#3195) 2025-08-06 13:01:02 +02:00
Marvin Hagemeister 83036d87ee fix: extract build-id into seperate package to fix publishing (#3194)
Also makes it easier to replace during bundling.
2025-08-06 12:53:50 +02:00
Marvin Hagemeister ba2e01fec0 chore: release 2.0.0-alpha.55 (#3193) 2025-08-06 12:23:47 +02:00
Marvin Hagemeister 36aa9b5639 feat: add vite plugin (#3187)
Second attempt after we had to revert
https://github.com/denoland/fresh/pull/3185
2025-08-06 12:13:22 +02:00
Marvin Hagemeister d108b2c182 chore: release 2.0.0-alpha.54 (#3192) 2025-08-05 16:04:40 +02:00
Marvin Hagemeister a6a16dbd18 fix: unable to load json inside npm packages (#3191) 2025-08-05 16:00:58 +02:00
Marvin Hagemeister c2a5812644 chore: release 2.0.0-alpha.53 (#3190) 2025-08-05 15:00:35 +02:00
Marvin Hagemeister 2f76a0a2aa Revert "feat: Add experimental vite plugin (#3184)" (#3185)
This reverts commit a1571b76ed.

It broke fresh.deno.dev :S
2025-08-04 18:54:04 +02:00
Marvin Hagemeister a1571b76ed feat: Add experimental vite plugin (#3184)
This PR adds a vite plugin for Fresh. This enables:

- HMR (only for islands for now)
- self-contained output bundles for both server and client
- smarter chunking

It uses vite's new Environment API under the hood.
2025-08-04 18:30:05 +02:00
Marvin Hagemeister 03f6981860 fix: serialized compute signals re-created as normal signals (#3183)
Fixes https://github.com/denoland/fresh/issues/3182
2025-08-03 20:31:36 +02:00
Marvin Hagemeister a472f0c3c6 chore: release 2.0.0-alpha.52 (#3172) 2025-08-01 14:31:35 +02:00
Marvin Hagemeister 6e287e1201 fix: wasm recurse error esbuild plugin (#3169) 2025-08-01 14:25:43 +02:00
Marvin Hagemeister 6a41b7b194 chore: release 2.0.0-alpha.51 (#3166) 2025-08-01 10:15:22 +02:00
Marvin Hagemeister 1cecb372a6 chore: update @deno/esbuild-plugin (#3164)
It contains a few good bug fixes as it doesn't rely on entrypoints
anymore.
2025-08-01 09:05:32 +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 ff34ec8342 chore: lift dependency to deno.json + update esbuild (#3142) 2025-07-25 19:01:28 +02:00
Marvin Hagemeister d573622a40 feat: add separate tailwindcss v3 plugin (#3135)
Makes it easier to keep using tailwindcss v3 with newer Fresh versions.
2025-07-25 10:27:22 +02:00
Marvin Hagemeister 76002fef0e chore: release 2.0.0-alpha.46 (#3134) 2025-07-25 08:40:06 +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