Commit Graph
141 Commits
Author SHA1 Message Date
Marvin Hagemeister 124c597112 chore: remove stray console.log in tests (#1351) 2023-06-23 13:41:31 +00:00
Reed von Redwitz 03dbbd4f8e fix: update script supports deno.jsonc files (#1349) 2023-06-23 14:26:22 +02:00
Marvin Hagemeister 76d838cf10 chore: add index layout to island tests (#1340) 2023-06-22 16:23:05 +02:00
arrow2nd ab461cd71d fix: update.ts fails when there is no islands directory (#1327) 2023-06-21 19:11:50 +02:00
Marvin Hagemeister 3a83c5974d chore: simplify folder tests (#1337) 2023-06-21 14:02:25 +02:00
Marvin Hagemeister 87b15885aa feat(starter): add 404 page template (#1336) 2023-06-21 11:01:48 +02:00
Luca Casonato 29966ad8bb feat: don't require connInfo in request handler (#1278) 2023-06-18 21:39:11 +02:00
Marvin Hagemeister ea6a74237d feat: improve starter template design (#1320) 2023-06-17 20:31:08 +02:00
Kamil Ogórek d5a8692b78 feat: Allow passing props to renderNotFound method (#1310) 2023-06-16 17:12:01 +02:00
Reed von Redwitz f5f8928c89 feat(server): trailing slash configuration (#1291) 2023-06-15 19:01:07 +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 36d56a9878 feat(server): pick free port if none specified (#1274) 2023-06-12 13:18:52 +02:00
Marvin Hagemeister 69f4fecf5a feat(server): make startup message easier to see (#1273) 2023-06-12 10:42:17 +02:00
Marvin Hagemeister 48de711df4 chore(tests): don't cancel child process stream (#1262) 2023-06-09 13:44:11 +02:00
Marvin Hagemeister 894f56b9c9 chore(tests): use to spin up server (#1261) 2023-06-09 11:27:56 +02:00
Marvin Hagemeister 5724b73e71 fix(ssr): invalid HTML comment tags (#1260) 2023-06-09 11:21:36 +02:00
Marvin HagemeisterandAsher Gomez be08573a95 feat(debug): show rendering issues during SSR (#1256)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-08 08:53:14 +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
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
Marvin Hagemeister cd760b90d4 chore(test): extract shared start server code (#1250)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-06-05 18:52:22 +02:00
Savin Angel-MarioandAsher Gomez 6e1874ccca feat: use PORT environment variable to change port (#468)
This can be useful when deploying to other providers.

Also more convenient for projects with multiple developers with port
preferences

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-05 09:08:46 +02:00
ayame113 b51f83b42d fix: actually preload all necessary files (#1242) 2023-06-03 22:07:01 +02: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
Lino Le VanandAsher Gomez 736c5524d5 chore: upgrade preact to 10.15.1 and std to 0.190.0 (#1237)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-03 10:04:23 +10: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
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
Khang Nguyen DuyandLuca Casonato a49e2d04e3 feat: remove hardcoded deno.json path (#1208)
`deno.json` files can now be placed in a parent directory of the file
containing `fresh.gen.ts`.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-05-31 12:02:28 +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
Leo Kettmeir 060e2bb50d feat: add status and headers overwrite for HandlerContext.render (#725) 2023-05-31 10:09:53 +02:00
Asher Gomez b5532aeb69 feat: island sub-directories (#1185) 2023-05-31 05:29:56 +10: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
Asher Gomez e0cb693c0f chore(deps): update to std@0.189.0 (#1201) 2023-05-27 17:36:15 +10:00
7f3fd51cca Optimise images size (#1101)
Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
Co-authored-by: Jheyson Saavedra <hello@jheysaav.me>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-25 19:45:01 +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
azerum 1a456444e4 add test case covering islands that return null (#1203)
Just a small addition to my previous PR. It wasn't obvious for me that
PR #1172 also fixed #1129. I guess that issue should be covered by a
separate test
2023-05-25 09:40:49 +10:00
Kamil OgórekandAsher Gomez e86a126c0a feat(server): Allow for custom HEAD method implementations (#1175)
Fixes https://github.com/denoland/fresh/issues/1115
Fixes https://github.com/denoland/fresh/issues/1165

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-25 08:55:09 +10:00
azerumandAsher Gomez 7d23ed5984 fix: conditionally rendered element under fragment in island does not render (#1172)
This might be fixing #502, but I am not sure. All tests pass. I've added
additional test cases for comments from #502

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-23 12:24:05 +10:00
Asher Gomez 8db73e0485 refactor: disable lock (#1186) 2023-05-18 21:20:48 +10:00
CemandAsher Gomez 114c4dbfab dotenv option (#740)
added dotenv option to read environment variables files

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-05-17 09:48:39 +10: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
Marvin Hagemeister f481c1a03f fix: superfluous dir message when dir === cwd (#1138) 2023-04-30 10:41:42 +02:00
Marvin HagemeisterandLuca Casonato c224db7cb7 chore: update for deno 1.33.x (#1139)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-30 10:30:30 +02:00
Leo Kettmeir 9dd026e0f5 feat: add middleware destination (#1123)
Closes #521
2023-04-20 13:14:12 +02:00
Yoshiya Hinosawa eed9f0ef05 chore: fix ci (#1102) 2023-04-04 14:13:21 +09:00
hashrock 673c161aee test: island with wasm-esbuild (#1082) 2023-03-21 19:55:59 +09:00
Lino Le Van 7b036f0af8 chore: bump deps and update copyright year (#1069) 2023-03-21 18:56:30 +09:00
y3km21 7f2ec612b2 fix: hydrate in twind-v1-plugin (#1050) 2023-03-13 01:31:41 +09:00