It’s now almost a generation since Californians tried to make their state like the country that Donald Trump wants America to be.

We didn’t say we’d prefer Norwegians over Haitians or Africans — or Mexicans. But with Proposition 187 (“Save Our State”) in November 1994, we voted by a margin of 59-41 to deny almost all public services to undocumented immigrants, including public education, all but emergency care from any public health facility, and all social services.

Proposition 187, which had the strong support of Gov. Pete Wilson, who linked his re-election campaign to it, also required public employees — cops, teachers, doctors, nurses, among others — to notify federal immigration officials of any undocumented immigrants who came to their attention.

And in a familiar refrain, Proposition 187 declared that the people of California “have suffered and are suffering economic hardship caused by the presence of illegal aliens in this state [and] have suffered and are suffering personal injury and damage caused by the criminal conduct of illegal aliens in this state.”

A federal judge declared major parts of the initiative unconstitutional, so it never went into effect, but not before Wilson rode it to his re-election victory. Part of that successful campaign was Wilson’s TV commercial of shadowy figures running across a freeway against the ominous words “They keep coming. ... Two-million illegal immigrants in California.”

Proposition 187 was just one of a cluster of California ballot measures that Trump and his attorney general, Jeff Sessions, would have cheered. On the same ballot in November 1994, voters passed Proposition 184, California’s “Three Strikes” criminal sentencing initiative, probably the most punitive such law of modern times.

Two years later, we enacted Proposition 209, banning all affirmative action by race or gender in public education, employment and contracting. That also had Wilson’s strong backing.

It goes without saying that California is in a very different place now. Things we ordered police officers and teachers to do in 1994, California’s sanctuary laws prohibit them from doing now.

Instead of lengthening criminal sentences, high prison costs have produced measures to reduce them. We’ve legalized marijuana; we allow undocumented university students to compete for financial aid on the same terms as all others. Our attorney general sues the federal government to protect Deferred Action for Childhood Arrivals individuals.

As many Californians know, there’s a direct link between the California of the 1990s and California now. Proposition 187 drove hundreds of thousands of Latinos to become citizens. And, given the ill-disguised hostility of Wilson and the Republican Party to immigrants, they immediately registered as Democrats.

Since Wilson’s re-election, only one Republican, Arnold Schwarzenegger in the quirky recall of Gov. Gray Davis in 2003, has been elected governor. Today, a Democrat holds every major state office. The California congressional delegation is composed of 39 Democrats and 14 Republicans — and several Republicans are in trouble. Two are quitting.

More important, despite recent tax increases and tough environmental laws, blue California, the world’s sixth-largest economy, has been outperforming the rest of the nation. Between 2012 and 2016, California accounted for 17 percent of U.S. job growth. In 2016, its gross domestic product grew at nearly twice the rate of the national economy. Some of that growth, maybe much of it, has been driven by the enterprise and skills of its immigrants.

Combine all that with the state’s tough environmental laws, its energy efficiency, its commitment, rather than its resistance, to science and research — and California, despite its many unsolved problems, becomes the best available model for an alternative to Trump’s America. We’ve been there and have come out of it. And unlike Congress and Trump’s White House, California’s government works.

All of which give California no end of reasons to resist the Washington of Trump, Paul Ryan and Mitch McConnell, as the state’s leaders have been doing — and which, in turn, have drawn Washington’s attacks on every possible California target, from taxation, immigration and offshore drilling to marijuana controls and greenhouse gas emissions.

It may not be quite “the war on California,” which is what state Senate President Pro Tem Kevin de León, D-Los Angeles, called it, but close enough. For Americans, even in red states committed to state’s rights, there couldn’t be a clearer choice.

Peter Schrag, a former editorial page editor of the Sacramento Bee, is the author of “California Fights Back: The Golden State in the Age of Trump,” forthcoming Jan. 22 from Heyday Books.