Commit Graph
103 Commits
Author SHA1 Message Date
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
Steven YungandLuca Casonato 49092ed83a feat: add ctx.renderNotFound() to explicitly render 404 template (#481)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-08-09 19:23:17 +00:00
Kid bd45056893 refactor: clean up refresh script (#601) 2022-08-08 23:19:00 +02:00
AbdulazizandLuca Casonato 1dc1f87fc3 refactor: use named status codes from std internally (#417)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-07-30 15:35:31 +00:00
Luca Casonato ba20756c17 chore: update deps (#561)
Update std, esbuild, and preact.
2022-07-30 17:29:29 +02:00
Ikko Ashimine d396348625 chore: fix typo in context.ts (#533)
occured -> occurred
2022-07-30 15:10:15 +00:00
Makoto Tateno 0595f92ab8 fix: remove meta tag for IE (#545) 2022-07-30 15:05:10 +00:00
Manuel Trinidad 648f27aa2b fix: typo (#495) 2022-07-12 15:32:55 +02:00
Gustavo Henrique 10094f8947 feat: add error message for async components (#413) 2022-07-06 12:45:55 +02:00
Stephen Delaney a7b198fdf4 feat: support kebab-case filenames for islands (#404) 2022-07-06 12:42:25 +02: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 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
Kazuma Ohashi ace9b47a71 chore: fix typo in source code (#365) 2022-07-04 13:42:30 +00:00
Benjamin GeetsandLuca Casonato ef25682725 feat: allow lang configuration (#288)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-06-26 13:37:18 +02:00
Luca Casonato 74387ff92b fix: don't reload multiple times on restart (#283) 2022-06-24 14:50:00 +02:00
Carter Snook 53082f8052 chore: typo in doc comment (#268) 2022-06-22 12:03:04 +02:00
Luca Casonato da340daeb2 BREAKING: move a bunch of types into server/ (#263)
Moved some server only types like `RouteConfig` into server/. They were
previously in runtime/.
2022-06-21 15:21:07 +02:00
Luca Casonato 70d1838cad BREAKING: make render fn an option on start (#260)
This commit removes the `_render.{tj}s{x}?` file in favor of a `render` option on the `start` call in `main.ts`.
2022-06-20 13:40:23 +02:00
Luca Casonato cbbf616a74 chore: version preact explicitly in import map (#258)
This allows users to control the `preact` version independently of fresh
itself.
2022-06-20 12:37:24 +02:00
Luca Casonato 4bb07f4bce fix: throw on invalid island components (#224)
Previously island components that didn't have a default export were
just silently ignored.
2022-06-08 11:51:20 +02:00
Luca Casonato 458fe2ca3c fix: update browser targets
The minimum browser targets are updated to Chrome 99, Firefox 99, and
Safari 15.
2022-06-02 20:24:46 +02:00
Luca Casonato 80598d07fd feat: use import maps instead of deps files (#209)
This commit updates fresh to use import maps instead of deps files in generated projects.
2022-05-23 19:35:15 +02:00
Luca Casonato f9f0125282 chore: rename PageConfig to RouteConfig (#202) 2022-05-23 15:52:29 +02:00
Sylvain Cau e8b1e229b3 feat: automatically apply asset caching to img src and srcset (#184) 2022-05-19 19:19:59 +02:00
Luca Casonato c1a9d53b18 fix: improved etag handling in static files (#198) 2022-05-19 19:05:07 +02:00
Luca Casonato 637a0463b6 fix: update esbuild-wasm version 2022-05-17 01:48:05 +02:00
Luca Casonato 20ce3c6c2b chore: update esbuild to v0.14.39 (#194) 2022-05-17 01:20:07 +02:00
Luca Casonato cf438a7879 refactor: asset caching via query param (#192)
This updates the asset caching to use a cache busting query string,
rather than a totally separate path. This makes it safer to apply
caching automatically to things like `<img>` tags, as the path does not
change anymore.
2022-05-16 17:39:22 +00:00
Marc Espín c1e376a362 fix: remove conflicting global definition of URLPattern (#183) 2022-05-09 12:22:20 +02:00
Luca Casonato 98a3658452 chore: update router to 0.0.11 (#149) 2022-04-23 23:27:48 +02:00
Sylvain CauandLuca Casonato 8d4e77f4ac feat: layered and scoped middleware and context state (#139)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-04-23 22:07:40 +02:00
hashrock 9bb0366bed fix: use unpkg.com URL for esbuild.wasm (#158) 2022-04-23 20:00:20 +02:00
Elias SjögreenandLuca Casonato 34dc19a2f9 feat: support specifying hostname and port in start (#150)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-04-23 15:24:29 +02:00
ʀᴀʏ bb9fa4a09f feat: allow render function to be asynchronous (#142) 2022-04-23 15:17:00 +02:00
Tyler BrostromandLuca Casonato 4e1d4231f7 chore: update esbuild (#151)
Update esbuild to 14.34, and remove esbuild-wasm from vendored depedencies.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-04-23 15:01:45 +02:00
Sylvain Cau 6cbcc27646 feat: add support for static asset caching (#133) 2022-03-16 16:49:47 +01:00
Ohkubo KOHEI 8aa1b250b8 fix: routes/[...path] catches requests for _frsh/refresh.js (#130) 2022-03-13 20:36:21 +01:00
Leo Kettmeir 67b3eb470e feat: pass ConnInfo to various handler contexts (#121) 2022-03-09 19:16:08 +01:00
Bartek IwańczukandLuca Casonato 026ed86f40 feat: add nice error page during development (#122)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-03-07 21:05:19 +01:00
Tyler Brostrom 837d2a7f5e chore: remove unused runtimeJS option (#120) 2022-03-07 00:14:32 +01:00
Leo Kettmeir adfdec548a refactor: HandlerContext.match to HandlerContext.params (#118) 2022-03-06 20:27:02 +01:00
Leo Kettmeir cf48eafa9a BREAKING refactor: detach request from handler context (#114) 2022-03-06 18:25:50 +01:00
Luca Matei Pintilie 623e4b7605 chore: update dependencies (#112) 2022-03-06 13:33:18 +01:00
Luca Casonato fc25d2dfbf refactor: don't inline script if there are no islands (#101) 2022-03-05 01:44:35 +01:00
Luca Casonato 546223767b chore: update esbuild (#99) 2022-03-05 01:22:18 +01:00
Luca Casonato 4970663721 refactor: improved reviving of islands (#100) 2022-03-05 01:20:54 +01:00
Luca Casonato 8daa280862 feat: a new "island" based architechture (#97) 2022-03-04 19:49:27 +01:00
Leo Kettmeir d441bf2489 feat: add etag to static files (#95) 2022-03-03 14:18:29 +01:00
Leo KettmeirandLuca Casonato 04a32f3498 feat: _app (#87)
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-02-18 19:30:24 +01:00
Leo Kettmeir 15f73e3274 feat: render function returns string (#89) 2022-02-15 12:28:09 +01:00