Pex up to the shower valve is okay (if you size it properly), but it may not be the best after the valve. Pex, copper, and most things expand and contract. You just don't want the stuff stretched tight like a banjo string. A little slack is all that is required - no big loops needed. PVC and cpvc expand and contract much more than pex does, and on long runs, needs special consideration.