Plasma applets to support both Plasma 6 and 5 on the same code base?

I’m trying to port an applet (that I did not originally write) to Plasma 6, while I’m using my current user account (home directory) with both Plasma 6 and Plasma 5 interchangeably, and I’m having difficulties with getting the same widget to load correctly in both environments.

Is it true that in order to port a Plasma applet to Plasma 6 it has to be rewritten in a way that makes in incompatible with Plasma 5 and there is no way to create an applet that works in both Plasma 5 and Plasma 6, or am I missing something important?

If it should be workable, can you share some tips - or possibly an example - of a Plasmoid that works in both Plasma 5 and 6?

The first thing I bumped my head into is the requirement to use a PlasmoidItem as the root QML element which as far as I can tell is not a thing that exists in Plasma 5 (even though import org.kde.plasma.plasmoid 2.0 works?).

I hope you’re wrong about applets having to be rewritten cause I can see a lot being lost. Too many examples where major changes to something cause the loss of a lot of subcomponents. Firefox for example when they last changed their extensions engine. They screwed up so badly that there are still a ton of what were great addons that still haven’t figured out how to port over to the new code.