Skip to content

Commit

Permalink
don't re-export launch in the prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
ealmloff committed Sep 16, 2024
1 parent d4afc24 commit 9c964b7
Show file tree
Hide file tree
Showing 109 changed files with 124 additions and 128 deletions.
2 changes: 1 addition & 1 deletion example-projects/ecommerce-site/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ mod components {
mod api;

fn main() {
launch(|| {
dioxus::launch(|| {
rsx! {
head::Link {
rel: "stylesheet",
Expand Down
2 changes: 1 addition & 1 deletion example-projects/file-explorer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use dioxus::desktop::{Config, WindowBuilder};
use dioxus::prelude::*;

fn main() {
LaunchBuilder::desktop()
dioxus::LaunchBuilder::desktop()
.with_cfg(Config::new().with_window(WindowBuilder::new().with_resizable(true)))
.launch(app)
}
Expand Down
2 changes: 1 addition & 1 deletion example-projects/fullstack-hackernews/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {
#[cfg(feature = "server")]
tracing_subscriber::fmt::init();

launch(|| rsx! { Router::<Route> {} });
dioxus::launch(|| rsx! { Router::<Route> {} });
}

#[derive(Clone, Routable)]
Expand Down
2 changes: 1 addition & 1 deletion example-projects/wifi-scanner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use dioxus::prelude::*;
use wifiscanner::Wifi;

fn main() {
launch(app)
dioxus::launch(app)
}

fn perform_scan() -> Status {
Expand Down
2 changes: 1 addition & 1 deletion examples/all_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{collections::VecDeque, fmt::Debug, rc::Rc};
const STYLE: &str = asset!("./examples/assets/events.css");

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/backgrounded_futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use async_std::task::sleep;
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/calculator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/calculator.css");

fn main() {
LaunchBuilder::desktop()
dioxus::LaunchBuilder::desktop()
.with_cfg(desktop!({
use dioxus::desktop::{Config, LogicalSize, WindowBuilder};
Config::new().with_window(
Expand Down
2 changes: 1 addition & 1 deletion examples/calculator_mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dioxus::html::MouseEvent;
use dioxus::prelude::*;

fn main() {
LaunchBuilder::desktop()
dioxus::LaunchBuilder::desktop()
.with_cfg(
Config::new().with_window(
WindowBuilder::new()
Expand Down
2 changes: 1 addition & 1 deletion examples/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use web_time::Instant;
const STYLE: &str = asset!("./examples/assets/clock.css");

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/control_focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/roulette.css");

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/counters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/counter.css");

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/crm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use dioxus::prelude::*;

fn main() {
LaunchBuilder::new()
dioxus::LaunchBuilder::new()
.with_cfg(desktop!({
use dioxus::desktop::{LogicalSize, WindowBuilder};
dioxus::desktop::Config::default()
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static ASSET_PATH: &str = "examples/assets/logo.png";
static ASSET_PATH: &str = asset!("examples/assets/logo.png".format(ImageType::Avif));

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use dioxus::prelude::*;

fn main() {
LaunchBuilder::new()
dioxus::LaunchBuilder::new()
.with_cfg(
dioxus::desktop::Config::new().with_custom_index(
r#"
Expand Down
4 changes: 2 additions & 2 deletions examples/custom_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ fn main() {
// Create a desktop config that overrides the default menu with the custom menu
let config = dioxus::desktop::Config::new().with_menu(menu);

// Launch the app with the custom menu
LaunchBuilder::new().with_cfg(config).launch(app)
//dioxus::launch the app with the custom menu
dioxus::LaunchBuilder::new().with_cfg(config).launch(app)
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/disabled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/dog_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dioxus::prelude::*;
use std::collections::HashMap;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/custom_assets.css");

fn main() {
LaunchBuilder::desktop().launch(app);
dioxus::LaunchBuilder::desktop().launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use dioxus::prelude::*;

fn main() {
launch(|| rsx! { Router::<Route> {} });
dioxus::launch(|| rsx! { Router::<Route> {} });
}

/// You can use an ErrorBoundary to catch errors in children and display a warning
Expand Down
2 changes: 1 addition & 1 deletion examples/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use async_std::task::sleep;
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/file_upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dioxus::{html::HasFileData, prelude::dioxus_elements::FileEngine};
const STYLE: &str = asset!("./examples/assets/file_upload.css");

fn main() {
launch(app);
dioxus::launch(app);
}

struct UploadedFile {
Expand Down
2 changes: 1 addition & 1 deletion examples/flat_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/flat_router.css");

fn main() {
launch(|| {
dioxus::launch(|| {
rsx! {
head::Link { rel: "stylesheet", href: STYLE }
Router::<Route> {}
Expand Down
2 changes: 1 addition & 1 deletion examples/form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use dioxus::prelude::*;
use std::collections::HashMap;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/fullstack-desktop/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fn main() {
// Set the url of the server where server functions are hosted.
#[cfg(not(feature = "server"))]
dioxus::fullstack::prelude::server_fn::client::set_server_url("http://127.0.0.1:8080");
launch(app);
dioxus::launch(app);
}

pub fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/fullstack-hello-world/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ fn main() {
#[cfg(feature = "server")]
tracing_subscriber::fmt::init();

launch(app);
dioxus::launch(app);
}
2 changes: 1 addition & 1 deletion examples/fullstack-router/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use dioxus::prelude::*;

fn main() {
LaunchBuilder::fullstack()
dioxus::LaunchBuilder::fullstack()
.with_cfg(server_only!(ServeConfig::builder().incremental(
IncrementalRendererConfig::default()
.invalidate_after(std::time::Duration::from_secs(120)),
Expand Down
2 changes: 1 addition & 1 deletion examples/fullstack-streaming/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ pub async fn test_stream() -> Result<TextStream, ServerFnError> {
}

fn main() {
launch(app)
dioxus::launch(app)
}
2 changes: 1 addition & 1 deletion examples/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use async_std::task::sleep;
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/generic_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use dioxus::prelude::*;
use std::fmt::Display;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static COUNT: GlobalSignal<i32> = Signal::global(|| 0);
static DOUBLED_COUNT: GlobalMemo<i32> = Memo::global(|| COUNT() * 2);

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/hash_fragment_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use dioxus::prelude::*;
use serde::{Deserialize, Serialize};

fn main() {
launch(|| {
dioxus::launch(|| {
rsx! {
Router::<Route> {}
}
Expand Down
8 changes: 4 additions & 4 deletions examples/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
//!
//! In this example we:
//! - import a number of important items from the prelude (launch, Element, rsx, div, etc.)
//! - define a main function that calls the launch function with our app function
//! - define a main function that calls thedioxus::launch function with our app function
//! - define an app function that returns a div element with the text "Hello, world!"
//!
//! The `launch` function is the entry point for all Dioxus apps. It takes a function that returns an Element. This function
//! calls "launch" on the currently-configured renderer you have. So if the `web` feature is enabled, it will launch a web
//! app, and if the `desktop` feature is enabled, it will launch a desktop app.
//! calls "launch" on the currently-configured renderer you have. So if the `web` feature is enabled, it willdioxus::launch a web
//! app, and if the `desktop` feature is enabled, it willdioxus::launch a desktop app.

use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
4 changes: 2 additions & 2 deletions examples/hydration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use dioxus::desktop::Config;
use dioxus::prelude::*;

fn main() {
LaunchBuilder::desktop()
dioxus::LaunchBuilder::desktop()
.with_cfg(Config::new().with_prerendered({
// We build the dom a first time, then pre-render it to HTML
let pre_rendered_dom = VirtualDom::prebuilt(app);

// We then launch the app with the pre-rendered HTML
// We thendioxus::launch the app with the pre-rendered HTML
dioxus_ssr::pre_render(&pre_rendered_dom)
}))
.launch(app)
Expand Down
2 changes: 1 addition & 1 deletion examples/image_generator_openai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use serde_json::{json, Error};

fn main() {
launch(app)
dioxus::launch(app)
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use dioxus::prelude::*;
const STYLE: &str = asset!("./examples/assets/links.css");

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/login_form.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/memo_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use dioxus::prelude::*;

fn main() {
tracing_subscriber::fmt::init();
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/mobile_demo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn main() -> Result<()> {

// Right now we're going through dioxus-desktop but we'd like to go through dioxus-mobile
// That will seed the index.html with some fixes that prevent the page from scrolling/zooming etc
LaunchBuilder::mobile()
dioxus::LaunchBuilder::mobile()
.with_cfg(
// Note that we have to disable the viewport goofiness of the browser.
// Dioxus_mobile should do this for us
Expand Down
2 changes: 1 addition & 1 deletion examples/multiwindow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use dioxus::prelude::*;

fn main() {
LaunchBuilder::desktop().launch(app);
dioxus::LaunchBuilder::desktop().launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/nested_listeners.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
2 changes: 1 addition & 1 deletion examples/optional_props.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use dioxus::prelude::*;

fn main() {
launch(app);
dioxus::launch(app);
}

fn app() -> Element {
Expand Down
Loading

0 comments on commit 9c964b7

Please sign in to comment.