When it comes to landing in the crosshairs of President Donald Trump, Silicon Valley has plenty of experience. 

The war of words began early on the campaign trail. Trump first  went after Facebook Inc. (FB) CEO Mark Zuckerberg for his views on employing foreign workers. Next up was Amazon.com Inc. (AMZN) CEO Jeff Bezos, who Trump claimed was using his ownership of the Washington Post as a "big tax shelter" for Amazon. Apple Inc. (AAPL) wasn't safe, either, after it refused to help the FBI break into the iPhone of one of the San Bernardino shooters, prompting Trump to call for a boycott of the Cupertino-based company's products. 

Boycott all Apple products until such time as Apple gives cellphone info to authorities regarding radical Islamic terrorist couple from Cal

— Donald J. Trump (@realDonaldTrump) February 19, 2016

In turn, tech companies have criticized Trump's moves on immigration, the Paris Climate Accord, net neutrality rules and his response to the attacks in Charlottesville, Virginia. Facebook, Alphabet's (GOOGL) Google, and Twitter (TWTR) have also joined hundreds of other tech companies in signing legal challenges that oppose Trump's decision to end the Deferred Action for Childhood Arrivals (DACA) program, as well as his executive order on immigration.

In the year since Trump was elected, however, the rift between the president and Silicon Valley hasn't amounted to much more than a strained relationship with the occasional flare-up on Twitter. 

No deals have been squashed yet, no companies have been forced to move factories to the U.S. and no "internet tax" has been enacted. 

"Trump is all about big business," said Tim Bajarin, president of tech research firm Creative Strategies, who has followed the tech industry for more than 30 years. "In general, we haven't seen him really try to thwart anything." 

Of course, Trump has more than three years left in his term and things could well change. One foreboding indicator: The Department of Justice's demand that AT&T (T) sell either CNN or Turner Broadcasting to win regulatory approval for its $85.4 billion acquisition of Time Warner (TWX) . Jonathan Taplin, a professor at the USC Annenberg Innovation Lab, said the decision seemed like a political move, given Trump's very public animosity toward CNN.

The acquisition may involve two telecom companies, but it could have far-ranging implications for any potential deals involving tech firms. Tech giants have to be increasingly careful not to antagonize trump, should they ever need anything from him or in Washington D.C. more broadly. So while Amazon was lucky that its $13.7 billion acquisition of Whole Foods Market went through without a hitch, others might not be so lucky in the future. 

"If the attorney general for antitrust is able to carry Trump's water on AT&T and Time Warner, that means he'll carry Trump's water on just about anything," Taplin explained. "And we've all heard Trump talk about the 'Amazon Washington Post' being his least favorite newspaper." 

Decoding Trump's next move appears to be largely dependent upon which adviser currently has Trump's ear. For example, Steve Bannon, who served as Trump's chief adviser until he was ousted in August, was a vocal supporter of regulating Facebook and Google as utilities. It's unclear how exactly that would affect their businesses, but it might mean they would have to be more forthcoming with user data.

Bannon, who is said to still wield some influence with Trump, also espouses many protectionist and nationalist ideas. That's a threat to many Silicon Valley companies who maintain operations overseas and rely on foreign workers for some jobs.

That being said, tech companies do have an ally in the White House -- billionaire investor and PayPal (PYPL) co-founder Peter Thiel may have had a hand in Trump backing off of tech, according to some. 

"There is one tech card that maybe helped moderate things and that's Peter Thiel," said Creative Strategies' Bajarin. "He's taken a lot of flak for supporting Trump, buy my suspicion is that he's actually been a voice of reason and helps the White House understand the importance of tech."

President Donal Trump and adviser Peter Thiel
President Donal Trump and adviser Peter Thiel

Thiel is also a board member and early investor in Facebook, so he would have some reasons not to push for greater regulation of Silicon Valley. Additionally, Thiel founded Palantir Technologies, a data intelligence startup that contracts with the government.

For now, Silicon Valley seems to have avoided Trump's ire. In fact, if the stock market is any indicator, it would suggest that tech companies have fared quite well during Trump's first year. The FAAMG stocks -- Facebook, Amazon, Microsoft Inc. (MSFT) and Apple Inc. (AAPL) -- are the top five contributors to the S&P 500's rise this year. Those stocks alone account for 23% of the index's gain, according to CNBC. 

In the year since Trump was elected, Apple has returned 62%, Amazon almost 50%, Facebook 48%, Microsoft 43% and Alphabet 34%, compared to 29% for the Nasdaq and 19% for the S&P 500. 

There's no real guarantee that the recent bull run in tech stocks is owed to Trump, however. 

"Tech stocks are doing extremely well because they're doing well as companies," Bajarin explained. "They are innovating, investing, hiring and they're not doing it because of Trump. They're doing it because of their business model which allows them to grow."

Silicon Valley may not owe Trump a thank you for this year's run-up in tech stocks, but it doesn't mean that they shouldn't still worry about playing nice with the president. 

"It's purely transactional on both sides of the equation," Taplin said. "Trump is transactional, he thinks 'What can I get out of these guys?' And, you know, Silicon Valley is the same way, too."

Facebook, Apple and Alphabet are holdings in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells FB, AAPL or GOOGL? Learn more now.

Inside Trump's First Year - TheStreet Special Report

More of What's Trending on TheStreet :

More from Stocks

Market Movers: December FOMC Meeting

Market Movers: December FOMC Meeting

Government Shutdown Won't Hurt Stocks Much, History Says

Government Shutdown Won't Hurt Stocks Much, History Says

UK Prime Minister Theresa May Survives Leadership Challenge; Pound Rallies

UK Prime Minister Theresa May Survives Leadership Challenge; Pound Rallies

Dow Soars on Signs of Progress in U.S.-China Trade Discussions

Dow Soars on Signs of Progress in U.S.-China Trade Discussions

Jim Cramer: Here's Why the Market Rallied

Jim Cramer: Here's Why the Market Rallied