![MIT licensed](https://camo.githubusercontent.com/2bb6ac78e5a9f4f688a6a066cc71b62012101802fcdb478e6e4c6b6ec75dc694/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)
- My first Dioxus application
- Makes a Content Delivery Network (CDN)-compatible static HTML distribution
- Includes static prerendering with client-side hydration
- An online demonstration is available at this website:
![CroftSoft Dioxus Prototype 2023-10-20](https://raw.githubusercontent.com/david-wallace-croft/dioxus-prototype/main/./media/dioxus-prototype-2023-10-20-a.png)
- Rust-Dioxus Project Setup
- Install the Rust command line utility "cargo"
- Install the Dioxus Command Line Interface (CLI) "dx"
- Install npm
- npm installs utilities such as prettier
- npm scripts run the dx and cargo commands
- npm can be installed by installing node.js
- https://nodejs.org/
- cd dioxus-prototype/
- npm install
- Installs the utility http-server to serve the HTML
- Installs the utility pretter to format the HTML
- Installs the utility rimraf to remove distribution directory dist/
- npm start
- Open your browser to http://localhost:8080/
- Make changes to the HTML in src/lib.rs or the CSS in public/stylesheet.css
- Note that the changes are updated in your browser as soon as you save
Test Static Prerendering with Hydration
- npm test
- Deletes the distribution directory dist/ to start clean
- Makes the index.html page with the hydration code
- Inserts the prerendered HTML
- Formats the HTML using the prettier utility
- Launches http-server to serve the HTML
- Opens your browser to the home page
- npm run clean
- Deletes the distribution directory dist/ to start clean
- npm run dist
- Same as npm test
- Except that it does not start http-server and open the browser
- npm run format
- Runs the utility prettier
- npm run hydrate
- Makes the index.html page with the hydration code
- npm run prerender
- Inserts the prerendered HTML
- npm run make
- Makes the index.html page with the hydration code
- Inserts the prerendered HTML
- Runs the utility prettier
- But does not start by deleting dist/
- npm run serve
- Starts the http-server
- Opens the browser
- Restore the prettier configuration
- Bump the version number
- Initial release: 2022-08-21
About
Rust-based Dioxus web app example
https://www.persentia.com
MIT License
Languages
Language:Rust 81.9%Language:CSS 17.2%Language:HTML 0.9%