-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VNode::from_html_unchecked #2842
Conversation
I can't get any tests for this to pass: #[cfg(all(test, not(target_arch = "wasm32")))]
mod tests {
use super::*;
use crate::html;
#[test]
fn from_raw_html_works() {
let vnode = html! {
<><div>{"c"}</div></>
};
eprintln!("{:#?}", vnode);
let from_raw = VNode::from_raw_html("<div>c</div>");
eprintln!();
eprintln!("{:#?}", from_raw);
assert_eq!(vnode, from_raw);
}
} Test Output
I don't understand why exactly this test fails |
Benchmark - SSRYew Master
Pull Request
|
Size Comparison
|
Visit the preview URL for this PR (updated for commit 4850d52): https://yew-rs-api--pr2842-html-from-raw-v3ysmy42.web.app (expires Sun, 13 Nov 2022 16:20:14 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see an explanation for the increase in bundle size for the examples not using inner html. Other than that, I think reusing the vlist/blist implementation could save a bit of duplicated code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage seems good, and I don't see any more issues with the code.
Figuring out why this increases the bundle size is not blocking imo, even if it would be nice not to pay the additional 2kB.
I couldn't figure out anything regarding size increase. If I had to guess, maybe it's because I'm going to go ahead and merge this |
Description
Add method:
Fixes #2841
Checklist