Ed Gillespie on Nov. 7 in Richmond. (Ricky Carioti/The Washington Post)
Opinion writer

A competent political observer could have predicted the winner of Tuesday’s Virginia gubernatorial election a year ago. After months of President Trump in the White House, a state that leans blue and contains a relatively well-educated population was bound to elect the Democrat. And that Democrat was likely to be Lt. Gov. Ralph Northam. What no one could have reasonably predicted is the sheer scale of the Democrats’ victory.

Northam won by nine points. In a truly massive wave, the Democrats have also taken or have come close to taking the Virginia House of Delegates, eviscerating the GOP supermajority that has ruled the chamber. These shocking results might say a lot about the politics of the next few years.

Trump has not discovered some magic political formula that will build a big or enduring GOP majority. Virginia Republican gubernatorial candidate Ed Gillespie blanketed the airwaves with noxious attack ads about Latin American gangs, dangerous criminals, sanctuary cities and Confederate monuments. If Gillespie overperformed with his campaign of shallow nationalism and racialized appeals, it would have shown that “Trumpism without Trump” could work in purple or even blue states. But Gillespie lost Virginia by a significantly larger margin than Trump did a year ago.

Republicans must now worry that Trumpism does not turn out GOP voters in the numbers needed to offset Democratic anti-Trump enthusiasm. Republican candidates anywhere near a swing district should find something other than fear and division to run on, both for their own sakes and for the good of the country.

Tuesday’s results also indicated that Democrats will turn out in next year’s congressional elections. They do not need a Bernie Sanders on every ballot to convince them to show up and cast a vote against Trump. Northam certainly was no democratic socialist. Moderates, meanwhile, will have an easier time supporting temperate Democrats rather than lefty ones. Democrats should recruit a wide variety of viable candidates — not only those who can pass an ideological litmus test — to run in a wide variety of districts — not just ones that seem swing-y.

Meanwhile, the big swing in the Virginia House of Delegates offers another warning to Republicans: They might lose control of the crucial redistricting process in coming years. If Democrats make big gains in statehouses across the country in 2018 and 2020, they could lock Republicans out of power for a decade, because they would be in charge of rewriting electoral maps. Democrats would have little hesitation or remorse: Republicans brutally gerrymandered them during the last cycle. While Republicans still hold a commanding advantage in state legislatures, they should create nonpartisan redistricting boards that would draw the lines fairly in their states in future years. This would not only hedge against the risk of future Democratic gains; it would also make U.S. politics substantially more just.

It would be easy for Democrats to get too exuberant after Tuesday. But Republicans face a bigger danger if they do not learn the night’s lessons. Hitching themselves to Trumpism will be a risky electoral strategy for many. It simply is not worth the price in humiliation and debasement.