Sen. Ted Cruz endorsed GOP primary rival and now presidential nominee Donald Trump on Friday. (Photo by Chip Somodevilla/Getty Images)

Ted Cruz's endorsement of Donald Trump's presidential candidacy sets up a very delicate dance over the next 46 days -- with the Texas Republican senator's political future hanging in the balance.

On the most basic level, Cruz's move makes sense. He wants to run for president in 2020 -- or 2024 -- and you can't do that if you don't vote for the party's nominee this time around. (So, breaking news, Jeb! Bush isn't going to be the Republican presidential nominee.) Cruz is neither a) dumb nor b) politically naive. He knows that supporting Trump is a sine qua non for his chances of running for and winning the Republican presidential nomination down the line.

So, he did it. "A year ago, I pledged to endorse the Republican nominee, and I am honoring that commitment," Cruz wrote in a Facebook post announcing his decision Friday afternoon. "And if you don’t want to see a Hillary Clinton presidency, I encourage you to vote for him."

Thus begins a debate within the Republican Party over what this endorsement says about Cruz and whether it helps or hurts his own prospects of winning the Republican presidential nomination in the future.

Start here: Cruz's high-profile snubbing of Trump in a speech at the Republican National convention did two things. First, it made the Trump forces -- and many rank-and-file Republicans -- very angry.  Second, it set him up to make the case that he was the only principled conservative who stood his ground during the Trump-ing of the GOP in 2016.

Ted Cruz was being loudly cheered by many of the delegates at the Republican National Convention on July 20 – until he urged voters to "vote their conscience." Photo by Michael Robinson-Chavez/The Washington Post (Peter Stevenson,Sarah Parnass,Jorge Ribas,Alice Li,Dalton Bennett/The Washington Post)

What Cruz is trying to do in acknowledging his support for Trump is split the baby. He wants to appease rank-and-file Republicans who saw his non-endorsement as evidence that he cared more about himself than the broader GOP while also maintaining the perception that he is first in line when it comes to being committed to conservative core principles.

That's a VERY delicate dance -- and one that the early evidence suggests won't be easy for Cruz to perform.

The challenge for Cruz is to be just supportive enough of Trump to signal to base Republicans that he is committed to the party and not just himself while not being so supportive that all of his past rejections of Trump and Trumpism aren't seen as the sort of political hypocrisy people hate.

And, remember, Cruz's denunciations of Trump weren't only loud. They were very, very public.

There was this one -- when Cruz called Trump a "sniveling coward":

And this one -- where Cruz deemed Trump a "pathological liar," "utterly amoral," "a narcissist at a level I don't think this country's ever seen" and "a serial philanderer":

There were lots and lots more. And they came in response to a number of remarkable actions by Trump -- from retweeting an unflattering picture of Cruz's wife to overtly suggesting that Cruz's father was involved in the assassination of John F. Kennedy. (Writing that sentence reminded me that this has been one hell of a campaign.)

Given all that has been said and done between the two, Cruz risks giving up all credibility as a committed conservative who stands on principle if he comes out -- or is perceived as coming out -- too vocally for Trump. How can you actively support someone who a) insinuated your wife is unattractive b) said your father might be involved in the assassination of an American president c) labeled you "Lyin' Ted"?

Or, viewed another way, how can you vocally endorse someone whom you called "a serial philanderer"  and a "pathological liar" 143 days ago? (Cruz made those comments on May 3, the day of the Indiana primary.)

To be clear: Cruz will never be the first (or second or third) choice of the most devoted Trump supporters in either 2020 or 2024. That will either be Trump or, if Trump loses in November, Mike Pence. Nothing Cruz says or does will change that. But that's less important to Cruz's political future. What really matters is that with this endorsement he avoids being viewed as a pure political opportunist by the average Republican voter.

Cruz's great strength in the 2016 race -- and in any future presidential contest -- was/is his seemingly unflagging commitment to the foundational pillars of conservatism. People who supported -- and support -- the Texas Republican did so because they believed he actually believed what he said about the country and where it needed to go in the future. And that he wouldn't change those views based on which way the political winds were blowing.

Any erosion of the "principled conservative" brand is a disaster for Cruz's future political prospects. That's why the "why" and "how" of this Cruz move matter -- a lot. And why it's a very complicated gambit he is trying to pull off.