Commit Graph
40 Commits
Author SHA1 Message Date
Marvin Hagemeister f67ec8520f fix: render state not unique per render (#1638) 2023-08-16 16:30:16 +02:00
Marvin HagemeisterandReed von Redwitz b2362da281 www: Various documentation improvements (#1635)
Co-authored-by: Reed von Redwitz <reed+github@vonredwitz.com>
2023-08-16 16:24:53 +02:00
Marvin Hagemeister 726740ed39 feat: add helpers to make Fresh less TypeScripty (#1627) 2023-08-14 22:45:13 +02:00
Marvin Hagemeister 6436a43dce fix: rename layout config options (#1619) 2023-08-14 15:47:36 +02:00
Marvin HagemeisterandAsher Gomez ba67d895ce feat: support async app template (#1626)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-08-14 14:52:48 +02:00
Marvin Hagemeister 86f92114d8 feat: Support setting <html> in _app template (#1617) 2023-08-11 18:40:20 +02:00
Marvin Hagemeister 7ebaf0404d feat: allow layout and _app overrides (#1611) 2023-08-09 16:35:53 +00:00
Marvin HagemeisterandAsher Gomez 8325225a0d feat: support async layout functions (#1597)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-08-08 14:15:02 +02:00
Marvin HagemeisterandAsher Gomez 11077227b5 feat: support conditional island JSX children (#1355)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-08-08 11:35:28 +02:00
Marvin Hagemeister e4d797ae4e feat: add support for route groups (#1563) 2023-08-02 09:51:20 +02:00
Marvin Hagemeister d51ccdcf50 refactor: pre-sort all routes (#1562) 2023-08-01 13:06:35 +02:00
Michael GearhardtandMarvin Hagemeister 1ed93cec88 feat: support route layouts via _layout.tsx (#1506)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-07-26 11:49:08 +02:00
Marvin Hagemeister 71c0434f46 fix: allow string based event handlers in SSR (#1515) 2023-07-25 15:32:58 +02:00
jviideandMarvin Hagemeister ab45c5c42c fix: generate one Content-Security-Policy nonce per render (#1480)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-07-20 11:56:09 +02:00
Marvin Hagemeister 62a5613a46 feat: support async route components (#1388) 2023-07-12 21:09:56 +02:00
Marvin Hagemeister 17811dd593 feat: support Preact error boundaries (#1442) 2023-07-10 13:02:45 +02:00
Reed von Redwitz a3f7c212f4 feat(server): multiple island exports (#1397) 2023-07-03 09:59:38 +02:00
Reed von Redwitz 0db3a0911a feat: pass middleware state in props (#1264) 2023-06-28 14:53:42 +02:00
Marvin Hagemeister 80306563d2 fix: rendering islands inside other islands (#1295) 2023-06-15 17:55:17 +02:00
Marvin Hagemeister ce0eda7654 feat: allow passing JSX children to island + nested islands (#1285) 2023-06-15 10:08:48 +02:00
Marvin Hagemeister 5724b73e71 fix(ssr): invalid HTML comment tags (#1260) 2023-06-09 11:21:36 +02:00
Tom dd4e584a3e feat: async plugin rendering (#745)
An async render hook is added to plugins that enables injecting stylesheets and scripts based on the rendered HTML text.
2023-06-06 12:36:04 +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
ayame113 b51f83b42d fix: actually preload all necessary files (#1242) 2023-06-03 22:07:01 +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
ayame113andLuca Casonato 7b35cb07d4 feat: preloading JavaScript files (#1189)
close #1187

## points

- use `<link rel="modulepreload">` tag and `Link: rel="modulepreload"`
header to preload dependencies
- No preloading at all for pages that don't use JavaScript at all.
- Information about preloading is delivered only when the JS file has
already been built. If the JS file hasn't finished building, it will
respond without preload information instead of waiting for the build and
then returning the HTML.

## performance comparison

I've deployed this branch to https://fresh-module-preload.deno.dev/ so
you can try it out and see how it behaves.

When I accessed [fresh.deno.dev](https://fresh.deno.dev/) and
[fresh-module-preload.deno.dev](https://fresh-module-preload.deno.dev/)
20 times each and measured the DOMContentLoaded time, it was 24% faster
(157.3ms -> 118.95ms) in my environment (Nagano City, Japan).

<details>
<summary>Actual measured data</summary>

(Don't forget to check `Disable Cache` in devtools)

 | afeter (ms) | before (ms)
-- | -- | --
0 | 180 | 152
1 | 82 | 144
2 | 78 | 186
3 | 156 | 196
4 | 88 | 211
5 | 85 | 123
6 | 162 | 209
7 | 154 | 110
8 | 86 | 175
9 | 135 | 109
10 | 183 | 117
11 | 115 | 159
12 | 99 | 173
13 | 83 | 131
14 | 82 | 142
15 | 135 | 160
16 | 120 | 125
17 | 148 | 152
18 | 118 | 229
19 | 90 | 143
average | 118.95 | 157.3

</details>

## screen shots


![image](https://github.com/denoland/fresh/assets/40050810/c8f6d46b-77da-4e20-b29c-3b0219907872)


![image](https://github.com/denoland/fresh/assets/40050810/3159904c-07f0-45ee-a9ca-7bed35a292ca)

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-06-01 11:18:28 +10:00
kit b558b6e759 feat: add PageProps to _app (#1229) 2023-05-31 11:13:08 +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
OkadaGenya 9d13f6ff26 fix: sanitize <script> in __FRSH_STATE state (#739)
This commit escapes `<` `>` and related characters in the serialized state that is encoded into the `<script id=__FRSH_STATE>` tag. This prevents XSS attack occuring through injection of a `</script>` string in island props.
2022-09-12 17:33:02 +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
vwkd 995ad45735 chore: HTML meta tag charset property casing (#704)
Corrects strange casing of HTML meta tag charset property for cleaner
visual appearance.
2022-09-07 15:18:33 +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 56baffa96d feat: support suspending during SSR and useData (#27)
This commit adds support for suspending during JIT SSR rendering.
Additionally this PR adds `useData` support. This hook is triggered
during JIT render and can be used to fetch data. This data is sent to
the client and returned there from calls to useData too.
2021-06-11 13:59:55 +02:00
Luca Casonato 572b8123c4 refactor: centralize server into ServerContext (#26)
This commit centralizes all server related logic into a central
ServerContext class.
2021-06-10 20:46:10 +02:00
Luca Casonato 41307a5ac8 perf: add loading optimization with modulepreload (#15)
This commit aims to speed up loading of chunked modules using
the link rel=modulepreload directive.
2021-06-02 12:55:30 +02:00
Luca Casonato ff69a0abdf feat: add api routes (#11)
This commit adds API routes. These routes are located in the
./pages/api/ directory. Each file in there will have it's default
export invoked for HTTP calls to the corresponding route.
2021-06-02 00:15:00 +02:00
Luca Casonato 31dbd99bea chore: improve bundling + refactor router (#10)
This commit changes how bundling works, by bundling all routes at once.
Static JS assets are now cached immutably.

Additionally this PR completly refactors how the router works to make it
more modular. This allows users to opt out of the default oak server,
and instead create their own.
2021-06-01 23:19:33 +02:00
Luca Casonato 6ecdf2ed73 init 2021-05-08 02:07:24 +02:00