I've yet to wash my JK's engine bay, but have kept many other vehicle's engine bays clean over the years. It used to be a labor of love for me, but I like to see my JK dirty. :rock:
I've found using cheap car wash soap (in a refillable spray bottle) sprayed on a cool wet engine bay works great for keeping things clean on a regular basis. I like the foaming Gunk engine cleaner for areas that are wet with grease or oil. I also hand wash much of the plastic covers and painted areas that can be reached, if it's been a while between cleanings. I've used Simple Green to clean very dirty areas, but find that it leaves the plastic and rubber looking dull with a white haze. Maybe I didn't have it diluted enough.
Like others have said, avoid high pressure water and spraying directly on certain parts that are susceptible to water.
Another thing I'd add, I start the engine and let it run for a few minutes after I spray the engine bay. I have found that letting the engine run and warm up dries things like the alternator and prevents unwanted corrosion. I've replaced a few alternators in the past that seemed to fail prematurely that I contribute to getting them wet during detailing, and then letting the vehicle sit, sometimes overnight. I've not replaced one since doing the start-up after washing. *Knock on wood*