3.The treaty port era (1842-1949). The Treaty of Nanking that ended the opium wars between China and Britain marked the beginning of a new era in Chinese urban form by permitting foreigners to live and carry out business in treaty ports (such as Shanghai) that were extra- territorial enclaves adjacent to Chinese cities. Sections of cities were remade along Western lines, with new factory districts, commercial areas and residential neighbourhoods of single-family homes. During the treaty port era and the republic era (1911-49) cities expanded in terms of population, physical extent, trade and industrial production. Western architecture became increasingly prevalent. City walls were modified or removed to accommodate growth pressures and to relieve congestion. An influx of migrant labour led to the formation of districts of poorly serviced informal housing on the outskirts of cities.