I wouldn't say that TY are frowned upon, but what will you do with the TY if you don't match Ophtho? My understanding is that a PGY1 IM year may be able to count fully towards an IM residency, but a Transitional PGY1 may not transfer as well if you don't get Ophtho.
I would disagree with DK on when to do your PGY1. Personally I would recommend you do the PGY1 year first, before a research year in most situations. Try to do it at a good IM program (or Peds if you might be leaning that way). There are spots that open up for PGY2 Ophtho slots, you might get lucky and get one. You can then do the research year after that if you don't match. Do a good job in your first couple of months of the PGY1 and get a good letter from your program director.
That said, this decision is complex and will depend on factors like USMLE scores, class rank, etc. If someone is a really poor candidate, they may have to do more Ophtho stuff directly at a program with the hope of impressing them and getting a spot at that institution. Sorry if that muddies the water a bit.