Hotreloading of `for/if/body`, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.
---------
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
2024-07-18 02:11:18 +00:00
<!DOCTYPE html>
2024-07-23 17:22:49 +00:00
< html >
< head >
< title > Dioxus Build< / title >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" / >
< meta charset = "UTF-8" / >
< link rel = "icon" type = "image/png" href = "https://avatars.githubusercontent.com/u/79236386?s=200&v=4" >
< style >
/* Fira Mono Font */
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono:wght@400;500;700&display=swap');
body {
margin: 0;
padding: 0;
overflow-x: hidden;
font-family: "Fira Mono", monospace;
color: #313131;
background-repeat: repeat;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABgUExURdXZ39ba4Nfb4dHV29vf5dre5Njc4tnd49TY3uDk6t3h59zg5uHl697i6NPX3dLW3M/T2ePn7d/j6dDU2uTo7uLm7M7S2OXp783R18zQ1uru9O3x98vP1ebq8Ont88rO1EIB0XMAAAAJcEhZcwAADsMAAA7DAcdvqGQAAIpzSURBVHheLf2LgqNIErZpAhIIgUCZREd1z+zM7v3f5T4v9fehKjNCQu7mZt/B3EHDME7T4zkP8zKMw+s1r6/X8z295mV7bdP42vd5fr2Wedq2afGnfZ4+y2d67s99ePnJuEzL8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zB01jpXALWoN9qWL7TEkLg4l9S7Z2CeAlUiM4sUsKU1loKyUNp/0/wm3PfKFKgI1cPNLOZ53OkTaXlM3kb05PEqJYRfu2YfvHCsT7B+1eIQ2KUGdrMk0jcboVifqqH2Gd9XSdyzU/A/4vyvuQaw4daLrnCnPl4SUoKf7bDsgCWIc5ROyeM8B/YrSDrQ7wIZwHeh2/xhO4HYjV0OBwJ4xfpc2cAqxI63mLerBmXWeYeyMYEiWKYysbKcj9b1MtICE8ncBBL2D4PGwBTPPEeH7ngSyMwReg1E2IgjQlREMiyuYq/5d1P/A8Z0tsmoT4ey+86fs8PLSSp2FOZl0/2Aa6/vK0zZSdHcKn6VShiQFqqFQPyykwageB/yfHPuS3fV1WdZSEAJcL1fauHEJk/ZqS/EuNFHIzL
}
.hidden {
display: none !important;
visibility: hidden;
}
/* Header */
#header {
display: flex;
align-items: center;
width: 80vw;
margin-left: auto;
margin-right: auto;
margin-top: 20px;
}
#header>#dioxus {
margin-left: 10px;
font-weight: 500;
font-size: 1.3rem;
}
#header>#project-info {
margin-left: auto;
font-weight: 500;
font-size: 1.1rem;
}
.content-container {
width: max-content;
margin-left: auto;
margin-right: auto;
margin-top: 10vh;
display: grid;
grid-template-columns: 1fr;
}
.content-header-text {
font-weight: 700;
font-size: 2rem;
}
/* Building proggres screen */
#building>h1 {
margin-bottom: 60px;
text-align: center;
}
#building>#progress-bar {
width: 100%;
height: 8px;
background-color: #BEC4D0;
border-radius: 5px;
}
#building>#progress-bar>div {
height: 100%;
background-color: #55A4FF;
border-radius: 10px;
}
#building>#text {
width: 100%;
display: flex;
flex-direction: row;
margin-top: 5px;
}
#building>#text>h4 {
margin-top: 0;
}
#building>#text>#build-message {
margin-right: auto;
font-weight: 500;
font-size: 1rem;
}
#building>#text>#build-progress-percent {
margin-left: auto;
font-weight: 700;
font-size: 1.1rem;
}
/* Error */
#error {
align-items: start;
}
#error>h1 {
margin-bottom: 20px;
text-align: left;
}
#error>#error-sub-text {
font-weight: 500;
}
#error>#error-block {
background-color: #BEC4D0;
border-radius: 5px;
padding: 20px;
font-weight: 500;
overflow-x: auto;
white-space: pre-wrap;
min-width: 640px;
}
/* Text coloring */
.err {
color: #d94545;
}
.info {
color: #3980d1;
}
.warn {
color: #CC7E00;
}
.text-theme {
color: #313131;
}
/* Footer */
#footer {
width: 100vw;
margin-top: 100px;
}
#footer>h4 {
text-align: center;
box-sizing: content-box;
font-size: 1.1rem;
font-weight: 500;
}
#footer>h4>a {
text-decoration: none;
color: #313131;
}
#footer>h4>a:hover {
text-decoration: underline;
}
@media (max-width: 725px) {
#header {
width: 95vw;
}
#building {
width: 95vw;
}
#building>h1 {
Hotreloading of `for/if/body`, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.
---------
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
2024-07-18 02:11:18 +00:00
width: 100%;
2024-07-23 17:22:49 +00:00
}
}
@media (max-width: 780px) {
#header {
width: 95vw;
}
#error {
width: 95vw;
}
#error>h1 {
width: 100%;
}
#error>#error-block {
min-width: auto;
}
}
/* Dark Theme */
@media (prefers-color-scheme: dark) {
body {
color: #E2E5E9;
background-repeat: repeat;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAMAAAC/MqoPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAABdUExURRgbIBseIxcaHxodIhkcIRUYHRQXHBMWGxwfJB8iJxYZHh0gJSAjKB4h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nIGCSPdVC9WbuI0A9msQWVpLamn2az+yq7+ohWGGUN6++D/Ega6QIVPsFkuyW/rTXR8Rk9fiLzsIaJkERv6RxPcbjEh7k4oZKQ+1xFoAYuGkIwLwsmjRMgXdEbgISE+ewKmW18SaldMx8XCMwU9TGIeTFBpURke7IRrqxQKgo4wnE9ucXBER7ONYXCA4VS8zLSlj5LfP8BLSnjIQXVKgcYMVkI/Umcl4ErX/dokcvG+CLaiNfqeAZdvm1/SOBNe5qjqvcGoN/iGuYcH3UDnIamQ1lKu33IsDx1qr504+RzgS/CgUvAeKmxGDHJh3HpmExrgaGSN1GOwv1X4iUzPCzAihd+LQlC0QnNOAp1AXXgtvFMPpL2gYdVcEzdCYt6N1/MtvEkPRkv8KT/JFpyDGRWT+fb3+h/Rc0pbHW+Uo460cRGXEoQHAF8YEuJj1sn/tCw1e0g05pmp/XNLwyi5nblGpQejPkTBAksIUoVF9OsR7oYJCgGffpexz+vc0xW1yCa5Gbf0/izdYPF0c/d+1thVUMJJJX4WSG6jNU9lXgOAuMBI6VRL1URarZjJ7ug38fpfyY8eh3AgNks7lOP3B0+o6BgfKfJSUsjJmW8WtCBdBFru0iZOdpXC/Qh49fy9+YR4MrdTCd8Ni/z4XQECumY/moeSOEVjE9AVcjbse3UlDl+f
}
/* Text coloring */
.err {
color: #F04C4C;
}
.info {
color: #55A4FF;
}
.warn {
color: #FFCB51;
}
.text-theme {
color: #E2E5E9;
}
#building>#progress-bar,
#error>#error-block {
background-color: #111318;
}
#footer>h4>a {
color: #E2E5E9;
}
}
< / style >
< / head >
< body >
<!-- Header -->
< div id = "header" >
<!-- Dioxus Logo -->
< svg xmlns = "http://www.w3.org/2000/svg" width = "32" height = "32" xmlns:v = "https://vecta.io/nano" >
< path
d="M22.158 1.783c0 3.077-.851 5.482-2.215 7.377s-3.32 3.557-5.447 5.33-4.425 3.657-6.252 6.195-3.102 5.515-3.102 9.532h4.699c0-3.077.853-5.377 2.217-7.272s3.32-3.557 5.447-5.33 4.425-3.657 6.252-6.195 3.102-5.62 3.102-9.637z"
fill="#e96020" />
< path
d="M9.531 25.927c-.635 0-1.021.515-1.02 1.15s.385 1.151 1.02 1.15H22.47a1.151 1.151 0 1 0 0-2.301zm1.361-4.076c-.608 0-.954.558-.953 1.166s.346 1.035.953 1.035h10.217a1.101 1.101 0 1 0 0-2.201zm0-13.594a1.101 1.101 0 1 0 0 2.201h10.217c.607 0 .953-.598.953-1.205s-.345-.996-.953-.996zM9.531 4.021A1.15 1.15 0 0 0 8.38 5.17a1.15 1.15 0 0 0 1.15 1.15h12.94c.635 0 1.021-.498 1.02-1.133s-.386-1.166-1.02-1.166z"
fill="#2d323b" />
< path
d="M5.142 1.783c0 4.016 1.275 7.099 3.102 9.637s4.125 4.422 6.252 6.195 4.083 3.656 5.447 5.551 2.215 3.974 2.215 7.051h4.701c0-4.016-1.275-7.038-3.102-9.576s-4.125-4.422-6.252-6.195-4.083-3.435-5.447-5.33S9.841 4.86 9.841 1.783z"
fill="#00a8d6" />
< / svg >
< h2 id = "dioxus" > Dioxus< / h2 >
<!-- Project platform and name -->
< h2 id = "project-info" > N/A | N/A< / h2 >
< / div >
<!-- Building progress screen -->
< div class = "content-container" id = "building" >
< h1 class = "content-header-text" > One sec! < br / > We're building your app now.< / h1 >
< div id = "progress-bar" >
< div id = "progress-bar-inner" style = "width: 1%;" > < / div >
< / div >
< div id = "text" >
<!-- Funny loading messages or something -->
< h4 id = "build-message" > Starting the build...< / h4 >
<!-- Progress % -->
< h4 id = "build-progress-percent" > 0%< / h4 >
Hotreloading of `for/if/body`, formatted strings, literals, component props, nested rsx, light CLI rewrite, cli TUI (#2258)
Hotreload the contents of for loops, if chains, component bodies, props, attributes, and any literals discovered in rsx!
Add a TUI renderer to the CLI.
Improve the CLI build system to be async and parallel.
Refactor RSX to allow partial expansion of expressions.
Merge autofmt implementations for consistency.
Merge the representation of elements and components under the hood.
Add a diagnostics system for rsx for improved error messages.
Drop interprocess and move to websockets for communication between the CLI and the server.
Assign IDs to nodes and attributes in a stable way to be used in non compiler contexts.
Add hotreloading to any body of component/for loop/if chain/etc.
---------
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
Co-authored-by: Liam Mitchell <liamkarlmitchell@gmail.com>
2024-07-18 02:11:18 +00:00
< / div >
2024-07-23 17:22:49 +00:00
< / div >
<!-- Building Error -->
< div class = "content-container hidden" id = "error" >
< h1 class = "content-header-text" > Oops! The build failed.< / h1 >
< p id = "error-sub-text" > < span id = "error-inner-sub-text" class = "warn" > compiling my-cool-project< / span > encountered an
error:< / p >
< div id = "error-block" >
< span class = "err" > error< / span > < span > : expected `;`, found `rsx`< / span > < br / >
< span class = "info" > -->< / span > < span > src/main.rs:21:6< / span > < br / >
< span class = "info" > |< / span > < br / >
< span class = "info" > 21 |< / span > < span > a< / span > < br / >
< span class = "info" > |< / span > < span class = "err" > ^ help: add `;` here< / span > < br / >
< span class = "info" > 22 |< / span > < span > rsx! {< / span > < br / >
< span class = "info" > |< / span > < span class = "info" > --- unexpected token< / span > < br / >
< span class = "err" > error< / span > < span > : could not compile `my-cool-app` (bin "my-cool-app") due to 1 previous
error< / span >
< / div >
< / div >
<!-- Footer Of Links -->
< div id = "footer" >
< h4 >
< a href = "https://docs.rs/dioxus/latest/dioxus/" > docs< / a >
|
< a href = "https://dioxuslabs.com/learn" > guides< / a >
|
< a href = "https://discord.gg/KrGKhBbU6s" > help< / a >
< / h4 >
< / div >
<!-- Logic -->
< script >
let APPLICATION_NAME = "N/A";
// Wait for a "Ready" message from the server on the websocket served at /_dioxus/build_status
let protocol;
if (window.location.protocol === "https:") {
protocol = "wss:";
} else {
protocol = "ws:";
}
let url =
protocol + "//" + window.location.host + "/_dioxus/build_status";
let ws = new WebSocket(url);
// WS Message Handling
ws.onmessage = (event) => {
// Parse the message as json
let data = JSON.parse(event.data);
// If the message is "Ready", reload the page
if (data.type === "Ready") {
setTimeout(() => {
// Once we get a "Ready" message, reload the page
window.location.reload();
}, 500);
} else if (data.type === "ClientInit") {
// Get project info
APPLICATION_NAME = data.data.application_name;
const platform = data.data.platform;
// Set project info
let projectInfo = document.getElementById("project-info");
projectInfo.innerText = `${platform} | ${APPLICATION_NAME}`;
} else if (data.type === "BuildError") {
// If the message is "BuildError", display an error message
// Show correct view for message.
let errorContainer = document.getElementById("error");
errorContainer.className = "content-container";
let buildingContainer = document.getElementById("building");
buildingContainer.className = "content-container hidden";
let errorInnerSubText = document.getElementById("error-inner-sub-text");
errorInnerSubText.innerText = `compiling ${APPLICATION_NAME}`;
// Replace with our styling.
let color1 = data.data.error.replaceAll("style='color:#f55'", "class='err'");
let color2 = color1.replaceAll("style='color:#5ff'", "class='info'");
let color3 = color2.replaceAll("style='color:#fff'", "class='text-theme'");
let formatting1 = color3.replaceAll("< b > ", "");
let formatting2 = formatting1.replaceAll("< / b > ", "");
let errorBlock = document.getElementById("error-block");
errorBlock.innerHTML = formatting2;
} else if (data.type === "Building") {
// Show correct view for message.
let errorContainer = document.getElementById("error");
errorContainer.className = "content-container hidden";
let buildingContainer = document.getElementById("building");
buildingContainer.className = "content-container";
// Get the current progress
const progress = data.data.progress;
const roundedProgress = Math.round(progress * 100);
// Update the loading indicator
let loadingPercent = document.getElementById("build-progress-percent");
let loadingBar = document.getElementById("progress-bar-inner");
const formattedProgress = `${roundedProgress}%`;
loadingPercent.innerHTML = formattedProgress;
loadingBar.style.width = formattedProgress;
// Show progress message
const message = data.data.build_message;
let buildMessage = document.getElementById("build-message");
buildMessage.innerText = message;
}
};
// WS Reconnect Logic
const POLL_INTERVAL_MIN = 250;
const POLL_INTERVAL_MAX = 4000;
const POLL_INTERVAL_SCALE_FACTOR = 2;
const reload_upon_connect = (event, poll_interval) => {
// Firefox will send a 1001 code when the connection is closed because the page is reloaded
// Only firefox will trigger the onclose event when the page is reloaded manually: https://stackoverflow.com/questions/10965720/should-websocket-onclose-be-triggered-by-user-navigation-or-refresh
// We should not reload the page in this case
if (event.code === 1001) {
return;
}
window.setTimeout(() => {
var ws = new WebSocket(url);
ws.onopen = () => window.location.reload();
ws.onclose = (event) => {
reload_upon_connect(
event,
Math.min(
POLL_INTERVAL_MAX,
poll_interval * POLL_INTERVAL_SCALE_FACTOR
)
);
};
}, poll_interval);
};
ws.onclose = (event) => reload_upon_connect(event, POLL_INTERVAL_MIN);
< / script >
< / body >
< / html >