In the modern world, the ability to manipulate and control electromagnetic waves has greatly changed people's lives. Novel optical and electromagnetic phenomena and devices will lead to new scientific trends and techniques in the future. The exploration of new theories of optical design and new materials for optical engineering has attracted great attention in recent years. Transformation optics (TO) provides a new way to design optical devices with extraordinary predesigned functions such as invisibility cloaks and electromagnetic wormholes. As the development of artificial electromagnetic media (e.g. metamaterials and metasurfaces) progresses, many of these novel optical devices designed by TO have been experimentally demonstrated and used in specific applications. Starting from the basic theory of transformation optics, we review its applications, extensions, new branches and recent developments in this paper.