- Enhanced error messages for better clarity when server functions do not meet the expected return type requirements.
- Added `trybuild` tests to ensure behaviour is not broken in future releases.
* fix(CI): pre-install tailwind and sass
* chore: retrigger CI
* fix(CI): properly set `erased_mode` in examples
* fix(CI): workflow logic install deps locally
* chore(CI): organized tailwind and sass versions
* fix: properly ignore nightly features on stable rustc
* fix(CI): typo
* fix: missing cfg attr
* fix: properly gate nightly module in `reactive_graph``
* fix: complete `rustc_nightly` cfg gate
* fix(CI): making even more space for CI workers
* fix: missing one more rustc_nightly gated feature
* fix: maximize the speed of cargo-all-features by limiting combinations to 2
integrations/actix
leptos/server
oco
server_fn
This is a defensive PR - Putting the crate definition into the root
workspcace makes it less likely to get difficult to trace version
slip bugs.
This does not help where sede_json is optional so care manual review
is required.
* Minor: "wasm-bindgen" - Moved the crate definition up to the root workspace
This synchronizes the version number amongst all sub-projects.
[Where the definition is "optional" manual adjustment is still required]
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Allow disabling server fn hash and customizing the default prefix
Allow configuring the default prefix for server function API routes. This is useful to
override the default prefix (`/api`) for all server functions without needing to manually
specify via `#[server(prefix = "...")]` on every server function.
Also, allow disabling appending the server functions' hashes to the end of their API names.
This is useful when an app's client side needs a stable server API. For example, shipping
the CSR WASM binary in a Tauri app. Tauri app releases are dependent on each platform's
distribution method (e.g., the Apple App Store or the Google Play Store), which typically
are much slower than the frequency at which a website can be updated. In addition, it's
common for users to not have the latest app version installed. In these cases, the CSR WASM
app would need to be able to continue calling the backend server function API, so the API
path needs to be consistent and not have a hash appended.
* Mark public structs as `#[non_exhaustive]` and add doc comments
* Minor refactor to pull the fn hash logic out of the `path` statement
* feat: Use module path in prefix for server fn API route
Allow including the module path of the server function in the API route. This
is an alternative strategy to prevent duplicate server function API routes
(the default strategy is to add a hash to the end of the route). Each element
of the module path will be separated by a `/`. For example, a server function
with a fully qualified name of `parent:🧒:server_fn` would have an API
route of `/api/parent/child/server_fn` (possibly with a different prefix and
a hash suffix depending on the values of the other server fn configs).
* Fix `enable_hash` if statement
* Add missing import
* fix: remove examples and benchmarks from dependabot search path
* chore: update/upgrade deps to prevent dependabot PR pollution at first
run
* fix: increase number of pull requests from dependabot as the workspace
is pretty big
* fix: revert rkyv version as it was unexpectedly downgraded
* fix: tower in example
* feat: WIP wasi integrations crate
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(server_fn): add generic types
This commit adds `From` implementations for the
`Req` and `Res` types using abstraction that are deemed
"platform-agnostic".
Indeed, both the `http` and `bytes` crates contains types
that allows us to represent HTTP Request and Response,
while being capable to target unconventional platforms
(they even have `no-std` support). This allows the
server_fn functions to target new platforms,
for example, the `wasm32-wasip*` targets.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(server_fn): generic types cleanup
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(integrations/wasi): make WASI a first-class citizen of leptos server-side
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* WIP: chore(any_spawner): make the futures::Executor runable
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* fix(server_fn): include `generic` in axum.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(any_spawner): some clippy suggestions
I ran clippy in really annoying mode since I am still
learning Rust and I want to write clean idiomatic code.
I took suggestions that I thought made sense, if any
maintainers think those are *too much*, I can relax
those changes:
* Use `core` instead of `std` to ease migration to `no_std`
(https://rust-lang.github.io/rust-clippy/master/index.html#/std_instead_of_core)
* Add documentation on exported types and statics
* Bring some types in, with `use`
* Add `#[non_exhaustive]` on types we are not sure we
won't extend (https://rust-lang.github.io/rust-clippy/master/index.html#exhaustive_enums)
* Add `#[inline]` to help the compiler when doing
cross-crate compilation and Link-Time optimization
is not enabled. (https://rust-lang.github.io/rust-clippy/master/index.html#/missing_inline_in_public_items)
* Use generic types instead of anonymous `impl` params
so callers can use the `::<>` turbofish syntax (https://rust-lang.github.io/rust-clippy/master/index.html#/impl_trait_in_params)
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(leptos_wasi): fine-tune linter and clean-up
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(leptos_wasi): better handling of server fn with form
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: cargo fmt
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: remove custom clippy
Remove clippy crate rules since it
seems to make tests fails in tests.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: use `wasi` crate
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: revert changes to any_spawner
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: simpler crate features + cleanup
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(any_spawner): add local custom executor
This commit adds a single-thread "local"
custom executor, which is useful for environments
like `wasm32` targets.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(leptos_wasi): async runtime
This commit adds a single-threaded
async runtime for `wasm32-wasip*`
targets.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* feat(leptos_wasi): error handling
This commit adds error types for the users
to implement better error handling.
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: migrate integration off-tree
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(ci): fix formatting
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore: remove ref to leptos_wasi in Cargo.toml
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(ci): fix fmt
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(ci): remove explicit into_inter()
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
* chore(ci): make generic mutually exclusive with other options
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>
---------
Signed-off-by: Enzo "raskyld" Nocera <enzo@nocera.eu>