-
Notifications
You must be signed in to change notification settings - Fork 842
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
Strengthen isKeyed test for swap rows #694
Comments
I think it’s better to create a third category other than keyed and unkeyed
instead of changing the definition
Stefan Krause <notifications@github.com>于2020年2月14日 周五下午12:20写道:
… As discovered in #693
<#693> currently
the isKeyed test for swap rows is too weak to detect implementations that
remove the two rows and simply insert two new rows.
I really think it makes much more sense to require a keyed implementation
to actually move the rows, i.e. add exactly the rows that were removed
(otherwise any dom state would be lost when swapping rows).
If isKeyed checks whether the rows are actually moved for swap rows the
following implementations fail:
aurelia-v1.3.0-keyed
binding.scala-v10.0.1-keyed
crui-v0.1.0-alpha.13-keyed
datum-v0.12.2-keyed
dojo-v6.0.4-keyed
fidan-v0.0.23-keyed
maquette-v3.3.0-keyed
mikado-v0.7.57-keyed
ractive-v1.3.6-keyed
react-hookstate-v16.8.6 + 1.5.2-keyed
reflex-dom-v0.4-keyed
san-v3.7.7-keyed
Can you please take a look at your implementations? Is it possible to fix
it for your frameworks?
@Alexander-Taran <https://github.com/Alexander-Taran> @Atry
<https://github.com/Atry> @iazel <https://github.com/Iazel> @MartinRixham
<https://github.com/MartinRixham> @agubler <https://github.com/agubler>
@ismail-codar <https://github.com/ismail-codar> @johan-gorter
<https://github.com/johan-gorter> @ts-thomas
<https://github.com/ts-thomas> @evs-chris <https://github.com/evs-chris>
@alexfmpe <https://github.com/alexfmpe> @errorrik
<https://github.com/errorrik>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#694?email_source=notifications&email_token=AAES3OSSZNJEDQGHZXGP6A3RC34JZA5CNFSM4KVPEJSKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4INVNPLQ>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAES3OQPU6I57ECUPVR2JRLRC34JZANCNFSM4KVPEJSA>
.
|
the name of the metric has always been "swap", unambiguously. this simply improves the assertion of the metric. |
@Atry I don't think we're changing the definition of keyed, but indeed we're changing the test for keyed that wasn't sufficient (and I'm not sure it's now watertight). |
Maquette does not support swapping nodes, you can exclude maquette from this test for this reason. |
I decided to update the results table such that it show any open issues for the implementations. The information is kept in package.json (js-framework-benchmark.issues). |
Hello @krausest, the mikado keyed implementation was tagged with the issue "Keyed implementations must move the DOM nodes for swap rows", but that's not right. The implementation must assign the new values to the data array (like all others). .route("swaprows", () => {
const tmp = store[998];
store[998] = store[1];
store[1] = tmp;
}) Edit: Sorry but I misunderstood the issue, I thought that the description explains the issue not the desired behavior. |
@ts-thomas Please try the following: Click on "Create 1,000 rows", open chrome's dev-tools and set the background color of the row with id 2 to red and click on "Swap rows". If you look now at the second to last row (which has now id 2) is it still red? If not it's not keyed. |
@agubler I just noticed that the swap operation is non-keyed again for dojo 8 alpha 1.Can you take a look at it? |
@krausest have you updated the test? |
@agubler No. I wonder too how that happened. When updating a library I'm running the isKeyed test automatically. So either I ignored the error or it wasn't there at that time.
|
@krausest very strange. I’ll try and take a look over the weekend |
@krausest thank you for double checking |
@krausest Hmmm this is strange I have just pulled the latest, re-installed deps, done re-builds and ran
Edit: Passes in 88 too |
Something is indeed very strange. The version in my docker container behaves non-keyed, when I build it directly on my linux machine it behaves keyed. The package-lock.json is the same for both (but I tried to clean up package-lock.json handling in this release so I'm double checking if I did something wrong there). I'll investigate and report back. |
The build script delete many output directories, but not output. Dojo uses a directory output. I noticed that on my docker container the output directory contains multiple bootstrap..js and main..js files:
The index.html references bootstrap.b81f915a0b0556427479.bundle.js When I delete the output folder and let it rebuild in the docker container has the following files:
the index.html references bootstrap.bfe59d369934154bc858.bundle.js. This version behaves correctly even in the docker build. I'll remove the issue for dojo again and update the official results. |
@krausest oh how funny! Thanks for working that out 😃 |
It's been more than two years since this issue was found. I'll move all implementations with 694 to non-keyed for the chrome 102 run. |
As discovered in #693 currently the isKeyed test for swap rows is too weak to detect implementations that remove the two rows and simply insert two new rows.
I really think it makes much more sense to require a keyed implementation to actually move the rows, i.e. add exactly the rows that were removed (otherwise any dom state would be lost when swapping rows).
If isKeyed checks whether the rows are actually moved for swap rows the following implementations fail:
Can you please take a look at your implementations? Is it possible to fix it for your frameworks?
@Alexander-Taran @Atry @iazel @MartinRixham @agubler @ismail-codar @johan-gorter @ts-thomas @alexfmpe @errorrik
The text was updated successfully, but these errors were encountered: