-
Notifications
You must be signed in to change notification settings - Fork 28
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
CustomElement: make computeProperties() / refreshRendering() report changes to function/class properties too #314
Comments
Hmm, the goal was to avoid watching changes on plain methods like Perhaps this test, but it doesn't cover all cases: Object.keys(func.prototype).length > 0 We can also detect a Object.keys(func).advices !== undefined Note that |
Yes I realized that but then I wondered if in practice this was happening? Do we actually change method implementation? (I mean except if a very rare cases?). |
No. I skipped functions just to avoid the cost of setting up listeners (which would rarely or never be called). We could of course try to set up listeners on all widget properties. Maybe the cost is not prohibitive, since they are only setup on the prototype, not on each instance. |
The cost is not just the time (and memory) used to create custom setters/getters, but also, every widget method call would first call the custom getter for the method name. I suppose that's no worse than our current accesses to scalar widget properties. |
Also changed the naming of the shadow properties to avoid a conflict where the getTextDir() property got a shadow property called _getTextDirAttr(), which looked like a custom getter for the textdir property. This shouldn't affect existing code assuming it uses this.get("prop") rather than using the name of the shadow property directly. Fixes #52 and refs ibm-js/delite#314.
This issue was created when I realized changing the
itemRenderer
property on delitefulList
had no effect.itemRenderer
property on delitefulList
is referencing a defaultItemRenderer
.An example is:
An easy workaround is to not have a default value for the property. But I'm wondering is something can be changed at delite level so people don't have to bother about that.
The text was updated successfully, but these errors were encountered: