100 Commits
Author SHA1 Message Date
Luca Casonato 86d6cdeb33 www: change domain to usefresh.dev (#3831) 2026-06-03 16:35:21 +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
Luca Casonato b4fd717c6c fix: reset span name and http.route in static file middleware (#2856) 2025-04-23 14:35:39 +02:00
Luca Casonato 0864559562 2.0.0-alpha.27 (#2791) 2024-12-12 14:08:25 +01:00
Luca Casonato ae9c675384 fix: correctly serialize negative numbers (#2790)
This commit fixes a bug where negative numbers were not correctly
serialized, because the value parser confused "references" (which is
where special negative tokens for special values exist), and "values"
(where negative numbers are just negative numbers). The parser now
correctly distinguishes between the two.
2024-12-11 20:13:22 +01:00
Luca Casonato 03847e9a33 2.0.0-alpha.26 2024-12-10 16:05:22 +01:00
Luca Casonato 65d61bd1d5 feat: add open telemetry instrumentation (#2786)
This commit adds some useful automatic instrumentation for when users
are using `--unstable-otel`:

- Fresh renames the span for incoming HTTP requests to `$METHOD $ROUTE`
and the `http.route` attribute is added.
- Fresh creates a span around FS route handlers, showing whether they
returned a response or data.
- Fresh creates a span around async components, showing how long they
took to execute.
- Fresh adds a span around preact rendering, showing how long rendering
takes.
- Fresh adds a span around static file serving, showing how long it took
and whether there were requests without a cache bust key.

We can improve this in the future with more telemetry, such as metrics.
2024-12-10 15:03:50 +01:00
Luca Casonato 4a25ac385f refactor: make this repo a Deno workspace (#2719) 2024-12-10 13:41:18 +01:00
Luca Casonato 6ee4551df1 2.0.0-alpha.25 2024-11-08 12:08:56 +01:00
Luca Casonato 6b685dde9f fix: serve internal JS from path containing build ID (#2753)
Previously imported chunks were not cached at all. They are now cached
properly with immutable cache headers.
2024-11-08 11:44:15 +01:00
Luca Casonato 96e520a352 chore: release alpha.24 (#2745) 2024-10-31 11:31:51 +01:00
Luca Casonato 8ced083267 fix: serialization of signals containing null and undefined values (#2744) 2024-10-31 11:22:03 +01: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
Luca CasonatoandMarvin Hagemeister 1f9fb91c4d fix: add proper cache control headers (#2617)
The whole point of `asset()` is to enable caching. Yet we were not
adding cache control headers... :D

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-08-13 14:15:25 +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
Luca Casonato aa19b393e7 feat: export compat types from /compat export (#2478) 2024-06-03 14:32:38 +00: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
Luca Casonato 584e5716c3 fix: init script (#2458) 2024-05-24 20:29:31 +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
Luca Casonato 4ab600e2a2 ci: only run lint and fmt on linux with Deno 1.x (#2386) 2024-03-25 16:01:55 +00: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
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
Luca Casonato 34c875c71c chore: update esbuild_deno_loader to 0.8.5 (#2273) 2024-01-23 21:52:30 +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
Luca Casonato 8583394481 fix: prototype pollution in deserializer (#2255)
This is not exploitable in practice unless a user maliciously crafts
serialized values in __FRSH_STATE, because `serializer()` never outputs
serialized representation that would be vulnerable to prototype
pollution. But hey, defense in depth.
2024-01-15 18:03:59 +00:00
Luca Casonato 795836ed29 tests: de-flake tests and re-enable sanitizers (#1786) 2023-09-18 11:09:24 +02:00
Luca Casonato 29966ad8bb feat: don't require connInfo in request handler (#1278) 2023-06-18 21:39:11 +02:00
Luca Casonato 1d606416a8 www: fix copy button (#1312) 2023-06-16 20:54:35 +02:00
Luca Casonato 1753ee8620 fix: remove duplicated esbuild imports (#1302)
This somehow snuck in during the src/build/ refactor.
2023-06-16 01:06:49 +02:00
Luca Casonato 94f5d38f3b www: actually link to 1.2 (#1301) 2023-06-15 21:35:48 +02:00
Luca Casonato 1faa80db59 fix: update script to work with non-embedded import maps (#1283)
The script now updates non-embedded import maps to embedded ones.
2023-06-14 14:57:49 +02:00
Luca Casonato bb48f7b8eb feat: limited npm: specifier support (#1245)
This commit adds limited support for `npm:` specifiers. Right now,
`npm:` specifiers are unsupported on Deno Deploy.

Towards #978
2023-06-06 17:41:29 +02:00
Luca Casonato da5d507b77 fix: remove top level <script> imports (#1246)
Instead, rely only on modulepreload for script preloading.
2023-06-05 18:21:08 +02:00
Luca Casonato 96be590a90 docs: improve examples and fix app wrapper (#1244) 2023-06-03 22:20:18 +02:00
Luca Casonato 94b23f30dd chore: improve init readme (#1238) 2023-06-03 21:15:39 +10:00
Luca Casonato 5c465e6f52 www: correctly use signals in <CopyArea> (#1239) 2023-06-03 13:10:46 +02:00
Luca Casonato 3857a49f1c chore: clean up esbuild builder logic (#1231)
This will allow us to add various caches and similar around the esbuild
builder easily in follow up PRs.

It also makes doing an AOT build-step + load assets from disk much
simpler.
2023-06-03 10:24:15 +02:00
Luca Casonato 4e001d5199 fix: buildIdPlugin breaks when Fresh is hosted (#1230)
Only file:// URLs were supported previously, which breaks if you are
importing Fresh via HTTPS URLs.
2023-05-31 10:04:58 +00:00
Luca Casonato 38e67b0a97 feat: support passing Uint8Array as island props (#1225)
This commit adds support for passing Uint8Array's to islands in
component props.
2023-05-31 08:34:57 +00:00
Luca Casonato e3f9a0df08 feat: support passing signals as island props (#757)
This commit adds support for passing signals to islands in component
props. This is useful for passing around mutable state between islands.
The signal's value needs to be serializable for this to work.
2023-05-31 10:29:46 +02:00
Luca Casonato a6852fa58f feat: more advanced prop serializer for islands (#1224)
This commit adds support for an advanced (de)serializer that is used
for page state (island props and plugin state). This new serializer
supports maintaining references (thus supporting circular objects,
and multi-referenced objects).

This is a pre-requisite for allowing to pass signals, JSX, Uint8Arrays,
Date, and many other "advanced" values.
2023-05-31 10:12:07 +02:00
Luca Casonato 96ba036c12 fix: better HEAD handling with less special casing (#1206)
We now add a default HEAD handler to the server, rather than special
casing HEAD requests elsewhere. Static files now get their own optimized
HEAD handler that does not read the file contents.
2023-05-30 17:22:18 +10:00
Luca CasonatoandAsher Gomez 87b087e358 fix: __FRSH_BUILD_ID is not defined (#1207)
This could happen if the runtime/utils.ts coe was loaded
prior to server/constants.ts, because they had some shared state on
`globalThis`.

I have mitigated this by not relying on global state anymore.

Fixes #1191

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-30 10:46:44 +10:00
Luca CasonatoandAsher Gomez f95f7586f5 fix: don't change scheme on redirect (#1024)
Fixes #1015

This scenario can happen when a user has a proxy sitting in front of
Fresh, that does TLS termination, while Fresh is running on plain text
HTTP.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-25 18:40:40 +10:00
6feac0d2d8 fix(server): obfuscated deployment id in build id (#1168)
Co-authored-by: John Pope <88814278+innovatedev-john-pope@users.noreply.github.com>

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-05-13 11:09:21 +02:00
Luca CasonatoandJohn Pope 96b89d2a05 fix: cleanup pathname with multiple trailing slashes (#1167)
Co-authored-by: John Pope <88814278+innovatedev-john-pope@users.noreply.github.com>
2023-05-12 17:34:45 +02:00
Luca Casonato c291db8ac4 www: add search button island (#949) 2022-12-23 04:19:50 +09:00
Luca Casonatoandhashrock 3355ea9fe5 docs: add page showcasing fresh charts (#839)
Co-authored-by: hashrock <hashrock@users.noreply.github.com>
2022-11-17 15:13:39 +09:00
Luca Casonato 885d71d823 fix: always use wasm content type for esbuild (#868) 2022-10-27 21:00:03 +02:00
Luca Casonato cdf0c11f65 1.1.2 2022-10-11 09:23:34 +00:00
Luca Casonato 9ee03e09bb fix: twind style generation in islands (#830)
Fixes #778
2022-10-11 11:15:12 +02:00
Luca Casonato f2cc43df64 www: add vertification for google search console (#802) 2022-09-27 00:18:28 +02:00
Luca Casonato eb712124de 1.1.1 2022-09-12 17:39:12 +02:00
Luca Casonato b75509526d docs: add -r to command in concepts>updating (#763) 2022-09-12 15:27:47 +02:00
Luca Casonato 7a08b73afe chore: update preact + preact-render-to-string (#762)
preact: 10.11.0
preact-render-to-string: 5.2.4
2022-09-12 14:53:32 +02:00
Luca Casonato 92213f2c04 fix: ship source maps for client code in dev mode (#756) 2022-09-12 13:53:53 +02:00
Luca Casonato 4e001f9e26 www: add HelloBar to point to 1.1 release notes (#724) 2022-09-08 16:57:35 +02:00
Luca Casonato a08f12a647 docs: add plugins to TOC (#723) 2022-09-08 13:34:05 +00:00
Luca Casonato dc47c9387b fix: rm trailing / in preact-rts import map entry (#722) 2022-09-08 12:45:21 +00:00
Luca Casonato e71a0c23aa 1.1.0 2022-09-08 14:08:14 +02:00
Luca Casonato ca6d011d5c www: fix @preact/signals version (#720) 2022-09-08 10:03:57 +00:00
Luca Casonato 4862152936 docs: add stacked middleware docs 2022-09-08 11:53:38 +02:00
Luca Casonato 560f1eec20 docs: add "Concepts: Updating" page 2022-09-08 11:53:38 +02:00
Luca Casonato a54ffdcaf2 docs: update minimum version to 1.25.0 2022-09-08 11:53:38 +02:00
Luca Casonato 77142fe4a0 docs: remove JSX pragma everywhere 2022-09-08 11:53:38 +02:00
Luca Casonato 6c4f3a36d0 docs: add plugin docs (#702) 2022-09-08 11:39:45 +02:00
Luca Casonato b7f0d5c860 feat: install @preact/signals by default (#710) 2022-09-08 01:00:05 +02:00
Luca Casonato ee8812d7f6 chore: tweak console output for init.ts script (#708) 2022-09-07 15:28:38 +02:00
Luca Casonato 01052b31aa chore: update preact-render-to-string (#707) 2022-09-07 15:06:24 +02:00
Luca Casonato b19c4bb041 feat: add update.ts script (#706)
This commit adds an update.ts tool that makes it easy to upgrade
existing Fresh projects to the latest version of Fresh. This tool
updates dependency versions in the import map, and includes some code
mods:

1. update projects from classic JSX to automatic JSX
2. update projects from legacy twind integration to twind plugin

Both of these code mods get you about 95% of the way there most of the
time. Users might still need to do some manual work to get their
projects fully updated.
2022-09-07 09:36:23 +00:00
Luca CasonatoandElias Sjögreen 1b3c9f2569 fix(plugin/twind): load configuration as module (#705)
This commit loads the Twind configuration as an actual module rather
than evaluating it on the server and then serializing. This allows usage
of unserializable plugin functions.

Co-authored-by: Elias Sjögreen <eliassjogreen1@gmail.com>
2022-09-07 00:44:46 +02:00
Luca CasonatoandLino Le Van 0cc3cc7762 docs: add "Deployment" concepts page (#680)
Add docs for deploying using Docker (in addition to Deno Deploy).

Co-authored-by: Lino Le Van <11367844+lino-levan@users.noreply.github.com>
2022-08-31 13:24:36 +02:00
Luca Casonato 6ec04ea0f2 build: remove canary special case in CI (#654) 2022-08-31 12:35:29 +02:00
Luca Casonato 6077bb65b7 chore: correct code comment (#679) 2022-08-31 12:25:21 +02:00
Luca Casonato b12867a582 feat: support JSX automatic mode (#610)
This commit adds support for JSX automatic mode instead of the default
mode that requires the presence of the JSX pragma in each file.

This commit also adds the config file to the `fresh.gen.ts` manifest,
which is used to determine if the client emit should use automatic mode.

The minimum Deno version has also been bumped to 1.25.0.
2022-08-26 11:03:00 +02:00
Luca Casonato bbe4277acb chore: update puppeteer (#659) 2022-08-25 15:26:44 +02:00
Luca Casonato 3d682d98cb chore: update preact & preact-render-to-string (#651)
preact@10.10.6 & preact-render-to-string@5.2.2
2022-08-23 22:09:06 +00:00
Luca Casonato 3cc6d6da72 docs: add frontmatter to concepts/static-files.md (#650) 2022-08-23 22:05:52 +00:00
Luca Casonato 027f3f8bba chore: fix ci (#645) 2022-08-23 11:25:03 +00:00
Luca Casonato 7b0c190454 docs: export route config in routing chapter (#604) 2022-08-09 19:48:23 +00:00
Luca Casonato 660e0f5fef feat: twind plugin (#513)
This adds a first-party twind plugin to use twind for styling.
2022-08-09 21:41:11 +02:00
Luca Casonato fd4e2bbe17 feat: add initial plugin support (#512)
This commit adds initial support for fresh "plugins". These are bundles
of functionality that can be added to a fresh plugin through a simple
addition in the `main.ts` file.

Right now plugins are only able to hook into the render steps. This
means that they can inject styling and scripts. They can not yet hook
into routing.

Things that I think should be possible now:
- styling integrations for twind, unocss, and probably a few other tools

Things that are not possible yet:
- google analytics middleware
- database connectors
- CMS connectors

The routing additions to plugins can be added in a follow-up though.
2022-08-09 21:27:58 +02:00
Luca Casonato e1226c54e7 1.0.2 2022-07-31 21:16:42 +00:00
Luca Casonato ba20756c17 chore: update deps (#561)
Update std, esbuild, and preact.
2022-07-30 17:29:29 +02:00
Luca Casonato b39608890e chore: run deno fmt with new deno version (#562) 2022-07-30 14:59:35 +00:00
Luca Casonato 07c0bfa68b chore: format with stable, not canary (#510) 2022-07-15 14:28:08 +00:00
Luca Casonato 03aa58df87 fix: prevent folks messing with the fresh manifest (#435)
I am looking at you James.
2022-07-05 19:35:03 +00:00
Luca Casonato ae9b8aa6b3 1.0.1 2022-07-04 17:28:22 +02:00
Luca Casonato 87da68b8a7 chore: update preact + twind (#410) 2022-07-04 15:25:32 +00:00
Luca Casonato e0e669ef3d tests: fix hanging tests locally (#408)
Also add a test for --vscode for the init script.
2022-07-04 15:16:49 +00:00
Luca Casonato aab8ceb78b fix: layered middleware not working for index page (#407)
This commit fixes layered middleware not being invoked for the the index
page of the layer.

For example: routes/api/_middleware.ts was not being invoked for /api,
only /api/foobar
2022-07-04 15:13:49 +00:00
Luca Casonato 9871980613 docs: remove handler functions link (#400) 2022-07-04 10:52:42 +00:00
Luca Casonato 989e1775a0 docs: fix formatting 2022-06-28 16:15:24 +02:00
Luca Casonato b69ba3b718 docs: remove styling page 2022-06-28 16:14:10 +02:00
Luca Casonato 8488bf6373 docs: remove route handlers page 2022-06-28 16:06:15 +02:00
Luca Casonato ba94e8aaec 1.0.0 2022-06-28 15:52:37 +02:00