Giter Site home page Giter Site logo

docsite's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docsite's Issues

Consider reversing the order of the Release Notes on the front page

Hiya! Was looking at the Dioxus website, as one does, and noticed this:
image
I'd normally expect the more recent post to be first, and this might lead to people glancing over the rest of the list and ignoring newer posts.

I'd submit a PR for this, but I don't want to step on any toes ๐Ÿ™

Tailwind Cookbook entry code not working

The line that launches the desktop app configuration of the dioxus app example for setting up Tailwind CSS currently points to ./tailwind.css when the previous command outputs the tailwind.css to public/tailwind.css
working on PR now

Development

  • Run the following command in the root of the project to start the tailwind css compiler:

    npx tailwindcss -i ./input.css -o ./public/tailwind.css --watch

Desktop

  • Add a custom head pointing to the generated tailwind CSS file in your main. It looks like:

    dioxus_desktop::launch_cfg(
      App,
      dioxus_desktop::Config::new()
        .with_custom_head(r#"<link rel="stylesheet" href="tailwind.css">"#.to_string()))
  • Launch the dioxus desktop app:

cargo run

The deployed website is crashing from today

The docsite was working until today.

In the browser console (macOS; Brave; guard disabled), I see:

docsite.js:725 ERROR /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dioxus-web-0.4.0/src/lib.rs:219 Rehydration failed NodeNotFound. Rebuild DOM into element from scratch
inline0.js:255 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'listening')
    at run (inline0.js:255:330)
    at dioxus_interpreter_js::sledgehammer_bindings::Channel::flush::h3dd42f069636a006 (docsite_bg.wasm:0xaa7cd)
    at dioxus_web::dom::WebsysDom::apply_edits::h8dea4df7adec0978 (docsite_bg.wasm:0x7f70a)
    at dioxus_web::run_with_props::{{closure}}::hd8fbd61113cac6f4 (docsite_bg.wasm:0x7ed66)
    at wasm_bindgen_futures::queue::Queue::new::{{closure}}::h4af736430e73b26a (docsite_bg.wasm:0xe5a45)
    at <dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h9e889b7261c861ea (docsite_bg.wasm:0x175211)
    at __wbg_adapter_63 (docsite.js:332:10)
    at real (docsite.js:236:20)

image

doesn't build

image

image

image

what I've run:
gh repo clone DioxusLabs/docsite
trunk serve

โ–ถ rustup -V
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.61.0 (fe5b13d68 2022-05-18)`

Route for 0.1 post points to the 0.2 post and vice versa

Hello again! It looks like the fix for #32 had an unfortunate side-effect: the routes for the blog posts are now reversed!
Screenshot_20220621-091410_Chrome.jpg
Screenshot_20220621-091332_Chrome.jpg

It looks like the routing is done by index on the array of posts, but because that array has changed its order, the routes now point to the wrong posts. Up to you how to fix it, but I'd suggest using the slug as the unifying key and sorting the posts on render.

No content when JavaScript is blocked.

The website should show at least some stub mentioning unavailable JavaScript instead of just rending plain white background (or better just deliver server-rendered content).

Combined with hourglass-esque logo, I though it was just very slow to load.

Upon loading, I saw a motto:

User interfaces that run anywhere.

Looks like JS-less web browsers is not an "anywhere".

Render your app entirely on the server.

So why the website (assuming it uses the framework in question) does not use it?

(also the text above is tricky to select - it attemts to drags&drop an element on FF 102.7esr instead of selecting the text).

"Getting Started: Web" guide suggestions wrong cargo add command

https://dioxuslabs.com/reference/platforms/web says:

Add Dioxus with the web features:

$ cargo add dioxus --features web

However cargo add dioxus --features web results in:

cldfire@jarekspsonalmbp project % cargo add dioxus --features web
    Updating crates.io index
      Adding dioxus v0.3.1 to dependencies.
error: unrecognized feature for crate dioxus: web
enabled features:
    dioxus-core-macro, dioxus-hooks, dioxus-html, dioxus-rsx, hooks, html, macro

Seems to me the default features are set up for a web build as of today.

Using ServerFn in dioxus_desktop

I've tried the dioxus_fullstack example. As far as I understood it has an underlying axum server, which serves both the static files and the generated APIs made by ServerFn.

Is it possible to separate them for use in dioxus_desktop?

I imagine something like:

  • dioxus_desktop runs a compiled binary (spawns a webview anyway)
  • dioxus (ssr) runs server-side axum, serving only the APIs without the web static files
  • they talk over the network

I tried to search in the documentation and examples by I haven't found anything so far

CSS is broken

The CSS is broken on the blog page. It works fine if you navigate to the home page and get to the blog from there.

Steps to reproduce:

  1. Click here: https://dioxuslabs.com/blog/
  2. See broken CSS

Getting Started - Full Stack has a number of issues

Just checking out the new 0.4 release, running through the full stack getting started guide (https://dioxuslabs.com/learn/0.4/getting_started/fullstack) and there are a few issues.

The Web link in "This guide assumes you read the Web getting started guide and installed the Dioxus-cli" goes to a 404.

Setup:

  • cargo run complains about missing index.html

Hot Reload:

  • Setup has no code to add to the main function
  • dx build --features web panics
  • dioxus run --features ssr --hot-reload command not found.
  • Running dx run --features ssr --hot-reload unrecognized subcommand 'run'

Add link to the github repo

One thing I am missing is a quick way to jump to the github repo of the framework from the website, that would be really nice

The homepage code snippet does not match the demo

image

This snippet:

fn app(cx: Scope) -> Element {
let mut count = use_state(&cx, || 0);
cx.render(rsx!(
h1 { "High-Five counter: {count}" }
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
))
}

Does not match the actual implementation and thus it raises some questions from the new-comers:

code { class: "language-rust line-numbers", [include_str!("../../../snippets/homepage.rs")] }
}
}
}
InteractiveHeader {}
}
})
}
pub fn InteractiveHeader(cx: Scope) -> Element {
let mut count = use_state(&cx, || 0);
cx.render(rsx!{
div {
class: "flex flex-col items-center px-10 rounded mt-6 mb-2 pt-4 mr-auto hidden lg:block lg:ml-2" ,
background_color: "hsl(220, 13%, 18%)",
div { class: "pb-3 text-white text-center w-44",
h1 { "Counter: {count}" }
}
div { class: "flex flex-col items-center",
button {
class: "inline-flex items-center text-white bg-green-500 border-0 py-1 px-4 focus:outline-none hover:bg-gray-600",
onclick: move |_| count += 1,
"Up high!"
}
img { class: "h-12 mx-4 my-4", src: "https://rustacean.net/assets/rustacean-flat-gesture.png" }
button {
class: "inline-flex items-center text-white bg-red-500 border-0 py-1 px-4 focus:outline-none hover:bg-gray-600",
onclick: move |_| count -= 1,
"Down low!"
}
}
}
})
}

  • The text is different
  • There is Ferris img
  • The style is different

JS Benchmark leads back to dioxuslabs.com

Problem

Clicking on the "JS Benchmark" in Feature-packed examples leads back to the https://dioxuslabs.com/ website.

Steps To Reproduce

Steps to reproduce the behavior:

Expected behavior

Clicking on JS Benchmark should show the Benchmark

Screenshots

image

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

Use new idiom for use_state

It looks like the new use_state idiom of (variable, set_variable) = use_state(&cx, | | initial_value) needs to be applied to src/components//.rs

Steps to reproduce:

  • Clone the latest docsite
  • Clone the latest fermi
  • in docsite, run trunk serve
  • See some errors around UseState

Create an "edit page" button

Feature request

It would be nice if on every page, there would be a button which would open the GitHub editor for that page, since it's just a Markdown file. For example, on guide/your_first_component, the button would lead to docsite/edit/master/docs-src/0.4/en/guide/your_first_component. It would allow anyone to quickly suggest a change without having to manually find that file, or fork the repository.

This wouldn't be sufficient for more complex documentation editing, but it would be perfect for small edits, such as a simple typo/grammar fix.

Line breaks in Markdown don't count as a space

In "normal" Markdown, a single line break displays a space. Example:

... this line is very long and hard to edit in an editor,
so here's a line break!

displays: ... this line is very long and hard to edit in an editor, so here's a line break!. This is not the case on the docsite, so there's awkward missing spaces. For example, in cookbook/examples, there's this:

... or you just want to see cool thingsthat you can do with Dioxus, make sure to give these a look!
                                 ^^^^^^^^^^

Equivalent Markdown:

... or you just want to see cool things
that you can do with Dioxus, make sure to give these a look!

Mismatch in project directory name in Liveview setup instructions

Location

Getting Started / Liveview - Setup

Summary

There is a small but potentially confusing mismatch in the Liveview setup instructions on the Dioxus documentation page. The instructions for creating a new project suggest using cargo new --bin demo followed by cd app, which seems to be inconsistent.

When using Darkreader: Links / buttons are unclickable and there are errors

Reproduction steps:

console errors:

INFO /home/runner/.cargo/git/checkouts/dioxus-1e619ce595d3799d/7a7397b/packages/web/src/lib.rs:172 Starting up docsite.js:1071:13
INFO /home/runner/.cargo/git/checkouts/dioxus-1e619ce595d3799d/7a7397b/packages/web/src/lib.rs:207 rebuilding app docsite.js:1071:13
ERROR /home/runner/.cargo/git/checkouts/dioxus-1e619ce595d3799d/7a7397b/packages/web/src/lib.rs:219 Rehydration failed NodeNotFound. Rebuild DOM into element from scratch docsite.js:1068:13
Uncaught (in promise) TypeError: root is undefined
    run https://dioxuslabs.com/assets/dioxus/snippets/dioxus-interpreter-js-e5d84ddbe84386fa/inline0.js:255
    __wbg_adapter_63 https://dioxuslabs.com/assets/dioxus/docsite.js:331
    real https://dioxuslabs.com/assets/dioxus/docsite.js:236
inline0.js:255:325
panicked at 'already borrowed: BorrowMutError', /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasm-bindgen-futures-0.4.37/src/task/singlethread.rs:85:37

Stack:

__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f/<@https://dioxuslabs.com/assets/dioxus/docsite.js:524:21
logError@https://dioxuslabs.com/assets/dioxus/docsite.js:253:18
__wbg_get_imports/imports.wbg.__wbg_new_abda76e883ba8a5f@https://dioxuslabs.com/assets/dioxus/docsite.js:523:66
console_error_panic_hook::hook::ha10b393455c8fea1@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[740]:0xd5d22
core::ops::function::Fn::call::hd3935fca3a953dbf@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[8010]:0x187edd
std::panicking::rust_panic_with_hook::h6df5db7ad9f65dc8@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[1811]:0x123f2d
std::panicking::begin_panic_handler::{{closure}}::h0d169fa297411d6d@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[2254]:0x13852c
std::sys_common::backtrace::__rust_end_short_backtrace::h7fe51fb4d3ba6060@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[7993]:0x187e4e
rust_begin_unwind@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[3538]:0x15ca6a
core::panicking::panic_fmt::h2d3c5586175098d9@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[4614]:0x16f298
core::result::unwrap_failed::h73809cc05a786e48@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[2550]:0x142d32
core::cell::RefCell<T>::borrow_mut::ha26e00b5061b58ad@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[3794]:0x161bbe
wasm_bindgen_futures::task::singlethread::Task::run::h2875f3fdd31c94db@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[2268]:0x138d5c
wasm_bindgen_futures::queue::Queue::new::{{closure}}::h8b8ac32a31b48068@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[1833]:0x12517c
<dyn core::ops::function::FnMut<(A,)>+Output = R as wasm_bindgen::closure::WasmClosure>::describe::invoke::h34b8c81218256380@https://dioxuslabs.com/assets/dioxus/docsite_bg.wasm:wasm-function[6233]:0x180878
__wbg_adapter_63@https://dioxuslabs.com/assets/dioxus/docsite.js:331:10
real@https://dioxuslabs.com/assets/dioxus/docsite.js:236:20


docsite.js:537:13
Uncaught (in promise) RuntimeError: unreachable executed
    __wbg_adapter_63 https://dioxuslabs.com/assets/dioxus/docsite.js:331
    real https://dioxuslabs.com/assets/dioxus/docsite.js:236
docsite_bg.wasm:1607698:1

Firefox 116.0 Linux
Linux Manjaro 23.0.0

PS:
i dont why or how, but after i had removed a dioxus-prevent-default attribute and clicked on that link, everything started to work (even after reload and hard reloads), but re-doing the reproduction steps gets it locked again

Document secret handling in Dioxus fullstack

We should document how to handle secrets that you want on the server but not on the client. Like API keys. It doesn't have to be a large section, but something about making sure that secrets are cfged out on the server would be useful.

We should add it to the fullstack docs here: https://github.com/DioxusLabs/docsite/tree/master/docs-src/0.4/en/reference/fullstack. It could be in a complete separate chapter or be part of a larger fullstack anti-patterns chapter

Broken button style on dioxuslabs.com

On viewing dioxuslabs.com I found that the buttons for switching code snippet showcases were problematic when activated for the first time(Pic1).
Pic1
Normal

After investigations it turns out that

  • inside run()@inline0.js, inside switch (op & 255){...} : the "case 4" would do els = stack.splice(stack.length - u32buf[u32bufp++]); which discards <span ...> from[<div id="main">, <span class="absolute z-10 bottom-0 inset-x-0 h-2 bg-ghmetal">], making it [<div id="main">].

Document file_engine in the docs guide on user input

At the https://dioxuslabs.com/learn/0.4/reference/user_input page, there's no mention on how to use input fields with type="file".
Trying to print the oninput event using the debug formatting didn't help either, as only empty "value" and "values" fields did show up.
Then I found the existence of the files field from the docs generated by cargo doc, in the dioxus::prelude::FormData. After more searching, I found this other example showing file upload https://github.com/Demonthos/dioxus/blob/master/examples/file_upload.rs

I would suggest documenting the file input feature inside the "user_input" guide page at https://dioxuslabs.com/learn/0.4/reference/user_input page.

Can I help in some way? Be warned that I'm not a native english speaker, so a checking might be needed anyway.

Passing props through the Router code snippet

https://dioxuslabs.com/learn/0.4/migration/router
the second block has this comment:

#[derive(Routable, PartialEq, Debug, Clone)]
enum Route {
    #[route("/home")]
    // This route will render the Home component with the HomeProps props. (make sure you have the props imported)
    // You can modify the props by passing extra arguments to the macro:
    // #[route("/home", Comp, CompProps)]
    Home {},
}

however, I tried doing

#[route("/home", Comp, CompProps)]

and

#[route("/home", CompProps)]
Comp {}

and

#[route("/home", Comp, CompProps)]
Comp {}

and neither one seems to work.

Diplex global state managment library doesn't seem to exist

The Diplex global state management library mentioned here

/// Dioxus also has 1st-class support for Diplex: a global state management toolkit modeled after RecoilJS.
doesn't show up in github searches of this organization or 'all of github' and doesn't show up on google either. Did the name of this library change? Is the library private? Thanks for your clarifications!

Create more "books"

By "books", I mean the top-level sections in the docs, like Router and CLI.

Some of the tools discussed in the docs could be reorganized into their respective books. This would reduce duplication and be more organized/coherent. Right now, it feels "scattered".

For example, Getting started > Web, Reference > Web, Cookbook > Publishing > Web could all be unified under a "Web" book. This includes all the other renderers, where each book contains all the steps to publish a project using a specific renderer. Additionally, there should be a guide on how to publish the same app on different platforms.

Every book should have a "Reference" section and an "Example project" section, which showcases elements from the Reference. The Router book has this, but the difference between the two sections should be clear. For example, the Router book example project has a Navigation Targets section, but this should be in the Reference, as it's not even included in the final example project code.

Missing <!DOCTYPE html>

This causes the page to be loaded in quirks mode:

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use โ€œโ€.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.