Specifically, shortened method definitions don’t seem to work for methods with attached ember observers.
For example, if you shorten the
initSizeWatcher method declaration in the
head_tag.html file in the Header Search theme, you’ll get
SyntaxError: unknown: Unexpected token, expected , (33:3)
EDIT: ah nvm, this is also the case with JS in a plugin. I just haven’t noticed it before
Yeah sorry for the somewhat vague comment.
The only generally applicable issue (from my limited understanding of themes) is that you can’t add settings and translations with a theme component. The Header Search Plugin has a setting -
override_extra_info: "Show the search box in the header instead of the topic title when scrolling on a topic" - which I removed for the theme. There is a decent possibility the Header Search feature would benefit from other settings and translations.
Somewhat more vaguely, I have the sense that there are probably more limitations with themes that will arise if I try to extend the Header Search feature functionality in the future. Adding more and more JS to the Head in this fashion doesn’t feel very future proof. Maybe this feeling is unjustified.
If theme components are the way to go for functionality like header search (which shouldn’t really be the subject of ‘user choice’), it may help to have a setting that lets you automatically include a component in all themes; i.e. a ‘default / universal component’ setting.
What I actually had in mind with the reference to ‘advantages’ when using multiple themes and plugins was something quite specific to me. I have 25 different plugins at once on one instance (and will have more in the future). Keeping them all as plugins, rather than a mixture of plugins and themes makes them easier to manage, for example a number of my plugins share CSS classes so I have a ‘global plugin CSS’ approach I’m trying to cultivate. Also, I’m finding it convenient to share custom frontend libraries I’ve written between plugins themselves, which is easier to manage if everything is a plugin.
cc @tophee (re your question in another topic)