SAN FRANCISCO — On Friday morning, Silicon Valley was largely ambivalent about President Trump. The software programmers, marketing experts and chief executives might not have voted for him, but they were hopeful about finding common ground with the new administration.

By Saturday night, much of that optimism had yielded to anger and determination.

Mr. Trump’s executive order late on Friday temporarily blocked all refugees while also denying entry to citizens of Iran, Iraq and five other predominantly Muslim countries. The directives struck at the heart of Silicon Valley’s cherished values, its fabled history and, not least, its embrace-the-world approach to customers. Two worldviews collided: the mantra of globalization that underpins the advance of technology and the nationalistic agenda of the new administration.

In response, a significant part of the tech community went to the barricades.

Netflix’s chief executive, Reed Hastings, wrote on Facebook that Mr. Trump’s actions “are so un-American it pains us all” and that “it is time to link arms together to protect American values of freedom and opportunity.”

Brian Chesky, the chief executive of Airbnb, made the same point. “We must stand with those who are affected,” he wrote on Twitter.