It often happens that a country, however powerful, goes through a rough patch. So it has been this week for China, given the setback of sorts in almost quick succession. First, the President-forlife, Xi Jinping, could scarcely imagine that Donald Trump would pass legislation in support of prodemocracy protesters in Hong Kong. Indeed, China has criticised the bill as one that is marked by America’s “prejudice and arrogance”.

Not wholly unrelated has been the second development, verily the pro-democracy landslide in Hong Kong’s local elections. Yet another damning development was the publication of leaked documents exposing the inhuman condition of internment camps in Xinjiang, where at least a million Uighurs and other Muslims are believed to be detained in a grotesque travesty of human rights.

From Hong Kong to Xinjiang, therefore, it has been a sordid narrative that will not be easy for the leadership in Beijing to digest. On closer refection, the week has been rather distressing with fresh support for the pro-democracy upheaval and detailed evidence of the repression in the north-western region. China’s strongarm praxis has already been challenged by the trade war and sluggish economic growth, now at a 27- year low.

President Trump has previously made it clear that he regards Hong Kong’s protesters as leverage, and has shown he does not want this law to hinder a trade deal that both sides need and appear to be close to agreeing. China is hoping he will not implement the law, which envisages sanctions on individuals and the revocation of the region’s special trade status, if annual reviews find that it has not retained sufficient autonomy.

Having said that, the passage of the Hong Kong Human Rights and Democracy Act may prove to be critical to the shift in US attitudes towards China. Mr Trump’s political opportunism has played a part; so has the “clash of civilisations” mindset of some of those around him. But the shift has taken place across the political spectrum and it is not primarily about what has changed in America, but what has changed in China, specifically its ever-increasing authoritarianism under Xi Jinping.

Western engagement with China rested largely on a blithe and now utterly discredited assumption that economic liberalisation would bring political freedoms. The bilateral relationship is responding to the change in China’s relationship with its own people. The change is bound to bear on geopolitics. China’s tightened grip has been seen most clearly on its periphery, notably in Xinjiang and Hong Kong.

Forbidding is the challenge posed by two very different factors, albeit simultaneously ~ the Muslim minorities and the pro-democracy upheaval. China’s economic liberalism and the CPC Third Plenum’s endorsement of market economy have not translated to democratic freedom in Hong Kong, let alone a humane policy towards the Uighurs. The accounts of abuse and torture in the detention camps are horrifying.