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

Small optimization in render hyperscript.js #2064

Merged
merged 5 commits into from
May 18, 2018

Conversation

magikstm
Copy link
Contributor

Description

No functional change. I read code and noticed it.

Motivation and Context

Minor. Feel free to pull or not.

How Has This Been Tested?

Locally.

Types of changes

Optimization.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated docs/change-log.md

@Gandalf-the-Bot
Copy link
Contributor

Gandalf-the-Bot commented Dec 30, 2017

Warnings
⚠️

Please add an entry to docs/change-log.md.

Generated by 🚫 dangerJS

Copy link
Member

@dead-claudia dead-claudia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mod a small nit

@@ -108,6 +104,7 @@ function hyperscript(selector) {
var normalized = Vnode.normalizeChildren(children)

if (typeof selector === "string") {
var cached = selectorCache[selector] || compileSelector(selector)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind combining this with the next line, to save a temporary variable? (Your patch is more so optimizing space than speed, BTW.)

@magikstm
Copy link
Contributor Author

Thanks for the review. I adjusted it.

I'm having trouble to squash commits in github with the command-line tools or SourceTree. :(

@pygy
Copy link
Member

pygy commented Dec 30, 2017

@magikstm The "Sloppy mode" comment was paired with the line you moved. I don't even remember why it's there (I used to, I thought I had made it more meaningful but that PR was probably not merged).

@dead-claudia
Copy link
Member

dead-claudia commented Dec 30, 2017 via email

@magikstm
Copy link
Contributor Author

Thanks. I just removed the comment.

@dead-claudia
Copy link
Member

@magikstm If you're okay working from the CLI, there's git log to display info about commits, and git rebase ${ref} -i/git rebase ${ref} --interactive to interactively modify the history. I do that quite frequently when working with patch sets to trim the commits down to something a little more logical and workable.

@pygy
Copy link
Member

pygy commented Dec 31, 2017

@isiahmeadows I'm not against dropping IE 9 (and 10) support, given how marginal it has become, but I didn't know this was planned.

OTOH given the onpopstate bugs in IE 11 (IIRC) I'm not sure it buys us much.

@magikstm
Copy link
Contributor Author

@isiahmeadows I'm unfortunately a bit limited with the Git CLI. I use it a bit, but usually use SourceTree. I'm not that used to squashing commits. It's a feature of Git I have to learn more.

Could you do it before a merge or after it?

@dead-claudia
Copy link
Member

dead-claudia commented Dec 31, 2017 via email

Copy link
Member

@barneycarroll barneycarroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much nicer IMO 👍

@pygy pygy merged commit 6097cfb into MithrilJS:next May 18, 2018
@pygy
Copy link
Member

pygy commented May 18, 2018

Here we go!

Thanks @magikstm

barneycarroll added a commit that referenced this pull request May 29, 2018
barneycarroll pushed a commit that referenced this pull request May 29, 2018
* Do not normalise component children on ingestion

* Don't normalise vnode children

* Component hyperscript tests: children aren't normalised

* test, not text

* Update change log: #2155 & #2064
dead-claudia pushed a commit to dead-claudia/mithril.js that referenced this pull request Oct 12, 2018
* Small optimization in render hyperscript.js

* Remove temporary variable

* Small optimization in render hyperscript.js

Squashed commits:

[5b10329] Small optimization in render hyperscript.js

* Remove sloppy mode comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants