Skip to content
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

shouldRecycle not used in one spot #1992

Closed
valtron opened this issue Oct 14, 2017 · 2 comments
Closed

shouldRecycle not used in one spot #1992

valtron opened this issue Oct 14, 2017 · 2 comments

Comments

@valtron
Copy link
Contributor

@valtron valtron commented Oct 14, 2017

See: https://github.com/MithrilJS/mithril.js/blame/8b56c7091169c0fb057d7afac041a23a4700bcdb/render/render.js#L237

Changed in: 632677e#diff-000bdfae56251b0715111d2b18c9de3cR200

From the other changes in that commit, it looks like the line after should use shouldRecycle instead of recycling.

This "bug" causes components to get oninit'ed unnecessarily: see https://jsfiddle.net/3hnjft4u:

  • run and open inspector
  • delete items 1.1, 1.0 in that order
  • check inspector output: the logged "oninit 1.3" is unnecessary

I'd gladly make a PR for this.

@pygy
Copy link
Member

@pygy pygy commented Oct 14, 2017

Thanks for the report!

At a glance, your analysis seems correct (this example uses a version of Mithril patched according to your suggestion and the problem subsides).

But it's getting late, I'll revisit this tomorrow or on monday (if someone else doesn't beat me to it).

@pygy
Copy link
Member

@pygy pygy commented Oct 15, 2017

Yup, PR welcome!

@pygy pygy closed this in 622e009 Oct 16, 2017
pygy added a commit to pygy/mithril.js that referenced this issue Nov 21, 2017
pygy added a commit to pygy/mithril.js that referenced this issue Nov 21, 2017
@pygy pygy mentioned this issue Nov 21, 2017
6 of 10 tasks complete
isiahmeadows added a commit to isiahmeadows/mithril.js that referenced this issue Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants