Commit Graph
73 Commits
Author SHA1 Message Date
Evan Almloff b7aea9653f fix server cached docs 2023-12-27 10:25:42 -06:00
Evan Almloff e2646e655e fix hydration after suspense 2023-12-27 10:17:18 -06:00
Evan Almloff df57cc7d9c fix disconnects that happen while a server function is being resolved 2023-12-07 08:29:14 -06:00
Jonathan Kelley 3b63791ec1 Merge pull request #1485 from ealmloff/make-fullstack-layer-public
Make the layer module public in fullstack
2023-12-06 21:34:38 -08:00
Jonathan Kelley ae8eaf80a2 Merge pull request #1612 from ealmloff/ssr-eval
Add a noop evaluator to the ssr renderer
2023-12-06 21:17:36 -08:00
Ben SullyandEvan Almloff 04fd2487b3 feat(fullstack): add render_handler_with_state (#1687)
* feat(fullstack): add `render_handler_with_state`

When using server functions, the current pattern to access state such as
database connections is to use `register_server_fns_with_handler` on an
Axum router and 'inject' the state into the context provided to the
server function. However, this only affects function calls which go via
the Axum router; SSR renders bypass this, and therefore don't have
access to any state.

This commit adds an alternative `render_handler` which accepts some
additional state. That state is injected into the context in a
similar manner to `register_server_fns_with_handler`. SSR renders can
then proceed to run in the same way as HTTP calls.

* Change state object to 'inject_state' callback

Also add a compiling doctest example.

* remove the explicit for<'a> lifetime

* remove unused assets_path from render_handler_with_context example

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-12-05 14:10:18 -06:00
XiaoZhang aa284d7e93 Fix grammar typo in comment (#1652) 2023-11-20 08:24:16 -06:00
Joshua Wolfe 8ea7f076e5 Updated server_fn to 0.5.2 (#1620) 2023-11-08 08:33:41 -06:00
Evan Almloff b9554fd744 add a noop evaluator to the ssr renderer 2023-11-05 08:32:39 -06:00
Evan Almloff d9b32afd64 add error message when overlapping fullstack features are enabled 2023-10-23 12:45:10 -05:00
Evan Almloff 3bf6d2d7cf add must use to several hooks 2023-10-14 12:08:54 -05:00
Evan Almloff d2f0f4b4b6 document layer and service 2023-09-25 12:25:21 -05:00
Evan Almloff d994e3e722 make the layer module public in fullstack 2023-09-23 07:57:41 -05:00
Leonard 07613c806b Fix #1367 (#1471)
* Bump cargo_toml to 1.16.0

* Format
2023-09-18 18:51:04 -05:00
Jonathan Kelley a7551d1e63 Merge branch 'master' into log-server-errors 2023-09-16 12:00:54 -07:00
Evan Almloff c55c17cb81 switch to tracing for logging 2023-09-06 17:47:33 -05:00
Dan LockandEvan Almloff 92a8669e14 Make launch functions pub (#1288)
* Make launch functions pub

* add docs to web, desktop, and server launch functions

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-08-09 11:26:50 -05:00
gmorenz 2a32271fa0 Set response headers from response, not request, parts (#1328) 2023-08-08 21:04:15 -05:00
Evan Almloff 65102b70c7 return more useful messages when a server function errors 2023-08-07 11:09:51 -07:00
Evan Almloff 97eedd22c5 fix fullstack docs building 2023-08-03 10:45:50 -07:00
Jonathan Kelley 59016007f2 Merge pull request #1251 from DioxusLabs/make-ssr-state-public
Make SsrState public
2023-07-31 17:37:35 -07:00
Jonathan Kelley e1dcc335c0 Merge pull request #1263 from Demonthos/builder-launch-fullstack
Switch to launch builder instead of macro for fullstack
2023-07-31 11:44:36 -07:00
Evan Almloff fcb993a2cb don't spawn a new runtime every request 2023-07-28 13:14:26 -07:00
Evan Almloff 9f891f9478 switch to launch builder instead of macro for fullstack 2023-07-28 12:58:34 -07:00
Evan Almloff d2ec27e761 fix clippy 2023-07-26 11:29:34 -07:00
Evan Almloff 5f0dd3af3e it almost lives? 2023-07-25 18:14:48 -07:00
Evan Almloff a4ed9bc0ef make ssrstate public 2023-07-25 15:29:40 -07:00
Miles MurgawandEvan Almloff 6210c6fefe Convert use_eval to use send/recv system (#1080)
* progress: reworked

don't run this, it'll kill your web browser

* feat: use_eval but with comms

* revision: async recv & recv_sync

* revision: use_eval

* revision: standard eval interface

* revision: use serde_json::Value instead of JsValue

* revision: docs

* revision: error message

* create: desktop eval (wip)

* fix: desktop eval

* revision: wrap use_eval in Rc<RefCell<_>>

* fix: fmt, clippy

* fix: desktop tests

* revision: change to channel system

- fixes clippy errors
- fixes playwright tests

* fix: tests

* fix: eval example

* fix: fmt

* fix: tests, desktop stuff

* fix: tests

* feat: drop handler

* fix: tests

* fix: rustfmt

* revision: web promise/callback system

* fix: recv error

* revision: IntoFuture, functionation

* fix: ci

* revision: playwright web

* remove: unescessary code

* remove dioxus-html from public examples

* prototype-patch

* fix web eval

* fix: rustfmt

* fix: CI

* make use_eval more efficient

* implement eval for liveview as well

* fix playwright tests

* fix clippy

* more clippy fixes

* fix clippy

* fix stack overflow

* fix desktop mock

* fix clippy

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-07-21 17:36:25 -05:00
Evan Almloff f3d1600822 fix clippy 2023-07-18 10:40:09 -07:00
Evan Almloff 8e54a89a74 fix use_server_future 2023-07-17 17:23:15 -07:00
Evan Almloff dd5d974aeb fix suspense 2023-07-17 16:48:54 -07:00
Evan Almloff b05fb16155 fix server_cached function 2023-07-17 09:48:35 -07:00
Evan Almloff 040b9d15a8 document from_server 2023-07-14 17:39:46 -07:00
Evan Almloff de72d85391 create server_cached function 2023-07-14 17:23:12 -07:00
Evan Almloff c6ddee6f21 remove the extract macro 2023-07-12 16:20:44 -06:00
Evan Almloff 831bcfd8e7 Fix warp fullstack adapter 2023-07-10 19:14:13 -05:00
Evan Almloff 0e83d48c04 Fix salvo fullstack builds 2023-07-10 18:48:55 -05:00
Evan Almloff 73a45fb113 fix incremental router cache 2023-07-08 12:22:54 -07:00
Evan Almloff d94316f7dd fix formatting 2023-07-08 11:03:16 -07:00
Evan Almloff 6a3198ef85 cargo fix axum 2023-07-08 10:58:04 -07:00
Evan Almloff 1e5c57dd16 cargo fix 2023-07-08 10:57:44 -07:00
Evan Almloff 27b0c2683b create auth example 2023-07-08 10:37:28 -07:00
Evan Almloff 453d087ed6 fix prop serialization 2023-07-08 09:13:24 -07:00
Evan Almloff f0d1346652 remove unsafe from fullstack and ssr 2023-07-07 19:15:25 -07:00
Evan Almloff 576bc61855 fix playwrite tests 2023-07-07 19:03:25 -07:00
Evan Almloff aa26c086de fix clippy 2023-07-07 18:41:22 -07:00
Evan Almloff 14883bb711 add server function middleware 2023-07-07 18:25:45 -07:00
Evan Almloff c49c75cb60 remove props compression 2023-07-07 11:08:27 -07:00
Evan Almloff 7597068af6 integrate extractors with the macro 2023-07-07 11:03:59 -07:00
Evan Almloff 4f6e6a7c0d add extractors to server-fn 2023-07-06 17:54:05 -07:00