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
Attributes: Fix apply_diff_index_maps #2653
Attributes: Fix apply_diff_index_maps #2653
Conversation
Thanks for the PR. This seems to be present already in the initial implementation in #1537. It being Can you add test cases for the behaviour so that it doesn't pop up again later? Ask if you're not sure where and how to write those. Starting with the layout tests in |
How do I run those test? I get:
|
That test is missing a feature gate. You can add the following to the beginning of the file:
|
The tests are run from the top-level folder with |
cargo make tests[cargo-make] INFO - cargo make 0.35.11 |
Oops, I had a version pre-#2640 checked out. You are right... I'll mentally add it to the pile related to #2641 and #2541 and the workaround by futursolo should deal for now ... (also need to add the workaround to |
OK, that fixes the bug. Do you know how I cam run a single test? (make test always run all tests) |
You can go into --- a/packages/yew/Makefile.toml
+++ b/packages/yew/Makefile.toml
@@ -1,6 +1,6 @@
[tasks.native-test]
command = "cargo"
-args = ["test", "--features", "csr,ssr,hydration"]
+args = ["test", "--features", "csr,ssr,hydration", "--", <your test filter>]
@@ -10,7 +10,9 @@ args = [
"--headless",
"--",
"--features",
- "wasm_test"
+ "wasm_test",
+ "--",
+ <your test filter, e.g. "index_maps">,
] |
Finally managed to create a test case ... |
Visit the preview URL for this PR (updated for commit a986c03): https://yew-rs-api--pr2653-fix-apply-diff-index-cq4lwish.web.app (expires Wed, 11 May 2022 17:35:34 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size Comparison
✅ None of the examples has changed their size significantly. |
3b54e46
to
aa705b8
Compare
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.
Performance alert is a false positive, as far as I can tell.
@maurerdietmar Could you please rebase / merge from master so size comparison test can run? |
The old algorithm simply stops when key name/order changes, which is simply wrong. Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
aa705b8
to
a986c03
Compare
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.
Arguably, both the new and old attribute set often have <10 entries, so all those iterations are preferable to keeping extra state to track leftover attributes to remove (changing the signature slightly, alternatively old
can potentially be mutable). We can try it in a follow-up but the fix itself looks good. Thanks for the test case.
The old algorithm simply stops when key name/order changes, which is simply wrong.