Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix onremove() ordering#684

Closed
infinnie wants to merge 25 commits into
jorgebucaran:masterfrom
infinnie:master
Closed

Fix onremove() ordering#684
infinnie wants to merge 25 commits into
jorgebucaran:masterfrom
infinnie:master

Conversation

@infinnie

@infinnie infinnie commented Apr 26, 2018

Copy link
Copy Markdown
Contributor

Fixing #681.

Things like `Array.prototype.map()` are features of ECMAScript 5.
Also exports are only available as of ES 6.
@codecov

codecov Bot commented Apr 26, 2018

Copy link
Copy Markdown

Codecov Report

Merging #684 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #684   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines         166    176   +10     
  Branches       52     58    +6     
=====================================
+ Hits          166    176   +10
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 483ea05...5081bed. Read the comment docs.

@jorgebucaran jorgebucaran added wontfix Forget it, sorry FIX labels Apr 26, 2018
@jorgebucaran

Copy link
Copy Markdown
Owner

Partly? :D

@infinnie

Copy link
Copy Markdown
Contributor Author

Partly for it being untested.

@infinnie

Copy link
Copy Markdown
Contributor Author

Further modification is needed because tests are failed by now.

@jorgebucaran

jorgebucaran commented Apr 26, 2018

Copy link
Copy Markdown
Owner

Gotcha. This is a nice attempt. Thanks!

Ultimately, storing the element in the virtual node will solve the problem, help simplify diffing and improve performance, so while this is fun and you are free to keep doing your best, this is not the route I want to choose.

@infinnie infinnie closed this Apr 26, 2018
@infinnie infinnie reopened this Apr 26, 2018
@infinnie

Copy link
Copy Markdown
Contributor Author

As of commit infinnie@b12f9bd tests could be passed now. But I still don’t know why it even works.

@jorgebucaran

Copy link
Copy Markdown
Owner

@infinnie Because there's no test documenting the said onremove bug.

@infinnie

infinnie commented Apr 26, 2018

Copy link
Copy Markdown
Contributor Author

@jorgebucaran I mean the original tests.

Also maybe @mindplay-dk could help me document the onremove() bug and write tests for it.

@infinnie

Copy link
Copy Markdown
Contributor Author

@jorgebucaran ok I’ve added a preliminary test for that purpose.

@jorgebucaran

jorgebucaran commented Apr 26, 2018

Copy link
Copy Markdown
Owner

Thanks, @infinnie! Can you create a new PR with the failing test case only?

@infinnie

infinnie commented Apr 26, 2018

Copy link
Copy Markdown
Contributor Author

But @jorgebucaran I was wrong.
The new test runs for the original code as well.
But there is reordering in the browser if the original code were run.
I am looking for a better test.
:(

@infinnie

infinnie commented Apr 26, 2018

Copy link
Copy Markdown
Contributor Author

Seems that much of the original problem of reordering should have been fixed (accidentally and partly!) as of #663, but that brought forth a problem as I stated in #681 (comment):

Just by the way: what would we expect to happen if two asynchronous element removals happen consecutively, so that when one element is being removed we start to remove the second one?

And this PR then seems to have solved that problem but by reverting #663 (as of 7f79f08) as well as adding my own code. So it is still far from done.

infinnie added a commit to infinnie/hyperapp that referenced this pull request Apr 26, 2018
@infinnie infinnie mentioned this pull request Apr 26, 2018
@infinnie

infinnie commented Apr 26, 2018

Copy link
Copy Markdown
Contributor Author

Can you create a new PR with the failing test case only?

@jorgebucaran #685

@mindplay-dk

Copy link
Copy Markdown

@infinnie did you try this on the nightmare fiddle I came up with to ruin Jorge's day? 😀

@infinnie

Copy link
Copy Markdown
Contributor Author

@mindplay-dk See also https://jsfiddle.net/y7a2jc55/ that shows where the original Ultradom is wrong.

@mindplay-dk

Copy link
Copy Markdown

@infinnie I wrote this test a while back to document the reordering issue with deferred removals:

mindplay-dk/picodom@2b0784b

I'm not sure if this covers the more complex issue demonstrated by the nightmare fiddle - it was a long time ago and my attentions are elsewhere at the moment.

I wrote a more aggressive test (for my own dead project) for reordering, but that doesn't cover the issue with deferred removals.

Probably what's needed is a more minimal/controlled test of some sort, along the lines of this fiddle, which you could probably turn into a test by hoisting the removal callbacks, same as I did in my first test.

@infinnie

Copy link
Copy Markdown
Contributor Author

@mindplay-dk What about multiple element removals?

@infinnie infinnie closed this May 24, 2018
@infinnie infinnie mentioned this pull request May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix Forget it, sorry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants