codify "platform" into resolution logic, server-fn/fullstack overhaul (#4596)

overhaul dioxus fullstack using a new implementation of server_fn

This PR is a complete rewrite of dioxus fullstack designed to improve compatibility with axum and to fix a number of compilation errors based on feature flag unification plumbing through macros.
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-10-03 18:26:19 -07:00
1 parent 8421c3aef0
commit f2b1c6d97f
424 files changed
+17284 -6624

No files matched your search

@@ -11,7 +11,7 @@ dioxus = { workspace = true, features = ["web"] }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
[build-dependencies]
reqwest = { workspace = true, features = ["blocking"] }
flate2 = "1.1.2"
tar = "0.4.44"
# [build-dependencies]
# reqwest = { workspace = true, features = ["blocking"] }
# flate2 = "1.1.2"
# tar = "0.4.44"
@@ -1,16 +1,16 @@
use std::path::PathBuf;
fn main() {
// If the monaco editor folder doesn't exist, download it
let monaco_path = PathBuf::from("monaco-editor");
if monaco_path.exists() {
return;
}
// use std::path::PathBuf;
let url = "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz";
let bytes = reqwest::blocking::get(url).unwrap().bytes().unwrap();
let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(bytes.as_ref()));
let monaco_path_partial = PathBuf::from("partial-monaco-editor");
archive.unpack(&monaco_path_partial).unwrap();
std::fs::rename(monaco_path_partial, monaco_path).unwrap();
// // If the monaco editor folder doesn't exist, download it
// let monaco_path = PathBuf::from("monaco-editor");
// if monaco_path.exists() {
// return;
// }
// let url = "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.52.2.tgz";
// let bytes = reqwest::blocking::get(url).unwrap().bytes().unwrap();
// let mut archive = tar::Archive::new(flate2::read::GzDecoder::new(bytes.as_ref()));
// let monaco_path_partial = PathBuf::from("partial-monaco-editor");
// archive.unpack(&monaco_path_partial).unwrap();
// std::fs::rename(monaco_path_partial, monaco_path).unwrap();
}
@@ -2,7 +2,6 @@
use dioxus::prelude::*;
const MONACO_FOLDER: Asset = asset!("/monaco-editor/package/min/vs");
const SOME_IMAGE: Asset = asset!("/images/toasts.png", AssetOptions::image().with_avif());
const SOME_IMAGE_WITH_THE_SAME_URL: Asset =
asset!("/images/toasts.png", AssetOptions::image().with_jpg());
@@ -24,26 +23,29 @@ fn main() {
#[component]
fn App() -> Element {
let script = format!("(() => {{
require.config({{ paths: {{ vs: '{MONACO_FOLDER}' }} }});
// todo: test monaco more....
// const MONACO_FOLDER: Asset = asset!("/monaco-editor/package/min/vs");
// let script = format!("(() => {{
// require.config({{ paths: {{ vs: '{MONACO_FOLDER}' }} }});
// require(['vs/editor/editor.main'], () => {{
// var model = monaco.editor.createModel('fn main() {{\\n\\tprintln!(\\\"hi\\\")\\n}}', 'rust');
// var editor = monaco.editor.create(document.getElementById('editor'));
// editor.setModel(model);
// }})
// }})()");
require(['vs/editor/editor.main'], () => {{
var model = monaco.editor.createModel('fn main() {{\\n\\tprintln!(\\\"hi\\\")\\n}}', 'rust');
var editor = monaco.editor.create(document.getElementById('editor'));
editor.setModel(model);
}})
}})()");
rsx! {
div {
id: "editor",
width: "100vw",
height: "100vw",
}
// Monaco script
script {
src: "{MONACO_FOLDER}/loader.js",
"onload": script
}
// // Monaco script
// script {
// src: "{MONACO_FOLDER}/loader.js",
// "onload": script
// }
img {
id: "some_image",
src: "{SOME_IMAGE}"