mirror of
https://github.com/discourse/discourse.git
synced 2025-02-12 06:14:54 +00:00
Why this change? Prior to this change, the `SchemaThemeSetting::Editor#tree` was creating a new `Tree` instance which holds instances of `Node`. Both classes consisted of tracked properties. The problem with this approach is that when any tracked properties is updated, Ember will revaluate `SchemaThemeSetting::Editor#tree` and because that method always return a new instance of `Tree`, it causes the whole navigation tree to rerender just because on tracked property changed. This rerendering of the whole navigation tree every time made it hard to implement simple features like hiding a section in 9baa820d53757aec36e4cb86efab8d0bb3f264c0. Instead of being able to just declare a tracked property to hide/show a section, we end up with a more complicated solution. This commit rewrites `SchemaThemeSetting::Editor` to depend on Ember components to form the tree structure instead. As needed, each component in the tree structure can declare its own tracked property as necessary.