-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC: Leptos with Workers Assets #640
Conversation
42b08f9
to
489d870
Compare
489d870
to
11f00cc
Compare
Is Worker Assets an upcoming feature? Is there more info about it somewhere? |
@avsaase - shh. It's a secret 😄 - wait till later this week. |
Love it! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [worker](https://redirect.github.com/cloudflare/workers-rs) | workspace.dependencies | patch | `0.4.0` -> `0.4.1` | --- ### Release Notes <details> <summary>cloudflare/workers-rs (worker)</summary> ### [`v0.4.1`](https://redirect.github.com/cloudflare/workers-rs/releases/tag/v0.4.1) [Compare Source](https://redirect.github.com/cloudflare/workers-rs/compare/v0.4.0...v0.4.1) #### What's Changed - Add [template](https://redirect.github.com/cloudflare/workers-rs/tree/main/templates/leptos) for using [Leptos](https://leptos.dev/) with Workers Assets by [@​kflansburg](https://redirect.github.com/kflansburg) in [https://github.com/cloudflare/workers-rs/pull/640](https://redirect.github.com/cloudflare/workers-rs/pull/640) - Add API for [Rate Limiter](https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit/) bindings by [@​kflansburg](https://redirect.github.com/kflansburg) in [https://github.com/cloudflare/workers-rs/pull/603](https://redirect.github.com/cloudflare/workers-rs/pull/603) **Full Changelog**: cloudflare/workers-rs@v0.4.0...v0.4.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/spiraldb/vortex). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@kflansburg Thanks for this!
Btw, I had to change [build]
command = "cargo leptos build --release && LEPTOS_OUTPUT_NAME=start-axum worker-build --release --features ssr" to [build]
command = "cargo leptos build --release && worker-build --release --features ssr" to make it build on windows. but I set the env var |
Can you confirm that you are using the latest version of |
@kflansburg Yes, I literally just updated wrangler before running this. |
Ok, I did run into something like this, I don't know how you manage |
The environment variables were set incorrectly. The web browser wants "leptos_worker", but the pkg folder contains a "start-axum" file. So, changed output-name. #Cargo.toml
[package.metadata.leptos]
# The name used by wasm-bindgen/cargo-leptos for the JS/WASM bundle. Defaults to the crate name
output-name = "start-axum" Or, replace the LEPTOS_OUTPUT_NAME environment variable with leptos_worker. |
This introduces a
cargo generate
template for using Leptos with Workers Assets.Assets is not yet publicly available, but can be tested in local development.
cc @BrandonDyer64