Two months ago, President Trump tweeted that costs for Boeing's (BA) planned Air Force One replacement were "out of control." He said the program should be cancelled.

Since that Dec. 6 tweet, Boeing CEO Dennis Muilenburg has met with Trump twice, first in Florida and then in New York.

On Friday, Trump will visit Boeing's plant in North Charleston, S.C., for the rollout of Boeing's newest aircraft, the 787-10.

If nothing else, the sequence of events demonstrates Muilenburg's diplomacy skills. He has made lemonade from lemons.

Trump's tweet on Dec. 6 wasn't his first negative interaction with Boeing.

The North Charleston visit comes one year to the day after then-candidate Trump blasted Boeing for its plans to build a manufacturing facility in China, The Charleston Post and Courier pointed out Thursday.

"During a campaign stop in Walterboro, Trump charged the overseas facility would be the first step toward Boeing leaving South Carolina 'to make all their planes in China,'" the newspaper reported.

"Boeing just had a big order from China," Trump said during the Feb. 17, 2016, speech. "But China is making them build a massive airline facility. Right? Massive. Like bigger than anything you've seen. OK, you feel good about Boeing right now? Tell me in five years."

By this morning, Trump was feeling better about Boeing.

He tweeted, "Going to Charleston, South Carolina, in order to spend time with Boeing and talk jobs! Look forward to it."

Boeing arrived in North Charleston in 2011. It now builds 787s at the plant and employs 7,000 people. The Charleston economy has obviously benefited.

The story also has a divisive side. Boeing set up in South Carolina as part of an effort to diversify beyond its long-time manufacturing base in the Seattle area. That site is heavily unionized. The International Association of Machinists represents about 35,000 Boeing employees, mostly in Washington.

It may be said that the 787 Dreamliner represents an engineering miracle and a management disaster.

The airplane has extended the range of commercial flight because its relative light weight means it can fly as far as larger aircraft while carrying less fuel.

For instance, in 2014 United flew a 787 on the 6,587-mile trip from San Francisco to Chengdu, China, the first commercial flight ever from the continental U.S. to interior China. The market, at least initially, did not have enough passengers for a bigger aircraft.

But Boeing's mismanaged effort to sidestep unions and establish a global supply system resulted in extremely high costs. Today, the 787 program has about $30 billion in deferred costs.

On Tuesday, about 3,000 North Charleston Boeing production workers beat back an IAM effort to unionize them in a lopsided vote with 74% against unionization.

Trump's relationship with transportation industry unions remains unclear, but in general Republicans, who dominate South Carolina politics, have opposed unionization.

So far, Boeing has delivered 513 Dreamliners, all 787-8s and 787-9s.

Watch More: Trump Finds a New Way to Measure his Presidency: the Stock Market

 Unlike its predecessors, the 787-10 will be assembled only in North Charleston. This is because the plane's mid-fuselage section is too long to fit into the Dreamlifter cargo aircraft that typically transports sections between North Charleston and Everett, Wash.

The 787-10 will be the biggest aircraft in the 787 family, 224 feet long with seating for about 330 passengers. It will also have the shortest range, about 6,430 nautical miles. Boeing began taking orders in 2013 and now has 154 of them. Launch customer Singapore Airlines expects its first aircraft in 2018.

This article is commentary by an independent contributor. At the time of publication, the author held no positions in the stocks mentioned.

More from Investing

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Inside Carnival's Mind Blowing New Horizon Cruise Ship (Video)

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

Neel Kashkari: The Heart of Our Financial System Is More Radioactive Than Ever

McDonald's Criticized for Not Doing More in Wake of Sexual Harassment Claims

McDonald's Criticized for Not Doing More in Wake of Sexual Harassment Claims

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Finding Stocks Right for You: Cramer's 'Mad Money' Recap (Friday 8/25/18)

Jim Cramer: The 10-Year Yield Could Go to 2.75%

Jim Cramer: The 10-Year Yield Could Go to 2.75%