I agree with the majority here. Starfleet tech has always been depicted as modular. Jettison this, replace that, upgrade this, refit that. The ships can be taken apart and put back together with new parts around their long-serving spaceframes even over the course of several decades.
Also, the arms race in Star Trek has never really been about raw power, it seems to me more about frequencies, modulations, "phase" adjustments and other such babble.
It's not usually "our shields are more powerful than their disruptors, fullstop" it's more about "they're using some kind of oscillating nadion pulse to realign the cycle of their particle phase discriminators, and it's creating an interferametric feedback loop building to an overload faster than our frequency modulation generators can keep up." So it's not really about who can punch harder with blunt force or put up a stronger energy field, it's about making the energy systems learn to blink, twist, flip, dance, focus and re-focus faster such that the energies applied translate through your enemy's technologies in ways their designers haven't accounted for yet.
Similarly with warp speed... I don't get the impression that 24th century warp cores are much "more powerful" than 23rd century or even 22nd century equivalents, realistically it's always going to be about matter/anti-matter reaction rates which would give a fixed amount of output according to the mass of the combined reactants. Technological progress in this area has always seemed to be about how efficiently this energy can be harnessed and used. ie. How focussed is the reaction (advancements in the dilithium crystal assembly), how effectively can the warp field dynamic be calibrated and still maintain a stable warp field (probably nacelle design and super structure come into play here), how to maintain structural integrity fields necessary to protect the ship from the stresses of warping faster (like learning how to treat the Defiant just right so she doesn't shake herself apart, or how the Kelvans were able to shore up the fields protecting the Enterprise so she could sustain super-high warp to Andromeda).
The actual weapon emplacements on the ships are little more than blunt devices simply designed to emit focussed energy in a block of frequency ranges as directed in real time by a computer system. It is not entirely unreasonable that a phaser emitter from, say, fifty years ago might be able to be significantly "upgraded" with nothing more than faster computers, and newer firmware that comes with up-to-date Starfleet "technobabble tricks."
Photon Torpedo launching systems probably haven't changed much in 200 years; it's the ordnance themselves which are constantly upgraded and re-designed. As long as it's tube shaped, they can launch it. The Torpedo really does the rest.
To give you a really mundane contemporary analogy, we have technology today that can generate the same brightness (in lumens) using much less energy (in wattage), but the new bulbs still screw in and fit the old lamp fixtures. Am I right?