Deprecate relative asset paths, better warnings for asset!() (#3214)

* Deprecate relative asset paths

* fix paths, better warnings in asset parser
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-11-13 19:52:23 -05:00
1 parent 8a2922c663
commit ba4389567d
13 files changed
+95 -36

No files matched your search

@@ -5,7 +5,7 @@ pub(crate) fn ChildrenOrLoading(children: Element) -> Element {
rsx! {
document::Link {
rel: "stylesheet",
href: asset!("./public/loading.css")
href: asset!("/public/loading.css")
}
SuspenseBoundary {
fallback: |context: SuspenseContext| {
+1 -1
View File
@@ -19,7 +19,7 @@ fn main() {
rsx! {
document::Link {
rel: "stylesheet",
href: asset!("./public/tailwind.css")
href: asset!("/public/tailwind.css")
}
ChildrenOrLoading {
+1 -1
View File
@@ -23,7 +23,7 @@ fn app() -> Element {
rsx! {
document::Link {
rel: "stylesheet",
href: asset!("./assets/fileexplorer.css")
href: asset!("/assets/fileexplorer.css")
}
div {
document::Link { href: "https://fonts.googleapis.com/icon?family=Material+Icons", rel: "stylesheet" }
@@ -36,7 +36,7 @@ pub fn App() -> Element {
#[component]
fn Homepage(story: ReadOnlySignal<PreviewState>) -> Element {
rsx! {
document::Link { rel: "stylesheet", href: asset!("./assets/hackernews.css") }
document::Link { rel: "stylesheet", href: asset!("/assets/hackernews.css") }
div { display: "flex", flex_direction: "row", width: "100%",
div {
width: "50%",