Skip to content

Commit

Permalink
remove default platform feature in fullstack
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff committed Dec 12, 2024
1 parent 5f5d6f2 commit a2d1c32
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Bare-Bones/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
dioxus = { {{ dioxus_dep_src }}, features = {{dioxus_dep_features}} }

[features]
default = ["{{default_platform}}"]
default = [{% if is_fullstack == false -%}"{{default_platform}}"{%- endif %}]
{%- for feature in features %}
{{ feature }}
{%- endfor %}
6 changes: 6 additions & 0 deletions Bare-Bones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ npx tailwindcss -i ./input.css -o ./assets/tailwind.css --watch

Run the following command in the root of your project to start developing with the default platform:

{% if is_fullstack -%}
```bash
dx serve --platform {{default_platform}}
```
{%- else -%}
```bash
dx serve
```
{%- endif %}

To run for a different platform, use the `--platform platform` flag. E.g.
```bash
Expand Down
2 changes: 1 addition & 1 deletion Jumpstart/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
dioxus = { {{ dioxus_dep_src }}, features = {{dioxus_dep_features}} }

[features]
default = ["{{default_platform}}"]
default = [{% if is_fullstack == false -%}"{{default_platform}}"{%- endif %}]
{%- for feature in features %}
{{ feature }}
{%- endfor %}
6 changes: 6 additions & 0 deletions Jumpstart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,15 @@ npx tailwindcss -i ./input.css -o ./assets/styling/tailwind.css --watch

Run the following command in the root of your project to start developing with the default platform:

{% if is_fullstack -%}
```bash
dx serve --platform {{default_platform}}
```
{%- else -%}
```bash
dx serve
```
{%- endif %}

To run for a different platform, use the `--platform platform` flag. E.g.
```bash
Expand Down
2 changes: 1 addition & 1 deletion Workspace/desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] }
ui = { workspace = true }

[features]
default = ["desktop"]
default = [{% if is_fullstack == false -%}"desktop"{%- endif %}]
desktop = ["dioxus/desktop"]
{% if is_fullstack -%}
server = ["dioxus/server"]
Expand Down
2 changes: 1 addition & 1 deletion Workspace/mobile/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] }
ui = { workspace = true }

[features]
default = ["mobile"]
default = [{% if is_fullstack == false -%}"mobile"{%- endif %}]
mobile = ["dioxus/mobile"]
{% if is_fullstack -%}
server = ["dioxus/server"]
Expand Down
2 changes: 1 addition & 1 deletion Workspace/web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dioxus = { workspace = true, features = [{{- router_feature -}}] }
ui = { workspace = true }

[features]
default = ["web"]
default = [{% if is_fullstack == false -%}"web"{%- endif %}]
web = ["dioxus/web"]
{% if is_fullstack -%}
server = ["dioxus/server"]
Expand Down
2 changes: 1 addition & 1 deletion common.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ let platforms = [
"Desktop",
"Mobile"
];
let is_fullstack = variable::get(IS_FULLSTACK_VAR);

// Do we need a default platform?
if variable::get(NEEDS_DEFAULT_PLATFORM_VAR) {
Expand Down Expand Up @@ -64,7 +65,6 @@ if variable::get(NEEDS_DEFAULT_PLATFORM_VAR) {


let is_router = variable::get(IS_ROUTER_VAR);
let is_fullstack = variable::get(IS_FULLSTACK_VAR);
switch [is_router, is_fullstack] {
[true, true] => variable::set(DIOXUS_DEP_FEAT_VAR, "[\"router\", \"fullstack\"]"),
[true, false] => variable::set(DIOXUS_DEP_FEAT_VAR, "[\"router\"]"),
Expand Down

0 comments on commit a2d1c32

Please sign in to comment.