Commit Graph
518 Commits
Author SHA1 Message Date
Reed von RedwitzandAsher Gomez 673ed2d90f docs: add "Changing the source directory" example (#1286)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-15 11:37:41 +02:00
Reed von Redwitz f833c7262d docs: add "Server configuration" concept explanation (#1293) 2023-06-15 11:37:23 +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 372d0dfffb feat(init): add update task (#1290) 2023-06-14 15:48:52 +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
Asher Gomez adc16c5c29 docs: fix "Writing Tests" example title typo (#1288)
To align the casing with the rest of the documentation titles.
2023-06-14 14:57:37 +02:00
Asher Gomez 5ef6fa34d9 fix: use await Deno.serve().finished (#1287)
[A recent change in the
runtime](https://github.com/denoland/deno/pull/19485) has changed the
behaviour of `Deno.serve()` such that it throws when called a promise.
The correct way to do it is instead to call `Deno.serve().finished` as a
promise. This PR does that.

Fixes
https://github.com/denoland/fresh/pull/1286#issuecomment-1589987387
2023-06-14 08:23:51 +10:00
47c7f4ec9a feat: add "openai semantic search showcase. (#1259)
cc @lambtron @iuioiua

Co-authored-by: Andy Jiang <andyjiang@gmail.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: hashrock <hashrock@users.noreply.github.com>
2023-06-13 18:35:55 +10:00
Asher Gomez e3defa8e74 chore: remove www workflow (#1282)
This change removes the `www` workflow, simplifying CI to one workflow.
This is made more accessible, thanks to #1281. This also fixes PR
merging nits for when the affected files lie only within the `/www`
folder. E.g.
https://github.com/denoland/fresh/pull/1259#issuecomment-1586050738

The same checks in the `www` workflow are performed in the `ci`
workflow.
2023-06-13 18:30:20 +10:00
Octo8080XandAsher Gomez ac32c2deb6 docs: add "Writing Tests" example (#1223)
Fixes [#1222](https://github.com/denoland/fresh/issues/1222)


Add example implementation and documentation of test code using
`createHandler()` newly added by
[#622](https://github.com/denoland/fresh/pull/622)

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-13 07:37:12 +10:00
Marvin Hagemeister 9abd1c2396 chore(ci): run tests in parallel (#1281) 2023-06-12 15:53:13 +02:00
Marvin Hagemeister 45da639aa3 www: add discord icon + blog link (#1276) 2023-06-12 13:26:59 +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 d511283162 fix(www): show missing GA env warning once (#1272) 2023-06-12 09:44:31 +02:00
Tyler Mueller d3a2edc984 fix(init): Typo "Projet" -> "Project" (#1269) 2023-06-11 16:20:57 +00:00
Reed von Redwitz 931031f9ce docs: add "setting the language" example (#1265) 2023-06-11 02:38:25 +09:00
Marvin Hagemeister 503bdc384f feat(init): make directory argument optional (#1263) 2023-06-10 15:48:02 +02:00
Marvin Hagemeister 12bb00eae1 fix(search): work around inline click handler (#1267)
Preact, like most other popular frameworks disallows passing stringified
JavaScript code as event handlers. We have one occurrence of that in our
doc search. The recent addition of including `preact/debug` during
server rendering in #1256 surfaced this problem.

This PR works around that by injecting a tiny script tag that attaches
the event handler. Basically only a slightly different approach than
before.
2023-06-09 18:57:31 +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
Gabe 347e353357 chore: correct misspelled variable (#1258)
Renames `entires` to `entries`.
2023-06-09 15:26:36 +10: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
Igor Brasileiro 273aa2ac5c feat: break island render task into to multiple tasks (#1019)
Each island is now rendered in a separate task. This significantly reduces blocking time.
2023-06-07 12:32:16 +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
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
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
duffnandAsher Gomez 65e6385bc4 docs: add _ prefix to unused requests params (#1007)
- add types to handlers in the Getting Started section to align with the
examples in the Concepts section
- prefix unused arguments with `_` as suggested by official VSCode
plugin linting.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-05 15:01:53 +10:00
moonstripeandAsher Gomez 76ff7114cb docs: fix example folder names to be deno-fresh-demo (#582)
Figured it'd make sense to be consistent.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-05 14:43:37 +10:00
Luca Casonato 96be590a90 docs: improve examples and fix app wrapper (#1244) 2023-06-03 22:20:18 +02:00
ayame113 a724f6c591 www: fix accessibility issues (#1243)
Address accessibility issues pointed out by Lighthouse.
2023-06-03 22:19:40 +02:00
ayame113 b51f83b42d fix: actually preload all necessary files (#1242) 2023-06-03 22:07:01 +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
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
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
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
DanielXing1103andAsher Gomez 009b31f922 docs: add "Modifying the Head Element" example (#1226)
resolves #1215 by adding example on modifying ``` <Head />``` on
index.md

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2023-06-03 09:56:00 +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
kit b558b6e759 feat: add PageProps to _app (#1229) 2023-05-31 11:13:08 +00: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
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
Asher Gomez 8fc117d000 chore: upgrade to esbuild_deno_loader@0.7.0 (#1228) 2023-05-31 09:04:38 +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