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

use a global IronMeta instance #24

Merged
merged 2 commits into from
Apr 26, 2016
Merged

use a global IronMeta instance #24

merged 2 commits into from
Apr 26, 2016

Conversation

notwaldorf
Copy link
Contributor

@notwaldorf notwaldorf commented Apr 22, 2016

Use a singleton IronMeta instance instead of creating one for each element.

I've done a global search, and validatorType was never used. Also, it didn't have an observer and was only used in ready, so it's unlikely it ever worked correctly (I think it was intended to be a config time property, before we knew how to document private properties). Similarly for the _validatorMeta (which already looked private-y). I've added notes to them not to be used.

I've also cached the _validator in a computed property, rather than a getter, since the getter gets called in validate(), which could be on every key stroke (for auto-validating inputs). I added a unit test for this.

Performance improvement:
screen shot 2016-04-21 at 5 33 00 pm

I ran tattoo on this branch, and these are the results. Both failures are unrelated to this PR:

Tests for: repos/polymer status: FAILED
Tests for: repos/carbon-storage status: FAILED
82 / 84 tests passed. 23 skipped.

@notwaldorf
Copy link
Contributor Author

@bicknellr ping

@bicknellr
Copy link
Contributor

If you're ok with the breaking-ness of this change, LGTM.

@notwaldorf
Copy link
Contributor Author

For future readers: we couldn't find any users broken by this change, and the code, as it is before this PR, is old (in the sense that it's written before we had a code style for "private", config-only variables) and incorrect (the variables had no listeners, so changing them after creation time did not actually have the effect you wanted). The alternative to not shipping this change is that elements using this behaviour are significantly more expensive than they need to be.

In the very unlikely case this PR will break you, please ping us and we will help with that.

@notwaldorf notwaldorf merged commit fdcb23a into master Apr 26, 2016
@notwaldorf notwaldorf deleted the fix-meta-bonkerness branch April 26, 2016 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants