DioxusLabs / DioxusLabs/dioxus

Dioxus App with Workspaces

Open
#3,614 6 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

I am using the workspaces setup from the CLI. Instead of having all the dependencies in the workspace `Cargo.toml`, I have the server dependencies in the server workspace's `Cargo.toml`, the web dependencies in the web's `Cargo.toml` and the UI dependencies in the ui's `Cargo.toml`. I don't have the optional crates with dependencies true, as I expected the seperation of the workspaces to handle the workspace specific dependencies. I am getting a compilation error on `dx serve` however.

If this is not the expected behavior, are there any workspace examples out there? The docs all refer to the `Cargo.toml` singular, so its unclear in the workspace setup which `Cargo.toml` gets what piece.

**Steps To Reproduce**

Steps to reproduce the behavior:

setup a new project with the CLI
* Workspace
* fullstack: true
* router: true

add tokio and axum as dependencies in the server workspace `Cargo.toml`
```
tokio = { version = "1", features = ["full"] }
axum = "0.7.9"
```
dx serve from web

**Expected behavior**

I would expect the dependencies in the server workspace to only compile with the server, so the app should build normally.

**Environment:**
- Dioxus version: 0.6.1
- Rust version: 1.84.0 (stable)
- OS info: MacOS
- App platform: `web`

**Questionnaire**

I'm interested in fixing this myself but don't know where to start

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.