ember-nf-graph icon indicating copy to clipboard operation
ember-nf-graph copied to clipboard

"You modified ... twice in a single render" deprecation warnings

Open jamesarosen opened this issue 10 years ago • 2 comments

Running on Ember 1.13, I get the following deprecation warnings about modifying a property twice in a single render:

  • graphHeight due to xAxis
  • graphWidth, due to yAxis
  • [d] for unknown reasons

I tried changing some of the components' init hooks to didInitAttrs, but that breaks because their parent components expect them to exist during initialization.

See also emberjs/ember.js#11156

jamesarosen avatar Sep 13 '15 23:09 jamesarosen

Brace yourself, this will be redundant but it's worth laying out exactly what's happening.

The nf-graph renders, yields to it's block. In that block, we have our nf-(xy)-axis, when that axis is initialized it sets itself on the nf-graph component. The nf-graph component has a computed property for graphHeight and graphWidth. One of the dependentKeys is the height of the nf-(xy)-axis. The timing of this, is such that, when the nf-(xy)-axis is initialized, the nf-graph is mid-render. The graphHeight recomputes, and the height={{graphHeight}} in the nf-graph template changes, raising the deprecation warning.

zkwentz avatar Nov 18 '15 18:11 zkwentz

Yeah, this is a biproduct of having the scales contained at the nf-graph level, and not defined by the nf-(xy)-axis components, which is probably where they should be.

I'm open to any solution that can be provided. We're still stuck on Ember 1.11 - 1.12 on our apps on my team at Netflix because of other deprecation issues and breaking changes, so I haven't seen this since I tried (and failed) to upgrade to 1.13.

benlesh avatar Nov 18 '15 20:11 benlesh