Granted now this is just my personal POV, but here's how I feel that Treknology goes.
22nd Century: Galleys and Chefs for Food. Machine Shops to build parts.
The more prestige the captain has, the better the chef, which means the more varied the food choices, the happier the crew, because the cooking is better. The Machine Shops create parts at a very slow rate, and the quality of the part is dependent on the Engineer making the part. Both of these methods have a lot of waste involved in them, raw materials were stored in bulk, but if you had the raw materials, you could build it. Because Machining the appropriate repair parts took time, some critical components were made in advance and stored in the cargo bays. You could not machine parts as needed in the middle of combat.
23rd Century: Food Selectors for Food. Industrial Fabricators for parts.
In an attempt to raise the selection and quality of food around the fleet, the various starfleets all attempted the use of a selector. In essence a primitive Replicator, it had a limited menu. Which didn't make the crews all too happy. Not nearly as much waste as involved with Galleys, but Food left over from a meal was wasted. Industrial Fabricators could build parts faster than a Machine Shop could, but again, not fast enough for combat purposes. You had less waste involved in the process, but the parts were still dependent on the skill of the engineer fabricating the parts.
Late 23rd Century: A return to Galleys. The limited selection of the Replicator brought back Galleys and chefs, with all the same problems as the 22nd Century starships.
24th Century and Beyond: Replicators
In essence 24th Century Starships carry two types of replicators. An Industrial Replicator and a Food Replicator. The difference between the two is almost insignificant. An Industrial Replicator is larger, and less able to make the fine adjustments that the food replicator can make. Its great for making Weapons, Parts, etc. But don't ask it to make anything organic. The Food Replicator handles the organic compounds along with minor items like plates and flatware. The use of replicators greatly reduced the amount of waste aboard a starship, as anything that wasn't eaten, or used with the part, could be recycled back into its base component to be used later. It would be a misconception to say that every stateroom on a starship had a replicator, rather they had special transporter transceivers that the primary replicators would use to send and receive. Which is why it would be a relatively simply thing to order a 10 oz T-Bone steak, and then five minutes later replicate a Phaser. The Steak is made in the food replicator and then beamed to the terminal, while the Phaser would be made in the Industrial Replicator and then beamed to the same terminal.
Granted this is the Federation Side of the things, I imagine similar developments were made in the Romulan and Klingon spheres. Although the emphasis might have been different at times.