Comments (7)
Thanks a lot for pointing this out!
Are you using console_error_panic_hook? If not that helps tremendously with the stack traces.
Maybe you can reproduce this somehow in a test? I currently don't know how.
So we typically just create a new diff_patch.rs
test case and see if it fails.
percy/crates/virtual-dom-rs/tests/diff_patch.rs
Lines 20 to 33 in bb39471
wasm-pack test crates/virtual-dom-rs --firefox --headless --test diff_patch # Run browser tests
These tests make sure that you can diff and patch in both directions between two VirtualNode trees.
Basically it's the change from
<span><br></span>
to<span>a<br></span>.
I've been able to reproduce the issue thanks to your example
https://github.com/chinedufn/percy/blob/fix-62/crates/virtual-dom-rs/tests/diff_patch.rs#L163-L173
Will take a look (not tonight).
Thanks!!
from percy.
Great! I can probably give this a try tomorrow (unless you find time tonight).
from percy.
FWIW another place that relates to this is the html macro tests
percy/crates/html-macro-test/src/lib.rs
Lines 215 to 228 in 4a2770c
But I took a look and the html macro is working fine so this looks like a diff or patch issue... I'll take a look
from percy.
Are you using console_error_panic_hook? If not that helps tremendously with the stack traces.
Oh, that's nice, thanks for pointing it out!
from percy.
Alright so I won't be able to take a look for a few days.
If you'd like to take a look at this in the meantime I'd be happy to answer any questions and/or point you towards where to look.
I've written up some documentation on the exact process to figure out what's going wrong.
https://chinedufn.github.io/percy/diff-patch/fixing-diff-patch-issues.html
from percy.
Alright so I added a test case with your example (thanks!) and it does indeed fail!
percy/crates/virtual-dom-rs/src/diff/mod.rs
Lines 267 to 280 in cb41f08
Just to keep you posted, I should be able to take a look either tonight or within the next couple of days.
Cheers!
from percy.
@dbrgn so my screenshot above was totally wrong. The diffing was working fine I just had my Vec<Patch>
in the test case backwards. The left and right in that screenshot have the save vector contents just in different orders...
Anyways.. the real issue was a patching issue.
The Patch::Replace(...)
handler would treat text nodes like regular nodes so we were trying to create an element but we weren't providing a tag.. So basically calling document.create_element("")
;
from percy.
Related Issues (20)
- How alive is this project? HOT 3
- Use request_animation_frame from rust instead of Global Js call for update view HOT 3
- Free hosting? HOT 5
- Sub-routes not working? HOT 1
- Bash files in examples to rust-script? HOT 5
- Curly braces for value interpolation HOT 1
- Implement Performance Metrics HOT 2
- Implement a Formatting Tool HOT 2
- Consider Pure JS Transpilation HOT 2
- FYI: branding/naming clash HOT 1
- Crate renames HOT 1
- Docs: Broken CSS HOT 1
- Broken tests in html-macro 0.7.0 and 0.7.1 HOT 4
- Building nojs-first applications (and some thoughts about an isomorphic data layer) HOT 1
- Free Hosting for Demos HOT 1
- Allow Support for multiple parameters in `JSX` syntax HOT 4
- Spaces removed when isomorphic app is hydrated HOT 3
- File referred to in documentation doesn't exist
- Fix parenthesized blocks in html macro
- Panic happened in /allocator/free_list.rs that `new_page == 0` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from percy.