Lovelace and !include - revisited

I’m keen to reuse the same chunk of dashboard code in several dashboards/views. I’ve read some old posts which talk about !include, which seemed like a perfect solution. However I understand that in recent times dashboard code has moved away from static YAML files, so !include no longer works. I’ve seen that you can change the configuration of HA so that you can continue using YAML for dashboards, but I’m concerned that if I did that I would be moving away from the standard way of working and so would miss out on functionality in future. Or is switching the UI into YAML mode a reasonable safe/future-proof way of doing things?

Alternatively, is there a new way of reusing code/elements/views within different dashboards?

Thanks for helping me work this out!

Looking for this too. My searches don’t seem to have yielded any solutions (esp define and auto update when changed). Basic part of good UI architecture. Send like a no-brainer to support natively and shouldn’t be that difficult to develop.

@pmjones did you ever find a solution for this?

No. I resorted to cut and paste, so have to remember to re-do it every time I tweak my code. Maybe a future feature?