Gavin Newsom’s ascent to the governor’s office was all but assured after the state’s top-two primary. His most formidable challenger, fellow Democrat and former Los Angeles Mayor Antonio Villaraigosa, failed to advance to the general. The anemic Republican faction was led by John Cox, a recent California transplant with the Chicago accent to prove it.

A repeat political also-ran in Illinois, Cox shredded any chance he had in the fall by awkwardly embracing Trumpism to get through the June primary.

Newsom, in contrast, looked to be in the right place at the right time. Although a business-friendly moderate by San Francisco standards, he will become a nationally prominent progressive as the leader of a state at loggerheads with Washington over the environment, immigration, health care and more. He has already been gleefully trading insults with Trump on Twitter.

If Newsom wasn’t challenged much in the campaign, he surely will be in office — and not just by a Trump administration that has been trying to undermine state laws.

As governor, Newsom will be measured less by his skill as a rhetorical critic to President Trump and more by his ability to deliver on his voluminous promises to Californians. The politician who loves to employ the word “audacious” will need to govern with audacity.

He has promises ranging from universal health care to early-childhood education to a restoration of the redevelopment funding eliminated by the selectively frugal Gov. Jerry Brown. None of that will get any easier if, as many experts and the current governor expect, he faces an economic downturn.

Newsom has also advocated the construction of 3.5 million new homes by 2025, which is ambitious to say the least. California, which ranks 49th among the states in housing per capita and has about a quarter of the nation’s unsheltered homeless, is on pace to build about a sixth that many homes over the next seven years. Changing that ruinous trajectory should indeed be the governor’s highest priority, but any substantial progress will require taking power away from the local officials who typically stand in the way of high-density urban and suburban housing development.

The new governor will also contend with a volatile and lopsided tax structure, an underfunded public education system, long-term liabilities for retiree benefits and competing demands for a limited water supply. Wildfires are growing more destructive. The Department of Motor Vehicles is broken. And the high-speed rail project Newsom has alternately supported and opposed is in precarious shape.

As mayor of San Francisco, Newsom had a penchant for a drifting attention span when his ambitious policy proposals encountered the reality of budget constraints and progressives on the Board of Supervisors who were determined to undercut him at every turn. The Gavin Newsom of 2018 maintains distinct strains of idealism and wonkiness, but without the outward hubris and disdain toward adversaries that made him such an irresistible target in City Hall. He also will go into office with solid Democratic majorities in the State Senate and Assembly.

The governor-elect could not hope for a better economic or political environment to pursue his robust agenda. His campaign of bountiful optimism and big-dollar promises will now be tested in the realities that have often tempered and sometimes humbled the great expectations of his predecessors.

This commentary is from The Chronicle’s editorial board. We invite you to express your views in a letter to the editor. Please submit your letter via our online form: SFChronicle.com/letters.