I think the clean way to do this would be to add recipes to scrap/disassemble the obsolete stuff back into components (and there are already mods for this).
EDIT: Added a mod that allows you to smelt obsolete junk: https://mods.factorio.com/mod/scrap-smelting